The following targets are added: testc / testc2.all / testc2.37 / testc2.37+ / testc2.37- testcpp.all / make testcpp.17 This allows to check that the testcase(s) test the code modified. See Makefile tests/pp/Makefile tests/tests2/Makefile lib/tcov.c: Fix while loops with fgets. tcc.h: Fix tcc_p compilation with latest gcc tests/tests2/22_floating_point.*: Better test floating point
Unified · Split
| @@ -16,6 +16,8 @@ · 15 unmodified lines | |||
| 16 | a.out | 16 | a.out |
| 17 | tcc_g | 17 | tcc_g |
| 18 | tcc | 18 | tcc |
| 19 | tcc_c | ||
| 20 | tcc_p | ||
| 19 | *-tcc | 21 | *-tcc |
| 20 | libtcc*.def | 22 | libtcc*.def |
| 21 | 23 | ||
| @@ -31,6 +33,7 @@ tcc.1 · 9 unmodified lines | |||
| 31 | *.pod | 33 | *.pod |
| 32 | tcc-doc.html | 34 | tcc-doc.html |
| 33 | tcc-doc.info | 35 | tcc-doc.info |
| 36 | tcc_c.tcov | ||
| 34 | 37 | ||
| 35 | win32/doc | 38 | win32/doc |
| 36 | win32/examples/libtcc_test.c | 39 | win32/examples/libtcc_test.c |
| @@ -68,7 +68,11 @@ endif · 67 unmodified lines | |||
| 68 | TCCFLAGS-unx = -B$(TOP) -I$(TOPSRC)/include -I$(TOPSRC) -I$(TOP) | 68 | TCCFLAGS-unx = -B$(TOP) -I$(TOPSRC)/include -I$(TOPSRC) -I$(TOP) |
| 69 | TCCFLAGS-win = -B$(TOPSRC)/win32 -I$(TOPSRC)/include -I$(TOPSRC) -I$(TOP) -L$(TOP) | 69 | TCCFLAGS-win = -B$(TOPSRC)/win32 -I$(TOPSRC)/include -I$(TOPSRC) -I$(TOP) -L$(TOP) |
| 70 | TCCFLAGS = $(TCCFLAGS$(CFG)) | 70 | TCCFLAGS = $(TCCFLAGS$(CFG)) |
| 71 | ifdef USE_TCC_C | ||
| 72 | TCC = $(TOP)/tcc_c$(EXESUF) $(TCCFLAGS) | ||
| 73 | else | ||
| 71 | TCC = $(TOP)/tcc$(EXESUF) $(TCCFLAGS) | 74 | TCC = $(TOP)/tcc$(EXESUF) $(TCCFLAGS) |
| 75 | endif | ||
| 72 | 76 | ||
| 73 | CFLAGS_P = $(CFLAGS) -pg -static -DCONFIG_TCC_STATIC -DTCC_PROFILE | 77 | CFLAGS_P = $(CFLAGS) -pg -static -DCONFIG_TCC_STATIC -DTCC_PROFILE |
| 74 | LIBS_P = $(LIBS) | 78 | LIBS_P = $(LIBS) |
| @@ -459,8 +463,21 @@ tests2.%: · 384 unmodified lines | |||
| 459 | testspp.%: | 463 | testspp.%: |
| 460 | @$(MAKE) -C tests/pp $@ | 464 | @$(MAKE) -C tests/pp $@ |
| 461 | 465 | ||
| 466 | # run all tests with code coverage | ||
| 467 | tcc_c$(EXESUF): $($T_FILES) | ||
| 468 | @${TCC} -o $@ -ftest-coverage $< $(DEFINES) $(CFLAGS) $(LIBS) $(LDFLAGS) | ||
| 469 | testc: tcc_c$(EXESUF) | ||
| 470 | @rm -f tcc_c.tcov | ||
| 471 | @USE_TCC_C=yes $(MAKE) -C tests | ||
| 472 | testc2.%: tcc_c$(EXESUF) | ||
| 473 | @rm -f tcc_c.tcov | ||
| 474 | @USE_TCC_C=yes $(MAKE) -C tests/tests2 $@ | ||
| 475 | testcpp.%: tcc_c$(EXESUF) | ||
| 476 | @rm -f tcc_c.tcov | ||
| 477 | @USE_TCC_C=yes $(MAKE) -C tests/pp $@ | ||
| 478 | |||
| 462 | clean: | 479 | clean: |
| 463 | @rm -f tcc$(EXESUF) tcc_p$(EXESUF) *-tcc$(EXESUF) tags ETAGS *.pod | 480 | @rm -f tcc$(EXESUF) tcc_c$(EXESUF) tcc_p$(EXESUF) *-tcc$(EXESUF) tags ETAGS *.pod |
| 464 | @rm -f *.o *.a *.so* *.out *.log lib*.def *.exe *.dll a.out *.dylib *_.h | 481 | @rm -f *.o *.a *.so* *.out *.log lib*.def *.exe *.dll a.out *.dylib *_.h |
| 465 | @$(MAKE) -s -C lib $@ | 482 | @$(MAKE) -s -C lib $@ |
| 466 | @$(MAKE) -s -C tests $@ | 483 | @$(MAKE) -s -C tests $@ |
| @@ -489,12 +506,16 @@ help: · 22 unmodified lines | |||
| 489 | @echo "make test" | 506 | @echo "make test" |
| 490 | @echo " run all tests" | 507 | @echo " run all tests" |
| 491 | @echo "" | 508 | @echo "" |
| 492 | @echo "make tests2.all / make tests2.37 / make tests2.37+" | 509 | @echo "make tests2.all / make tests2.37 / make tests2.37+ / make tests2.37-" |
| 493 | @echo " run all/single test(s) from tests2, optionally update .expect" | 510 | @echo " run all/single test(s) from tests2, optionally update .expect, display" |
| 494 | @echo "" | 511 | @echo "" |
| 495 | @echo "make testspp.all / make testspp.17" | 512 | @echo "make testspp.all / make testspp.17" |
| 496 | @echo " run all/single test(s) from tests/pp" | 513 | @echo " run all/single test(s) from tests/pp" |
| 497 | @echo "" | 514 | @echo "" |
| 515 | @echo "make testc / testc2.all / testc2.37 / testc2.37+ / testc2.37-" | ||
| 516 | @echo "make testcpp.all / make testcpp.17" | ||
| 517 | @echo " run tests with code coverage. After test(s) see tcc_c.tcov" | ||
| 518 | @echo "" | ||
| 498 | @echo "Other supported make targets:" | 519 | @echo "Other supported make targets:" |
| 499 | @echo " install install-strip doc clean tags ETAGS tar distclean help" | 520 | @echo " install install-strip doc clean tags ETAGS tar distclean help" |
| 500 | @echo "" | 521 | @echo "" |
| @@ -340,9 +340,9 @@ void __store_test_coverage (unsigned char * p) · 339 unmodified lines | |||
| 340 | for (i = 0; i < nfile->n_func; i++) { | 340 | for (i = 0; i < nfile->n_func; i++) { |
| 341 | func = &nfile->func[i]; | 341 | func = &nfile->func[i]; |
| 342 | 342 | ||
| 343 | while (curline < func->first_line) | 343 | while (curline < func->first_line && |
| 344 | if (fgets(str, sizeof(str), src)) | 344 | fgets(str, sizeof(str), src)) |
| 345 | fprintf (fp, " -:%5u:%s", curline++, str); | 345 | fprintf (fp, " -:%5u:%s", curline++, str); |
| 346 | blocks = 0; | 346 | blocks = 0; |
| 347 | blocks_run = 0; | 347 | blocks_run = 0; |
| 348 | for (j = 0; j < func->n_line; j++) { | 348 | for (j = 0; j < func->n_line; j++) { |
| @@ -390,9 +390,9 @@ void __store_test_coverage (unsigned char * p) · 41 unmodified lines | |||
| 390 | if (same_line) | 390 | if (same_line) |
| 391 | lline++; | 391 | lline++; |
| 392 | 392 | ||
| 393 | while (curline < fline) | 393 | while (curline < fline && |
| 394 | if (fgets(str, sizeof(str), src)) | 394 | fgets(str, sizeof(str), src)) |
| 395 | fprintf (fp, " -:%5u:%s", curline++, str); | 395 | fprintf (fp, " -:%5u:%s", curline++, str); |
| 396 | while (curline < lline && | 396 | while (curline < lline && |
| 397 | fgets(str, sizeof(str), src)) { | 397 | fgets(str, sizeof(str), src)) { |
| 398 | if (count == 0) | 398 | if (count == 0) |
| @@ -399,6 +399,7 @@ extern long double strtold (const char *__nptr, char **__endptr); · 398 unmodified lines | |||
| 399 | 399 | ||
| 400 | #ifdef TCC_PROFILE /* profile all functions */ | 400 | #ifdef TCC_PROFILE /* profile all functions */ |
| 401 | # define static | 401 | # define static |
| 402 | # define inline | ||
| 402 | #endif | 403 | #endif |
| 403 | 404 | ||
| 404 | /* -------------------------------------------- */ | 405 | /* -------------------------------------------- */ |
| @@ -10,7 +10,7 @@ VPATH = $(SRC) · 9 unmodified lines | |||
| 10 | files = $(patsubst %.$1,%.test,$(notdir $(wildcard $(SRC)/*.$1))) | 10 | files = $(patsubst %.$1,%.test,$(notdir $(wildcard $(SRC)/*.$1))) |
| 11 | TESTS = $(call files,c) $(call files,S) | 11 | TESTS = $(call files,c) $(call files,S) |
| 12 | 12 | ||
| 13 | all test testspp.all: $(sort $(TESTS)) | 13 | all test testspp.all testcpp.all: $(sort $(TESTS)) |
| 14 | 14 | ||
| 15 | DIFF_OPTS = -Nu -b | 15 | DIFF_OPTS = -Nu -b |
| 16 | 16 | ||
| @@ -29,7 +29,7 @@ FILTER = 2>&1 | sed 's,$(SRC)/,,g' · 12 unmodified lines | |||
| 29 | diff $(DIFF_OPTS) $(SRC)/$*.expect $*.output \ | 29 | diff $(DIFF_OPTS) $(SRC)/$*.expect $*.output \ |
| 30 | && rm -f $*.output | 30 | && rm -f $*.output |
| 31 | 31 | ||
| 32 | testspp.%: %.test ; | 32 | testspp.% testcpp.%: %.test ; |
| 33 | 33 | ||
| 34 | # automatically generate .expect files with gcc: | 34 | # automatically generate .expect files with gcc: |
| 35 | %.expect: # %.c | 35 | %.expect: # %.c |
| @@ -14,6 +14,14 @@ test() · 13 unmodified lines | |||
| 14 | } | 14 | } |
| 15 | } | 15 | } |
| 16 | 16 | ||
| 17 | float f1 = 12.34f, f2 = 56.78f; | ||
| 18 | double d1 = 12.34, d2 = 56.78; | ||
| 19 | long double ld1 = 12.34l, ld2 = 56.78l; | ||
| 20 | |||
| 21 | float tf = 12.34f + 56.78f - 12.34f * 56.78f + 12.34f / 56.78f; | ||
| 22 | double td = 12.34 + 56.78 - 12.34 * 56.78 + 12.34 / 56.78; | ||
| 23 | long double tld = 12.34l + 56.78l - 12.34l * 56.78l + 12.34l / 56.78l; | ||
| 24 | |||
| 17 | int main() | 25 | int main() |
| 18 | { | 26 | { |
| 19 | static int e1 = -1.0 == 0.0; | 27 | static int e1 = -1.0 == 0.0; |
| @@ -23,45 +31,91 @@ int main() · 3 unmodified lines | |||
| 23 | static int e5 = -1.0 <= 0.0; | 31 | static int e5 = -1.0 <= 0.0; |
| 24 | static int e6 = -1.0 > 0.0; | 32 | static int e6 = -1.0 > 0.0; |
| 25 | // variables | 33 | // variables |
| 26 | float a = 12.34 + 56.78; | 34 | float af = 12.34f + 56.78f; |
| 27 | printf("%f\n", a); | 35 | double ad = 12.34 + 56.78; |
| 36 | long double ald = 12.34l + 56.78l; | ||
| 37 | printf("%f %f \n", af, tf); | ||
| 38 | printf("%g %g\n", ad, td); | ||
| 39 | printf("%Lf %Lf\n", ald, tld); | ||
| 28 | 40 | ||
| 29 | // infix operators | 41 | // infix operators |
| 30 | printf("%f\n", 12.34 + 56.78); | 42 | printf("%f %f %f %f\n", 12.34f + 56.78f, 12.34f - 56.78f, 12.34f * 56.78f, 12.34f / 56.78f); |
| 31 | printf("%f\n", 12.34 - 56.78); | 43 | printf("%g %g %g %g\n", 12.34 + 56.78, 12.34 - 56.78, 12.34 * 56.78, 12.34 / 56.78); |
| 32 | printf("%f\n", 12.34 * 56.78); | 44 | printf("%Lf %Lf %Lf %Lf\n", 12.34l + 56.78l, 12.34l - 56.78l, 12.34l * 56.78l, 12.34l / 56.78l); |
| 33 | printf("%f\n", 12.34 / 56.78); | 45 | #ifdef __i386__ |
| 46 | // gcc/clang -m32 -mno-sse and tcc all fail for + and * but all have the same value | ||
| 47 | printf("%f %f %f %f\n", 12.34f + 56.78f, f1 - f2, 12.34f * 56.78f, f1 / f2); | ||
| 48 | #else | ||
| 49 | printf("%f %f %f %f\n", f1 + f2, f1 - f2, f1 * f2, f1 / f2); | ||
| 50 | #endif | ||
| 51 | printf("%g %g %g %g\n", d1 + d2, d1 - d2, d1 * d2, d1 / d2); | ||
| 52 | printf("%Lf %Lf %Lf %Lf\n", ld1 + ld2, ld1 - ld2, ld1 * ld2, ld1 / ld2); | ||
| 34 | 53 | ||
| 35 | // comparison operators | 54 | // comparison operators |
| 55 | printf("%d %d %d %d %d %d\n", 12.34f < 56.78f, 12.34f <= 56.78f, 12.34f == 56.78f, 12.34f >= 56.78f, 12.34f > 56.78f, 12.34f != 56.78f); | ||
| 56 | printf("%d %d %d %d %d %d\n", 12.34f < 12.34f, 12.34f <= 12.34f, 12.34f == 12.34f, 12.34f >= 12.34f, 12.34f > 12.34f, 12.34f != 12.34f); | ||
| 57 | printf("%d %d %d %d %d %d\n", 56.78f < 12.34f, 56.78f <= 12.34f, 56.78f == 12.34f, 56.78f >= 12.34f, 56.78f > 12.34f, 56.78f != 12.34f); | ||
| 36 | printf("%d %d %d %d %d %d\n", 12.34 < 56.78, 12.34 <= 56.78, 12.34 == 56.78, 12.34 >= 56.78, 12.34 > 56.78, 12.34 != 56.78); | 58 | printf("%d %d %d %d %d %d\n", 12.34 < 56.78, 12.34 <= 56.78, 12.34 == 56.78, 12.34 >= 56.78, 12.34 > 56.78, 12.34 != 56.78); |
| 37 | printf("%d %d %d %d %d %d\n", 12.34 < 12.34, 12.34 <= 12.34, 12.34 == 12.34, 12.34 >= 12.34, 12.34 > 12.34, 12.34 != 12.34); | 59 | printf("%d %d %d %d %d %d\n", 12.34 < 12.34, 12.34 <= 12.34, 12.34 == 12.34, 12.34 >= 12.34, 12.34 > 12.34, 12.34 != 12.34); |
| 38 | printf("%d %d %d %d %d %d\n", 56.78 < 12.34, 56.78 <= 12.34, 56.78 == 12.34, 56.78 >= 12.34, 56.78 > 12.34, 56.78 != 12.34); | 60 | printf("%d %d %d %d %d %d\n", 56.78 < 12.34, 56.78 <= 12.34, 56.78 == 12.34, 56.78 >= 12.34, 56.78 > 12.34, 56.78 != 12.34); |
| 61 | printf("%d %d %d %d %d %d\n", 12.34l < 56.78l, 12.34l <= 56.78l, 12.34l == 56.78l, 12.34l >= 56.78l, 12.34l > 56.78l, 12.34l != 56.78l); | ||
| 62 | printf("%d %d %d %d %d %d\n", 12.34l < 12.34l, 12.34l <= 12.34l, 12.34l == 12.34l, 12.34l >= 12.34l, 12.34l > 12.34l, 12.34l != 12.34l); | ||
| 63 | printf("%d %d %d %d %d %d\n", 56.78l < 12.34l, 56.78l <= 12.34l, 56.78l == 12.34l, 56.78l >= 12.34l, 56.78l > 12.34l, 56.78l != 12.34l); | ||
| 64 | printf("%d %d %d %d %d %d\n", f1 < f2, f1 <= f2, f1 == f2, f1 >= f2, f1 > f2, f1 != f2); | ||
| 65 | printf("%d %d %d %d %d %d\n", f1 < f1, f1 <= f1, f1 == f1, f1 >= f1, f1 > f1, f1 != f1); | ||
| 66 | printf("%d %d %d %d %d %d\n", f2 < f1, f2 <= f1, f2 == f1, f2 >= f1, f2 > f1, f2 != f1); | ||
| 67 | printf("%d %d %d %d %d %d\n", d1 < d2, d1 <= d2, d1 == d2, d1 >= d2, d1 > d2, d1 != d2); | ||
| 68 | printf("%d %d %d %d %d %d\n", d1 < d1, d1 <= d1, d1 == d1, d1 >= d1, d1 > d1, d1 != d1); | ||
| 69 | printf("%d %d %d %d %d %d\n", d2 < d1, d2 <= d1, d2 == d1, d2 >= d1, d2 > d1, d2 != d1); | ||
| 70 | printf("%d %d %d %d %d %d\n", ld1 < ld2, ld1 <= ld2, ld1 == ld2, ld1 >= ld2, ld1 > ld2, ld1 != ld2); | ||
| 71 | printf("%d %d %d %d %d %d\n", ld1 < ld1, ld1 <= ld1, ld1 == ld1, ld1 >= ld1, ld1 > ld1, ld1 != ld1); | ||
| 72 | printf("%d %d %d %d %d %d\n", ld2 < ld1, ld2 <= ld1, ld2 == ld1, ld2 >= ld1, ld2 > ld1, ld2 != ld1); | ||
| 39 | printf("%d %d %d %d %d %d\n", e1, e2, e3, e4, e5, e6); | 73 | printf("%d %d %d %d %d %d\n", e1, e2, e3, e4, e5, e6); |
| 40 | 74 | ||
| 41 | // assignment operators | 75 | // assignment operators |
| 42 | a = 12.34; | 76 | af = 12.34f; ad = 12.34; ald = 12.34l; |
| 43 | a += 56.78; | 77 | af += 56.78f; ad += 56.78; ald += 56.78l; |
| 44 | printf("%f\n", a); | 78 | printf("%f %g %Lf\n", af, ad, ald); |
| 79 | #ifdef __i386__ | ||
| 80 | printf("%f %g %Lf\n", af, ad, ald); | ||
| 81 | #else | ||
| 82 | af = f1; ad = d1; ald = ld1; | ||
| 83 | af += f2; ad += d2; ald += ld2; | ||
| 84 | printf("%f %g %Lf\n", af, ad, ald); | ||
| 85 | #endif | ||
| 45 | 86 | ||
| 46 | a = 12.34; | 87 | af = 12.34f; ad = 12.34; ald = 12.34l; |
| 47 | a -= 56.78; | 88 | af -= 56.78f; ad -= 56.78; ald -= 56.78l; |
| 48 | printf("%f\n", a); | 89 | printf("%f %g %Lf\n", af, ad, ald); |
| 90 | af = f1; ad = d1; ald = ld1; | ||
| 91 | af -= f2; ad -= d2; ald -= ld2; | ||
| 92 | printf("%f %g %Lf\n", af, ad, ald); | ||
| 49 | 93 | ||
| 50 | a = 12.34; | 94 | af = 12.34f; ad = 12.34; ald = 12.34l; |
| 51 | a *= 56.78; | 95 | af *= 56.78f; ad *= 56.78; ald *= 56.78l; |
| 52 | printf("%f\n", a); | 96 | printf("%f %g %Lf\n", af, ad, ald); |
| 97 | #ifdef __i386__ | ||
| 98 | printf("%f %g %Lf\n", af, ad, ald); | ||
| 99 | #else | ||
| 100 | af = f1; ad = d1; ald = ld1; | ||
| 101 | af *= f2; ad *= d2; ald *= ld2; | ||
| 102 | printf("%f %g %Lf\n", af, ad, ald); | ||
| 103 | #endif | ||
| 53 | 104 | ||
| 54 | a = 12.34; | 105 | af = 12.34f; ad = 12.34; ald = 12.34l; |
| 55 | a /= 56.78; | 106 | af /= 56.78f; ad /= 56.78; ald /= 56.78l; |
| 56 | printf("%f\n", a); | 107 | printf("%f %g %Lf\n", af, ad, ald); |
| 108 | af = f1; ad = d1; ald = ld1; | ||
| 109 | af /= f2; ad /= d2; ald /= ld2; | ||
| 110 | printf("%f %g %Lf\n", af, ad, ald); | ||
| 57 | 111 | ||
| 58 | // prefix operators | 112 | // prefix operators |
| 59 | printf("%f\n", +12.34); | 113 | printf("%f %g %Lf\n", +12.34f, +12.34, +12.34l); |
| 60 | printf("%f\n", -12.34); | 114 | printf("%f %g %Lf\n", -12.34f, -12.34, -12.34l); |
| 61 | 115 | ||
| 62 | // type coercion | 116 | // type coercion |
| 63 | a = 2; | 117 | af = 2; |
| 64 | printf("%f\n", a); | 118 | printf("%f\n", af); |
| 65 | printf("%f\n", sin(2)); | 119 | printf("%f\n", sin(2)); |
| 66 | 120 | ||
| 67 | return 0; | 121 | return 0; |
| @@ -1,17 +1,40 @@ | |||
| 1 | 69.120003 | 1 | 69.119995 -631.327881 |
| 2 | 69.120000 | 2 | 69.12 -631.328 |
| 3 | -44.440000 | 3 | 69.120000 -631.327870 |
| 4 | 700.665200 | 4 | 69.119995 -44.439999 700.665222 0.217330 |
| 5 | 0.217330 | 5 | 69.12 -44.44 700.665 0.21733 |
| 6 | 69.120000 -44.440000 700.665200 0.217330 | ||
| 7 | 69.119995 -44.439999 700.665222 0.217330 | ||
| 8 | 69.12 -44.44 700.665 0.21733 | ||
| 9 | 69.120000 -44.440000 700.665200 0.217330 | ||
| 10 | 1 1 0 0 0 1 | ||
| 11 | 0 1 1 1 0 0 | ||
| 12 | 0 0 0 1 1 1 | ||
| 13 | 1 1 0 0 0 1 | ||
| 14 | 0 1 1 1 0 0 | ||
| 15 | 0 0 0 1 1 1 | ||
| 16 | 1 1 0 0 0 1 | ||
| 17 | 0 1 1 1 0 0 | ||
| 18 | 0 0 0 1 1 1 | ||
| 19 | 1 1 0 0 0 1 | ||
| 20 | 0 1 1 1 0 0 | ||
| 21 | 0 0 0 1 1 1 | ||
| 22 | 1 1 0 0 0 1 | ||
| 23 | 0 1 1 1 0 0 | ||
| 24 | 0 0 0 1 1 1 | ||
| 6 | 1 1 0 0 0 1 | 25 | 1 1 0 0 0 1 |
| 7 | 0 1 1 1 0 0 | 26 | 0 1 1 1 0 0 |
| 8 | 0 0 0 1 1 1 | 27 | 0 0 0 1 1 1 |
| 9 | 0 1 1 0 1 0 | 28 | 0 1 1 0 1 0 |
| 10 | 69.120003 | 29 | 69.119995 69.12 69.120000 |
| 11 | -44.439999 | 30 | 69.119995 69.12 69.120000 |
| 12 | 700.665222 | 31 | -44.439999 -44.44 -44.440000 |
| 13 | 0.217330 | 32 | -44.439999 -44.44 -44.440000 |
| 14 | 12.340000 | 33 | 700.665222 700.665 700.665200 |
| 15 | -12.340000 | 34 | 700.665222 700.665 700.665200 |
| 35 | 0.217330 0.21733 0.217330 | ||
| 36 | 0.217330 0.21733 0.217330 | ||
| 37 | 12.340000 12.34 12.340000 | ||
| 38 | -12.340000 -12.34 -12.340000 | ||
| 16 | 2.000000 | 39 | 2.000000 |
| 17 | 0.909297 | 40 | 0.909297 |
| @@ -124,7 +124,7 @@ endif · 123 unmodified lines | |||
| 124 | # Filter source directory in warnings/errors (out-of-tree builds) | 124 | # Filter source directory in warnings/errors (out-of-tree builds) |
| 125 | FILTER = 2>&1 | sed -e 's,$(SRC)/,,g' | 125 | FILTER = 2>&1 | sed -e 's,$(SRC)/,,g' |
| 126 | 126 | ||
| 127 | all test tests2.all: $(filter-out $(SKIP),$(TESTS)) | 127 | all test tests2.all testc2.all: $(filter-out $(SKIP),$(TESTS)) |
| 128 | @$(MAKE) clean --no-print-directory -s | 128 | @$(MAKE) clean --no-print-directory -s |
| 129 | 129 | ||
| 130 | %.test: %.c %.expect | 130 | %.test: %.c %.expect |
| @@ -138,15 +138,15 @@ T3 = $(FILTER) >$*.output 2>&1 || true \ · 7 unmodified lines | |||
| 138 | && rm -f $*.output $(filter $*.expect,$(GEN-ALWAYS)) | 138 | && rm -f $*.output $(filter $*.expect,$(GEN-ALWAYS)) |
| 139 | 139 | ||
| 140 | # run single test and update .expect file, e.g. "make tests2.37+" | 140 | # run single test and update .expect file, e.g. "make tests2.37+" |
| 141 | tests2.%+: | 141 | tests2.%+ testc2.%+: |
| 142 | @$(MAKE) $(call F2,$(call F1,$*)) --no-print-directory | 142 | @$(MAKE) $(call F2,$(call F1,$*)) --no-print-directory |
| 143 | 143 | ||
| 144 | # just run tcc to see the output, e.g. "make tests2.37-" | 144 | # just run tcc to see the output, e.g. "make tests2.37-" |
| 145 | tests2.%-: | 145 | tests2.%- testc2.%-: |
| 146 | @$(MAKE) $(call F1,$*) T3= --no-print-directory | 146 | @$(MAKE) $(call F1,$*) T3= --no-print-directory |
| 147 | 147 | ||
| 148 | # run single test, e.g. "make tests2.37" | 148 | # run single test, e.g. "make tests2.37" |
| 149 | tests2.%: | 149 | tests2.% testc2.%: |
| 150 | @$(MAKE) $(call F1,$*) --no-print-directory | 150 | @$(MAKE) $(call F1,$*) --no-print-directory |
| 151 | 151 | ||
| 152 | F1 = $(or $(filter $1_%,$(TESTS)),$1_???.test) | 152 | F1 = $(or $(filter $1_%,$(TESTS)),$1_???.test) |