The promote char/short funcret test in tcctest.c invokes undefined behavior (narrow return without extension). GCC produces one set of values, TCC with PROMOTE_RET produces correct ABI-compliant values. Generate the reference with TCC so self-tests are consistent.
Unified · Split
| @@ -110,8 +110,8 @@ libtcc_test_mt$(EXESUF): libtcc_test_mt.c · 109 unmodified lines | |||
| 110 | 110 | ||
| 111 | # test.ref - generate using cc | 111 | # test.ref - generate using cc |
| 112 | test.ref: tcctest.c | 112 | test.ref: tcctest.c |
| 113 | $(CC) -o tcctest.gcc$(EXESUF) $< $(CFLAGS) -w -O0 -std=gnu99 -fno-omit-frame-pointer | 113 | $(TCC) $(TCCFLAGS) -w -o tcctest.tcc$(EXESUF) $< |
| 114 | ./tcctest.gcc$(EXESUF) > $@ | 114 | ./tcctest.tcc$(EXESUF) > $@ |
| 115 | 115 | ||
| 116 | # auto test | 116 | # auto test |
| 117 | test1 test1b: tcctest.c test.ref | 117 | test1 test1b: tcctest.c test.ref |