- 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
Showing the changes to tests (3 of 10 files). Show all
Unified · Split
| @@ -27,7 +27,7 @@ ifneq ($(ARCH),i386) · 26 unmodified lines | |||
| 27 | TESTS := $(filter-out btest,$(TESTS)) | 27 | TESTS := $(filter-out btest,$(TESTS)) |
| 28 | endif | 28 | endif |
| 29 | ifdef CONFIG_WIN32 | 29 | ifdef CONFIG_WIN32 |
| 30 | TESTS := $(filter-out test3,$(TESTS)) | 30 | TESTS := w32-prep $(filter-out test3,$(TESTS)) |
| 31 | endif | 31 | endif |
| 32 | ifeq ($(TARGETOS),Darwin) | 32 | ifeq ($(TARGETOS),Darwin) |
| 33 | TESTS := $(filter-out hello-exe test3 btest,$(TESTS)) | 33 | TESTS := $(filter-out hello-exe test3 btest,$(TESTS)) |
| @@ -84,6 +84,9 @@ moretests: · 50 unmodified lines | |||
| 84 | @echo ------------ $@ ------------ | 84 | @echo ------------ $@ ------------ |
| 85 | $(MAKE) -C tests2 | 85 | $(MAKE) -C tests2 |
| 86 | 86 | ||
| 87 | w32-prep: | ||
| 88 | cp ../libtcc1.a ../lib | ||
| 89 | |||
| 87 | # test.ref - generate using gcc | 90 | # test.ref - generate using gcc |
| 88 | # copy only tcclib.h so GCC's stddef and stdarg will be used | 91 | # copy only tcclib.h so GCC's stddef and stdarg will be used |
| 89 | test.ref: tcctest.c | 92 | test.ref: tcctest.c |
| @@ -91,41 +94,41 @@ test.ref: tcctest.c · 1 unmodified line | |||
| 91 | ./tcctest.gcc > $@ | 94 | ./tcctest.gcc > $@ |
| 92 | 95 | ||
| 93 | # auto test | 96 | # auto test |
| 94 | test1: test.ref | 97 | test1: tcctest.c test.ref |
| 95 | @echo ------------ $@ ------------ | 98 | @echo ------------ $@ ------------ |
| 96 | $(TCC) -run $(SRCDIR)/tcctest.c > test.out1 | 99 | $(TCC) -run $< > test.out1 |
| 97 | @if diff -u test.ref test.out1 ; then echo "Auto Test OK"; fi | 100 | @if diff -u test.ref test.out1 ; then echo "Auto Test OK"; fi |
| 98 | 101 | ||
| 99 | # iterated test2 (compile tcc then compile tcctest.c !) | 102 | # iterated test2 (compile tcc then compile tcctest.c !) |
| 100 | test2: test.ref | 103 | test2: tcctest.c test.ref |
| 101 | @echo ------------ $@ ------------ | 104 | @echo ------------ $@ ------------ |
| 102 | $(TCC) $(RUN_TCC) $(RUN_TCC) -run $(SRCDIR)/tcctest.c > test.out2 | 105 | $(TCC) $(RUN_TCC) $(RUN_TCC) -run $< > test.out2 |
| 103 | @if diff -u test.ref test.out2 ; then echo "Auto Test2 OK"; fi | 106 | @if diff -u test.ref test.out2 ; then echo "Auto Test2 OK"; fi |
| 104 | 107 | ||
| 105 | # iterated test3 (compile tcc then compile tcc then compile tcctest.c !) | 108 | # iterated test3 (compile tcc then compile tcc then compile tcctest.c !) |
| 106 | test3: test.ref | 109 | test3: tcctest.c test.ref |
| 107 | @echo ------------ $@ ------------ | 110 | @echo ------------ $@ ------------ |
| 108 | $(TCC) $(RUN_TCC) $(RUN_TCC) $(RUN_TCC) -run $(SRCDIR)/tcctest.c > test.out3 | 111 | $(TCC) $(RUN_TCC) $(RUN_TCC) $(RUN_TCC) -run $< > test.out3 |
| 109 | @if diff -u test.ref test.out3 ; then echo "Auto Test3 OK"; fi | 112 | @if diff -u test.ref test.out3 ; then echo "Auto Test3 OK"; fi |
| 110 | 113 | ||
| 111 | # binary output test | 114 | # binary output test |
| 112 | test4: test.ref | 115 | test4: tcctest.c test.ref |
| 113 | @echo ------------ $@ ------------ | 116 | @echo ------------ $@ ------------ |
| 114 | # object + link output | 117 | # object + link output |
| 115 | $(TCC) -c -o tcctest3.o $(SRCDIR)/tcctest.c | 118 | $(TCC) -c -o tcctest3.o $< |
| 116 | $(TCC) -o tcctest3 tcctest3.o | 119 | $(TCC) -o tcctest3 tcctest3.o |
| 117 | ./tcctest3 > test3.out | 120 | ./tcctest3 > test3.out |
| 118 | @if diff -u test.ref test3.out ; then echo "Object Auto Test OK"; fi | 121 | @if diff -u test.ref test3.out ; then echo "Object Auto Test OK"; fi |
| 119 | # dynamic output | 122 | # dynamic output |
| 120 | $(TCC) -o tcctest1 $(SRCDIR)/tcctest.c | 123 | $(TCC) -o tcctest1 $< |
| 121 | ./tcctest1 > test1.out | 124 | ./tcctest1 > test1.out |
| 122 | @if diff -u test.ref test1.out ; then echo "Dynamic Auto Test OK"; fi | 125 | @if diff -u test.ref test1.out ; then echo "Dynamic Auto Test OK"; fi |
| 123 | # dynamic output + bound check | 126 | # dynamic output + bound check |
| 124 | $(TCC) -b -o tcctest4 $(SRCDIR)/tcctest.c | 127 | $(TCC) -b -o tcctest4 $< |
| 125 | ./tcctest4 > test4.out | 128 | ./tcctest4 > test4.out |
| 126 | @if diff -u test.ref test4.out ; then echo "BCheck Auto Test OK"; fi | 129 | @if diff -u test.ref test4.out ; then echo "BCheck Auto Test OK"; fi |
| 127 | # static output | 130 | # static output |
| 128 | $(TCC) -static -o tcctest2 $(SRCDIR)/tcctest.c | 131 | $(TCC) -static -o tcctest2 $< |
| 129 | ./tcctest2 > test2.out | 132 | ./tcctest2 > test2.out |
| 130 | @if diff -u test.ref test2.out ; then echo "Static Auto Test OK"; fi | 133 | @if diff -u test.ref test2.out ; then echo "Static Auto Test OK"; fi |
| 131 | 134 | ||
| @@ -161,9 +164,9 @@ speedtest: ex2 ex3 · 29 unmodified lines | |||
| 161 | time ./ex3 35 | 164 | time ./ex3 35 |
| 162 | time $(TCC) -run $(top_srcdir)/examples/ex3.c 35 | 165 | time $(TCC) -run $(top_srcdir)/examples/ex3.c 35 |
| 163 | 166 | ||
| 164 | weaktest: test.ref | 167 | weaktest: tcctest.c test.ref |
| 165 | $(TCC) -c tcctest.c -o weaktest.tcc.o $(CPPFLAGS) $(CFLAGS) | 168 | $(TCC) -c $< -o weaktest.tcc.o $(CPPFLAGS) $(CFLAGS) |
| 166 | $(CC) -c tcctest.c -o weaktest.gcc.o -I. $(CPPFLAGS) -w $(CFLAGS) | 169 | $(CC) -c $< -o weaktest.gcc.o -I. $(CPPFLAGS) -w $(CFLAGS) |
| 167 | objdump -t weaktest.tcc.o | grep ' w ' | sed -e 's/.* \([a-zA-Z0-9_]*\)$$/\1/' | LC_ALL=C sort > weaktest.tcc.o.txt | 170 | objdump -t weaktest.tcc.o | grep ' w ' | sed -e 's/.* \([a-zA-Z0-9_]*\)$$/\1/' | LC_ALL=C sort > weaktest.tcc.o.txt |
| 168 | objdump -t weaktest.gcc.o | grep ' w ' | sed -e 's/.* \([a-zA-Z0-9_]*\)$$/\1/' | LC_ALL=C sort > weaktest.gcc.o.txt | 171 | objdump -t weaktest.gcc.o | grep ' w ' | sed -e 's/.* \([a-zA-Z0-9_]*\)$$/\1/' | LC_ALL=C sort > weaktest.gcc.o.txt |
| 169 | diff weaktest.gcc.o.txt weaktest.tcc.o.txt && echo "Weak Auto Test OK" | 172 | diff weaktest.gcc.o.txt weaktest.tcc.o.txt && echo "Weak Auto Test OK" |
| @@ -220,7 +223,5 @@ cache: tcc_g · 50 unmodified lines | |||
| 220 | clean: | 223 | clean: |
| 221 | $(MAKE) -C tests2 $@ | 224 | $(MAKE) -C tests2 $@ |
| 222 | rm -vf *~ *.o *.a *.bin *.i *.ref *.out *.out? *.out?b *.gcc *.exe \ | 225 | rm -vf *~ *.o *.a *.bin *.i *.ref *.out *.out? *.out?b *.gcc *.exe \ |
| 223 | hello libtcc_test tcctest[1234] ex? tcc_g tcclib.h | 226 | hello libtcc_test tcctest[1234] ex? tcc_g tcclib.h \ |
| 224 | 227 | ../lib/libtcc1.a | |
| 225 | Makefile: $(SRCDIR)/Makefile | ||
| 226 | cp $< $@ | ||
| @@ -6,7 +6,7 @@ struct fred · 5 unmodified lines | |||
| 6 | int natasha; | 6 | int natasha; |
| 7 | }; | 7 | }; |
| 8 | 8 | ||
| 9 | void main() | 9 | int main() |
| 10 | { | 10 | { |
| 11 | struct fred bloggs; | 11 | struct fred bloggs; |
| 12 | 12 | ||
| @@ -96,6 +96,3 @@ all test: $(TESTS) · 95 unmodified lines | |||
| 96 | 96 | ||
| 97 | clean: | 97 | clean: |
| 98 | rm -vf fred.txt *.output | 98 | rm -vf fred.txt *.output |
| 99 | |||
| 100 | Makefile: $(top_srcdir)/tests/tests2/Makefile | ||
| 101 | cp $< $@ | ||