modified version of the old one which don't allow '.' in #define Identifiers. This allow correctly preprocess the following code in *.S #define SRC(y...) \ 9999: y; \ .section __ex_table, "a"; \ .long 9999b, 6001f ; \ // .previous SRC(1: movw (%esi), %bx) 6001: A test included.
Showing the changes to tests (4 of 8 files). Show all
Unified · Split
| @@ -73,7 +73,11 @@ DISAS = objdump -d · 72 unmodified lines | |||
| 73 | 73 | ||
| 74 | # libtcc test | 74 | # libtcc test |
| 75 | ifdef LIBTCC1 | 75 | ifdef LIBTCC1 |
| 76 | LIBTCC1:=$(TOP)/$(LIBTCC1) | 76 | ifdef CONFIG_WIN32 |
| 77 | LIBTCC1:=$(TOP)/win32/libtcc/libtcc.a | ||
| 78 | else | ||
| 79 | LIBTCC1:=$(TOP)/$(LIBTCC1) | ||
| 80 | endif | ||
| 77 | endif | 81 | endif |
| 78 | 82 | ||
| 79 | all test : $(TESTS) | 83 | all test : $(TESTS) |
| @@ -0,0 +1,8 @@ | |||
| 1 | #define SRC(y...) \ | ||
| 2 | 9999: y; \ | ||
| 3 | .section __ex_table, "a"; \ | ||
| 4 | .long 9999b, 6001f ; \ | ||
| 5 | // .previous | ||
| 6 | |||
| 7 | SRC(1: movw (%esi), %bx) | ||
| 8 | 6001: | ||
| @@ -0,0 +1,2 @@ | |||
| 1 | 9999: 1: movw (%esi), %bx; .section __ex_table, "a"; .long 9999b, 6001f ; | ||
| 2 | 6001: | ||
| @@ -7,6 +7,7 @@ include $(TOP)/Makefile · 6 unmodified lines | |||
| 7 | 7 | ||
| 8 | TCC = $(TOP)/tcc | 8 | TCC = $(TOP)/tcc |
| 9 | TESTS = $(patsubst %.c,%.test,$(wildcard *.c)) | 9 | TESTS = $(patsubst %.c,%.test,$(wildcard *.c)) |
| 10 | TESTS += $(patsubst %.S,%.test,$(wildcard *.S)) | ||
| 10 | 11 | ||
| 11 | ifdef CONFIG_WIN32 | 12 | ifdef CONFIG_WIN32 |
| 12 | TCC = $(top_srcdir)/win32/tcc | 13 | TCC = $(top_srcdir)/win32/tcc |
| @@ -20,10 +21,19 @@ all test : $(TESTS) · 7 unmodified lines | |||
| 20 | diff -Nu -b -B -I "^#" $(EXTRA_DIFF_OPTS) $*.expect $*.output \ | 21 | diff -Nu -b -B -I "^#" $(EXTRA_DIFF_OPTS) $*.expect $*.output \ |
| 21 | && rm -f $*.output | 22 | && rm -f $*.output |
| 22 | 23 | ||
| 24 | %.test: %.S %.expect | ||
| 25 | @echo PPTest $* ... | ||
| 26 | @$(TCC) -E -P $< >$*.output 2>&1 ; \ | ||
| 27 | diff -Nu -b -B -I "^#" $(EXTRA_DIFF_OPTS) $*.expect $*.output \ | ||
| 28 | && rm -f $*.output | ||
| 29 | |||
| 23 | # automatically generate .expect files with gcc: | 30 | # automatically generate .expect files with gcc: |
| 24 | %.expect : | 31 | %.expect: %.c |
| 25 | gcc -E -P $*.c >$*.expect 2>&1 | 32 | gcc -E -P $*.c >$*.expect 2>&1 |
| 26 | 33 | ||
| 34 | %.expect: %.S | ||
| 35 | gcc -E -P $*.S >$*.expect 2>&1 | ||
| 36 | |||
| 27 | # tell make not to delete | 37 | # tell make not to delete |
| 28 | .PRECIOUS: %.expect | 38 | .PRECIOUS: %.expect |
| 29 | 39 | ||