From cf08675702044c180553c866ba1fde0414f00590 Mon Sep 17 00:00:00 2001 From: Joe Soroka Date: Tue, 1 Feb 2011 09:41:03 -0800 Subject: weak definitions overrule non-weak prototypes --- tests/Makefile | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'tests/Makefile') diff --git a/tests/Makefile b/tests/Makefile index 017f35c..4bebc2b 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -6,7 +6,7 @@ TESTS = libtest test3 # these should work too -# TESTS += test1 test2 speedtest btest +# TESTS += test1 test2 speedtest btest weaktest # these don't work as they should # TESTS += test4 asmtest @@ -26,7 +26,7 @@ DISAS=objdump -d all test : $(TESTS) # make sure that tcc exists -test1 test2 test3 test4 btest speedtest asmtest : ../tcc +test1 test2 test3 test4 btest speedtest asmtest weaktest : ../tcc ../%: $(MAKE) -C .. $* @@ -116,6 +116,13 @@ speedtest: ex2 ex3 time ./ex3 35 time $(TCC) -run ../examples/ex3.c 35 +weaktest: test.ref + $(TCC) -c tcctest.c -o weaktest.tcc.o + $(CC) -c tcctest.c -o weaktest.gcc.o -I. -w $(CFLAGS) + objdump -t weaktest.tcc.o | grep ' w ' | sed -e 's/.* \([a-zA-Z0-9_]*\)$$/\1/' | LC_ALL=C sort > weaktest.tcc.o.txt + objdump -t weaktest.gcc.o | grep ' w ' | sed -e 's/.* \([a-zA-Z0-9_]*\)$$/\1/' | LC_ALL=C sort > weaktest.gcc.o.txt + diff weaktest.gcc.o.txt weaktest.tcc.o.txt && echo "Weak Auto Test OK" + ex%: ../examples/ex%.c $(CC) -o $@ $< $(CFLAGS) -- cgit v1.3.1