History

Identifiers can start and/or contain '.' in *.S

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.

seyko committed 10 years ago

Commit d3e85e81 parent 21665f48 files · +115 −73Browse files

Showing the changes to tests (4 of 8 files). Show all

Unified · Split

4 files
  1. tests/Makefile +5 −1
  2. tests/pp/12.S +8 −0
  3. tests/pp/12.expect +2 −0
  4. tests/pp/Makefile +11 −1
tests/Makefile+5−1
@@ -73,7 +73,11 @@ DISAS = objdump -d · 72 unmodified lines
7373
7474 # libtcc test
7575 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
7781 endif
7882
7983 all test : $(TESTS)
tests/pp/12.S+8−0
@@ -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:
tests/pp/12.expect+2−0
@@ -0,0 +1,2 @@
1+ 9999: 1: movw (%esi), %bx; .section __ex_table, "a"; .long 9999b, 6001f ;
2+6001:
tests/pp/Makefile+11−1
@@ -7,6 +7,7 @@ include $(TOP)/Makefile · 6 unmodified lines
77
88 TCC = $(TOP)/tcc
99 TESTS = $(patsubst %.c,%.test,$(wildcard *.c))
10+TESTS += $(patsubst %.S,%.test,$(wildcard *.S))
1011
1112 ifdef CONFIG_WIN32
1213 TCC = $(top_srcdir)/win32/tcc
@@ -20,10 +21,19 @@ all test : $(TESTS) · 7 unmodified lines
2021 diff -Nu -b -B -I "^#" $(EXTRA_DIFF_OPTS) $*.expect $*.output \
2122 && rm -f $*.output
2223
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+
2330 # automatically generate .expect files with gcc:
24−%.expect :
31+%.expect: %.c
2532 gcc -E -P $*.c >$*.expect 2>&1
2633
34+%.expect: %.S
35+ gcc -E -P $*.S >$*.expect 2>&1
36+
2737 # tell make not to delete
2838 .PRECIOUS: %.expect
2939

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