aboutsummaryrefslogtreecommitdiff
path: root/tests/Makefile
diff options
context:
space:
mode:
authorgrischka <grischka>2014-01-06 19:56:26 +0100
committergrischka <grischka>2014-01-06 19:56:26 +0100
commit2bd0daabbe1fc40e65e4a4631e68f5ca093ea1fb (patch)
treee556d3d04da0db0d13a58905875537c09302c163 /tests/Makefile
parentd443644de360f68a84c05ab23f20f013b6e05b58 (diff)
downloadtinycc-2bd0daabbe1fc40e65e4a4631e68f5ca093ea1fb.tar.gz
tinycc-2bd0daabbe1fc40e65e4a4631e68f5ca093ea1fb.tar.bz2
misc. fixes
- tccgen: error out for cast to void, as in void foo(void) { return 1; } This avoids an assertion failure in x86_64-gen.c, also. also fix tests2/03_struct.c accordingly - Error: "memory full" - be more specific - Makefiles: remove circular dependencies, lookup tcctest.c from VPATH - tcc.h: cleanup lib, include, crt and libgcc search paths" avoid duplication or trailing slashes with no CONFIG_MULTIARCHDIR (as from 9382d6f1a0e2d0104a82ed805207d9e742c6b068) - tcc.h: remove ";{B}" from PE search path in ce5e12c2f950052d8109b6b7a56d900547705c08 James Lyon wrote: "... I'm not sure this is the right way to fix this problem." And the answer is: No, please. (copying libtcc1.a for tests instead) - win32/build_tcc.bat: do not move away a versioned file
Diffstat (limited to 'tests/Makefile')
-rw-r--r--tests/Makefile39
1 files changed, 20 insertions, 19 deletions
diff --git a/tests/Makefile b/tests/Makefile
index 08dfa42..b958a48 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -27,7 +27,7 @@ ifneq ($(ARCH),i386)
TESTS := $(filter-out btest,$(TESTS))
endif
ifdef CONFIG_WIN32
- TESTS := $(filter-out test3,$(TESTS))
+ TESTS := w32-prep $(filter-out test3,$(TESTS))
endif
ifeq ($(TARGETOS),Darwin)
TESTS := $(filter-out hello-exe test3 btest,$(TESTS))
@@ -84,6 +84,9 @@ moretests:
@echo ------------ $@ ------------
$(MAKE) -C tests2
+w32-prep:
+ cp ../libtcc1.a ../lib
+
# test.ref - generate using gcc
# copy only tcclib.h so GCC's stddef and stdarg will be used
test.ref: tcctest.c
@@ -91,41 +94,41 @@ test.ref: tcctest.c
./tcctest.gcc > $@
# auto test
-test1: test.ref
+test1: tcctest.c test.ref
@echo ------------ $@ ------------
- $(TCC) -run $(SRCDIR)/tcctest.c > test.out1
+ $(TCC) -run $< > test.out1
@if diff -u test.ref test.out1 ; then echo "Auto Test OK"; fi
# iterated test2 (compile tcc then compile tcctest.c !)
-test2: test.ref
+test2: tcctest.c test.ref
@echo ------------ $@ ------------
- $(TCC) $(RUN_TCC) $(RUN_TCC) -run $(SRCDIR)/tcctest.c > test.out2
+ $(TCC) $(RUN_TCC) $(RUN_TCC) -run $< > test.out2
@if diff -u test.ref test.out2 ; then echo "Auto Test2 OK"; fi
# iterated test3 (compile tcc then compile tcc then compile tcctest.c !)
-test3: test.ref
+test3: tcctest.c test.ref
@echo ------------ $@ ------------
- $(TCC) $(RUN_TCC) $(RUN_TCC) $(RUN_TCC) -run $(SRCDIR)/tcctest.c > test.out3
+ $(TCC) $(RUN_TCC) $(RUN_TCC) $(RUN_TCC) -run $< > test.out3
@if diff -u test.ref test.out3 ; then echo "Auto Test3 OK"; fi
# binary output test
-test4: test.ref
+test4: tcctest.c test.ref
@echo ------------ $@ ------------
# object + link output
- $(TCC) -c -o tcctest3.o $(SRCDIR)/tcctest.c
+ $(TCC) -c -o tcctest3.o $<
$(TCC) -o tcctest3 tcctest3.o
./tcctest3 > test3.out
@if diff -u test.ref test3.out ; then echo "Object Auto Test OK"; fi
# dynamic output
- $(TCC) -o tcctest1 $(SRCDIR)/tcctest.c
+ $(TCC) -o tcctest1 $<
./tcctest1 > test1.out
@if diff -u test.ref test1.out ; then echo "Dynamic Auto Test OK"; fi
# dynamic output + bound check
- $(TCC) -b -o tcctest4 $(SRCDIR)/tcctest.c
+ $(TCC) -b -o tcctest4 $<
./tcctest4 > test4.out
@if diff -u test.ref test4.out ; then echo "BCheck Auto Test OK"; fi
# static output
- $(TCC) -static -o tcctest2 $(SRCDIR)/tcctest.c
+ $(TCC) -static -o tcctest2 $<
./tcctest2 > test2.out
@if diff -u test.ref test2.out ; then echo "Static Auto Test OK"; fi
@@ -161,9 +164,9 @@ speedtest: ex2 ex3
time ./ex3 35
time $(TCC) -run $(top_srcdir)/examples/ex3.c 35
-weaktest: test.ref
- $(TCC) -c tcctest.c -o weaktest.tcc.o $(CPPFLAGS) $(CFLAGS)
- $(CC) -c tcctest.c -o weaktest.gcc.o -I. $(CPPFLAGS) -w $(CFLAGS)
+weaktest: tcctest.c test.ref
+ $(TCC) -c $< -o weaktest.tcc.o $(CPPFLAGS) $(CFLAGS)
+ $(CC) -c $< -o weaktest.gcc.o -I. $(CPPFLAGS) -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"
@@ -220,7 +223,5 @@ cache: tcc_g
clean:
$(MAKE) -C tests2 $@
rm -vf *~ *.o *.a *.bin *.i *.ref *.out *.out? *.out?b *.gcc *.exe \
- hello libtcc_test tcctest[1234] ex? tcc_g tcclib.h
-
-Makefile: $(SRCDIR)/Makefile
- cp $< $@
+ hello libtcc_test tcctest[1234] ex? tcc_g tcclib.h \
+ ../lib/libtcc1.a