tests: Add tests for compile/run tcc.c with `tcc -b` then compile tcc.c again, then run tcctest.c

Just like with test[123] add their test[123]b variants. After previous 3
patchs all test pass here on Debian GNU/Linux on i385 with gcc-4.7 with
or without memory randomization turned on.
master
Kirill Smelkov 2012-12-09 19:43:40 +04:00
parent dbeb4faf21
commit 031ff872be
2 changed files with 25 additions and 1 deletions

3
.gitignore vendored
View File

@ -11,8 +11,11 @@ tc1.c
error.c
i386-gen1.c
test.out1
test.out1b
test.out2
test.out2b
test.out3
test.out3b
web.sh
memdebug.c
bench

View File

@ -12,6 +12,9 @@ TESTS = libtest \
test3 \
speedtest \
btest \
test1b\
test2b\
test3b\
weaktest
# test4 # this test does not seem to work on any platform
@ -20,6 +23,9 @@ TESTS = libtest \
# bounds-checking is supported only on i386
ifneq ($(ARCH),i386)
TESTS := $(filter-out btest,$(TESTS))
TESTS := $(filter-out test1b,$(TESTS))
TESTS := $(filter-out test2b,$(TESTS))
TESTS := $(filter-out test3b,$(TESTS))
endif
# these should work too
@ -87,18 +93,33 @@ test1: test.ref
$(TCC) -run tcctest.c > test.out1
@if diff -u test.ref test.out1 ; then echo "Auto Test OK"; fi
test1b: test.ref
@echo ------------ $@ ------------
$(TCC) -b -run tcctest.c > test.out1b
@if diff -u test.ref test.out1b ; then echo "Auto Test OK"; fi
# iterated test2 (compile tcc then compile tcctest.c !)
test2: test.ref
@echo ------------ $@ ------------
$(TCC) $(RUN_TCC) $(RUN_TCC) -run tcctest.c > test.out2
@if diff -u test.ref test.out2 ; then echo "Auto Test2 OK"; fi
test2b: test.ref ../bcheck.o
@echo ------------ $@ ------------
$(TCC) -b $(RUN_TCC) $(RUN_TCC) -run tcctest.c > test.out2b
@if diff -u test.ref test.out2b ; then echo "Auto Test2b OK"; fi
# iterated test3 (compile tcc then compile tcc then compile tcctest.c !)
test3: test.ref
@echo ------------ $@ ------------
$(TCC) $(RUN_TCC) $(RUN_TCC) $(RUN_TCC) -run tcctest.c > test.out3
@if diff -u test.ref test.out3 ; then echo "Auto Test3 OK"; fi
test3b: test.ref
@echo ------------ $@ ------------
$(TCC) -b $(RUN_TCC) $(RUN_TCC) $(RUN_TCC) -run tcctest.c > test.out3b
@if diff -u test.ref test.out3b ; then echo "Auto Test3 OK"; fi
# binary output test
test4: test.ref
@echo ------------ $@ ------------
@ -190,5 +211,5 @@ cache: tcc_g
# clean
clean:
rm -vf *~ *.o *.a *.bin *.i *.ref *.out *.out? *.gcc \
rm -vf *~ *.o *.a *.bin *.i *.ref *.out *.out? *.out?b *.gcc \
tcctest[1234] ex? libtcc_test$(EXESUF) tcc_g tcclib.h