From 199369bb170df5b79443583a4495d89b9ee6df63 Mon Sep 17 00:00:00 2001 From: Meng Zhuo Date: Wed, 6 May 2026 14:43:30 +0800 Subject: [PATCH] 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. --- tests/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/Makefile b/tests/Makefile index adb5733c..c0b8afcf 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -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