aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorEdmund Grimley Evans <Edmund.Grimley.Evans@gmail.com>2016-05-04 21:37:11 +0100
committerEdmund Grimley Evans <Edmund.Grimley.Evans@gmail.com>2016-05-09 19:27:31 +0100
commitf5f82abc99424c4ece836000934fcf57a867c635 (patch)
tree2e70deb54bcac302987e7a20f124041c34c00f51 /tests
parent75243f744c60e588ee68c1a47f1ce691a36c07a7 (diff)
downloadtinycc-f5f82abc99424c4ece836000934fcf57a867c635.tar.gz
tinycc-f5f82abc99424c4ece836000934fcf57a867c635.tar.bz2
Insert spaces between certain tokens when tcc is invoked with -E.
Insert a space when it is required to prevent mistokenisation of the output, and also in a few cases where it is not strictly required, imitating GCC's behaviour.
Diffstat (limited to 'tests')
-rw-r--r--tests/pp/15.c5
-rw-r--r--tests/pp/15.expect20
2 files changed, 25 insertions, 0 deletions
diff --git a/tests/pp/15.c b/tests/pp/15.c
index 28a12bd..dc2b8d1 100644
--- a/tests/pp/15.c
+++ b/tests/pp/15.c
@@ -19,3 +19,8 @@ return A + B;
#define B1 C1+2
#define C1 A1+3
return A1 + B1;
+
+#define i() x
+#define n() 1
+i()i()n()n()i()
+i()+i()-n()+n()-
diff --git a/tests/pp/15.expect b/tests/pp/15.expect
index 7ccee4a..d3d3dd5 100644
--- a/tests/pp/15.expect
+++ b/tests/pp/15.expect
@@ -1,6 +1,26 @@
+
+
Z(1)
Z(Z(1))
Z(Z(Z(Z(Z(1)))))
+
+
+
return A + B;
+
+
+
+
+
+
return A+1 + B+1;
+
+
+
+
return A1+3 +2 +1 + B1+1 +3 +2;
+
+
+
+x x 1 1 x
+x+x-1 +1 -