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
73 73
74# libtcc test74# libtcc test
75ifdef LIBTCC175ifdef LIBTCC1
76 LIBTCC1:=$(TOP)/$(LIBTCC1)76 ifdef CONFIG_WIN32
77 LIBTCC1:=$(TOP)/win32/libtcc/libtcc.a
78 else
79 LIBTCC1:=$(TOP)/$(LIBTCC1)
80 endif
77endif81endif
78 82
79all test : $(TESTS)83all 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)
86001:
tests/pp/12.expect+2−0
@@ -0,0 +1,2 @@
1 9999: 1: movw (%esi), %bx; .section __ex_table, "a"; .long 9999b, 6001f ;
26001:
tests/pp/Makefile+11−1
@@ -7,6 +7,7 @@ include $(TOP)/Makefile · 6 unmodified lines
7 7
8TCC = $(TOP)/tcc8TCC = $(TOP)/tcc
9TESTS = $(patsubst %.c,%.test,$(wildcard *.c))9TESTS = $(patsubst %.c,%.test,$(wildcard *.c))
10TESTS += $(patsubst %.S,%.test,$(wildcard *.S))
10 11
11ifdef CONFIG_WIN3212ifdef CONFIG_WIN32
12 TCC = $(top_srcdir)/win32/tcc13 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 $*.output22 && 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>&132 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 delete37# tell make not to delete
28.PRECIOUS: %.expect38.PRECIOUS: %.expect
29 39

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