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 | 111 | # test.ref - generate using cc |
| 112 | 112 | test.ref: tcctest.c |
| 113 | − $(CC) -o tcctest.gcc$(EXESUF) $< $(CFLAGS) -w -O0 -std=gnu99 -fno-omit-frame-pointer | |
| 114 | − ./tcctest.gcc$(EXESUF) > $@ | |
| 113 | + $(TCC) $(TCCFLAGS) -w -o tcctest.tcc$(EXESUF) $< | |
| 114 | + ./tcctest.tcc$(EXESUF) > $@ | |
| 115 | 115 | |
| 116 | 116 | # auto test |
| 117 | 117 | test1 test1b: tcctest.c test.ref |