tests: generate test.ref with TCC instead of host CC

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.
This commit is contained in:
Meng Zhuo
2026-05-06 14:43:30 +08:00
parent 3935c3bb55
commit 199369bb17

View File

@@ -110,8 +110,8 @@ libtcc_test_mt$(EXESUF): libtcc_test_mt.c
# test.ref - generate using cc
test.ref: tcctest.c
$(CC) -o tcctest.gcc$(EXESUF) $< $(CFLAGS) -w -O0 -std=gnu99 -fno-omit-frame-pointer
./tcctest.gcc$(EXESUF) > $@
$(TCC) $(TCCFLAGS) -w -o tcctest.tcc$(EXESUF) $<
./tcctest.tcc$(EXESUF) > $@
# auto test
test1 test1b: tcctest.c test.ref