History

tests: add .so/.dll creation test

Also remove bitfield test from tcctest.c because gcc versions don't agree among each other.

grischka committed 9 years ago

Commit 2b7ee001 parent ca92bfc3 files · +23 −9Browse files

Showing the changes to tests (2 of 3 files). Show all

Unified · Split

2 files
  1. tests/Makefile +20 −0
  2. tests/tcctest.c +0 −9
tests/Makefile+20−0
@@ -13,6 +13,7 @@ TESTS = \ · 12 unmodified lines
1313 hello-run \
1414 libtest \
1515 test3 \
16+ dlltest \
1617 abitest \
1718 vla_test-run \
1819 tests2-dir \
@@ -40,6 +41,9 @@ endif · 21 unmodified lines
4041 ifeq ($(CONFIG_arm_eabi),yes)
4142 TESTS := $(filter-out test3,$(TESTS))
4243 endif
44+ifeq (,$(filter i386 x86-64,$(ARCH)))
45+ TESTS := $(filter-out dlltest,$(TESTS))
46+endif
4347
4448 # run local version of tcc with local libraries and includes
4549 TCCFLAGS = -B$(TOP) -I$(TOPSRC)/include -I$(TOPSRC) -I$(TOP)
@@ -126,6 +130,22 @@ test4: tcctest.c test.ref · 80 unmodified lines
126130 ./tcctest2 > test2.out
127131 @if diff -u test.ref test2.out ; then echo "Static Auto Test OK"; fi
128132
133+# use tcc to create libtcc.so/.dll and the tcc(.exe) frontend and run them
134+dlltest:
135+ @echo ------------ $@ ------------
136+ $(TCC) -DONE_SOURCE $(NATIVE_DEFINES) -DLIBTCC_AS_DLL ../libtcc.c $(LIBS) -shared -o libtcc2$(DLLSUF)
137+ $(TCC) $(NATIVE_DEFINES) ../tcc.c libtcc2$(DLLSUF) $(LIBS) -Wl,-rpath=. -o tcc2$(EXESUF)
138+ ./tcc2$(EXESUF) $(TCCFLAGS) $(RUN_TCC) -run ../examples/ex1.c
139+ifndef CONFIG_WIN32
140+ @echo ------------ $@ with PIC ------------
141+ $(CC) $(CFLAGS) -fPIC -DONE_SOURCE $(NATIVE_DEFINES) -DLIBTCC_AS_DLL -c ../libtcc.c
142+ $(TCC) libtcc.o $(LIBS) -shared -o libtcc2$(DLLSUF)
143+ $(TCC) $(NATIVE_DEFINES) ../tcc.c libtcc2$(DLLSUF) $(LIBS) -Wl,-rpath=. -o tcc2$(EXESUF)
144+ ./tcc2$(EXESUF) $(TCCFLAGS) $(RUN_TCC) -run ../examples/ex1.c
145+endif
146+ @rm tcc2$(EXESUF) libtcc2$(DLLSUF)
147+
148+
129149 # memory and bound check auto test
130150 BOUNDS_OK = 1 4 8 10 14
131151 BOUNDS_FAIL= 2 5 7 9 11 12 13 15
tests/tcctest.c+0−9
@@ -1634,15 +1634,6 @@ void bitfield_test(void) · 1633 unmodified lines
16341634 st2.f3 = a;
16351635 st2.f2++;
16361636 printf("%lld %lld %lld\n", st2.f1, st2.f2, st2.f3);
1637− struct sbf3 {
1638− int f1 : 7;
1639− int f2 : 1;
1640− char f3;
1641− int f4 : 8;
1642− int f5 : 1;
1643− int f6 : 16;
1644− } st3;
1645− printf("sizeof(st3) = %d\n", sizeof(st3));
16461637 }
16471638
16481639 #ifdef __x86_64__

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t