aboutsummaryrefslogtreecommitdiff
path: root/tests/Makefile
diff options
context:
space:
mode:
authorgrischka <grischka>2016-12-15 17:04:07 +0100
committergrischka <grischka>2016-12-15 17:04:07 +0100
commit2b7ee000cd3dd49283f73a95bb0a09cb2de7039f (patch)
tree0a44baf6b854f9a09fb9d950434adccc498d129e /tests/Makefile
parentca92bfc3c64128872793c167de3a58a78b9a1299 (diff)
downloadtinycc-2b7ee000cd3dd49283f73a95bb0a09cb2de7039f.tar.gz
tinycc-2b7ee000cd3dd49283f73a95bb0a09cb2de7039f.tar.bz2
tests: add .so/.dll creation test
Also remove bitfield test from tcctest.c because gcc versions don't agree among each other.
Diffstat (limited to 'tests/Makefile')
-rw-r--r--tests/Makefile20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/Makefile b/tests/Makefile
index 50b3a8c..a86e8a2 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -13,6 +13,7 @@ TESTS = \
hello-run \
libtest \
test3 \
+ dlltest \
abitest \
vla_test-run \
tests2-dir \
@@ -40,6 +41,9 @@ endif
ifeq ($(CONFIG_arm_eabi),yes)
TESTS := $(filter-out test3,$(TESTS))
endif
+ifeq (,$(filter i386 x86-64,$(ARCH)))
+ TESTS := $(filter-out dlltest,$(TESTS))
+endif
# run local version of tcc with local libraries and includes
TCCFLAGS = -B$(TOP) -I$(TOPSRC)/include -I$(TOPSRC) -I$(TOP)
@@ -126,6 +130,22 @@ test4: tcctest.c test.ref
./tcctest2 > test2.out
@if diff -u test.ref test2.out ; then echo "Static Auto Test OK"; fi
+# use tcc to create libtcc.so/.dll and the tcc(.exe) frontend and run them
+dlltest:
+ @echo ------------ $@ ------------
+ $(TCC) -DONE_SOURCE $(NATIVE_DEFINES) -DLIBTCC_AS_DLL ../libtcc.c $(LIBS) -shared -o libtcc2$(DLLSUF)
+ $(TCC) $(NATIVE_DEFINES) ../tcc.c libtcc2$(DLLSUF) $(LIBS) -Wl,-rpath=. -o tcc2$(EXESUF)
+ ./tcc2$(EXESUF) $(TCCFLAGS) $(RUN_TCC) -run ../examples/ex1.c
+ifndef CONFIG_WIN32
+ @echo ------------ $@ with PIC ------------
+ $(CC) $(CFLAGS) -fPIC -DONE_SOURCE $(NATIVE_DEFINES) -DLIBTCC_AS_DLL -c ../libtcc.c
+ $(TCC) libtcc.o $(LIBS) -shared -o libtcc2$(DLLSUF)
+ $(TCC) $(NATIVE_DEFINES) ../tcc.c libtcc2$(DLLSUF) $(LIBS) -Wl,-rpath=. -o tcc2$(EXESUF)
+ ./tcc2$(EXESUF) $(TCCFLAGS) $(RUN_TCC) -run ../examples/ex1.c
+endif
+ @rm tcc2$(EXESUF) libtcc2$(DLLSUF)
+
+
# memory and bound check auto test
BOUNDS_OK = 1 4 8 10 14
BOUNDS_FAIL= 2 5 7 9 11 12 13 15