Skip to content

Commit 199369b

Browse files
committed
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.
1 parent 3935c3b commit 199369b

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

tests/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,8 @@ libtcc_test_mt$(EXESUF): libtcc_test_mt.c
110110

111111
# test.ref - generate using cc
112112
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) > $@
115115

116116
# auto test
117117
test1 test1b: tcctest.c test.ref

0 commit comments

Comments
 (0)