aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorThomas Preud'homme <robotux@celest.fr>2014-04-08 22:19:48 +0800
committerThomas Preud'homme <robotux@celest.fr>2014-04-08 22:19:48 +0800
commita715d7143d9d17da17e67fec6af1c01409a71a31 (patch)
treec4711f1e74829df258151781171bc0b01b8ef9a1 /tests
parent91d4db600bd95318c224100f13b79de9fdd5ca79 (diff)
downloadtinycc-a715d7143d9d17da17e67fec6af1c01409a71a31.tar.gz
tinycc-a715d7143d9d17da17e67fec6af1c01409a71a31.tar.bz2
Prevent ## to appear at start or end of macro
Diffstat (limited to 'tests')
-rw-r--r--tests/tests2/65_macro_concat_start.c2
-rw-r--r--tests/tests2/65_macro_concat_start.expect1
-rw-r--r--tests/tests2/66_macro_concat_end.c2
-rw-r--r--tests/tests2/66_macro_concat_end.expect1
-rw-r--r--tests/tests2/Makefile4
5 files changed, 9 insertions, 1 deletions
diff --git a/tests/tests2/65_macro_concat_start.c b/tests/tests2/65_macro_concat_start.c
new file mode 100644
index 0000000..d63d67a
--- /dev/null
+++ b/tests/tests2/65_macro_concat_start.c
@@ -0,0 +1,2 @@
+#define paste(A,B) ##A B
+paste(x,y)
diff --git a/tests/tests2/65_macro_concat_start.expect b/tests/tests2/65_macro_concat_start.expect
new file mode 100644
index 0000000..88ed6c5
--- /dev/null
+++ b/tests/tests2/65_macro_concat_start.expect
@@ -0,0 +1 @@
+65_macro_concat_start.c:1: error: '##' invalid at start of macro
diff --git a/tests/tests2/66_macro_concat_end.c b/tests/tests2/66_macro_concat_end.c
new file mode 100644
index 0000000..55dcaef
--- /dev/null
+++ b/tests/tests2/66_macro_concat_end.c
@@ -0,0 +1,2 @@
+#define paste(A,B) A B##
+paste(x,y)
diff --git a/tests/tests2/66_macro_concat_end.expect b/tests/tests2/66_macro_concat_end.expect
new file mode 100644
index 0000000..224e5c9
--- /dev/null
+++ b/tests/tests2/66_macro_concat_end.expect
@@ -0,0 +1 @@
+66_macro_concat_end.c:2: error: '##' invalid at end of macro
diff --git a/tests/tests2/Makefile b/tests/tests2/Makefile
index 36d84dc..41adb2d 100644
--- a/tests/tests2/Makefile
+++ b/tests/tests2/Makefile
@@ -79,7 +79,9 @@ TESTS = \
61_undefined_enum.test \
62_enumerator_redefinition.test \
63_local_enumerator_redefinition.test \
- 64_macro_nesting.test
+ 64_macro_nesting.test \
+ 65_macro_concat_start.test \
+ 66_macro_concat_end.test
# 30_hanoi.test -- seg fault in the code, gcc as well
# 34_array_assignment.test -- array assignment is not in C standard