aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/tests2/68_macro_concat.c9
-rw-r--r--tests/tests2/68_macro_concat.expect1
-rw-r--r--tests/tests2/69_macro_concat.c9
-rw-r--r--tests/tests2/69_macro_concat.expect1
-rw-r--r--tests/tests2/Makefile4
5 files changed, 23 insertions, 1 deletions
diff --git a/tests/tests2/68_macro_concat.c b/tests/tests2/68_macro_concat.c
new file mode 100644
index 0000000..5c1361f
--- /dev/null
+++ b/tests/tests2/68_macro_concat.c
@@ -0,0 +1,9 @@
+#include <stdio.h>
+#define hexCh(c (c >= 10 ? 'a' + c - 10 : '0' + c)
+
+int main(void)
+{
+ int c = 0xa;
+ printf("hex: %c\n", hexCh(c));
+ return 0;
+}
diff --git a/tests/tests2/68_macro_concat.expect b/tests/tests2/68_macro_concat.expect
new file mode 100644
index 0000000..0bf7d54
--- /dev/null
+++ b/tests/tests2/68_macro_concat.expect
@@ -0,0 +1 @@
+68_macro_concat.c:2: error: '(' may not appear in parameter list
diff --git a/tests/tests2/69_macro_concat.c b/tests/tests2/69_macro_concat.c
new file mode 100644
index 0000000..3b16313
--- /dev/null
+++ b/tests/tests2/69_macro_concat.c
@@ -0,0 +1,9 @@
+#include <stdio.h>
+#define hexCh(c/3) (c >= 10 ? 'a' + c - 10 : '0' + c)
+
+int main(void)
+{
+ int c = 0xa;
+ printf("hex: %c\n", hexCh(c));
+ return 0;
+}
diff --git a/tests/tests2/69_macro_concat.expect b/tests/tests2/69_macro_concat.expect
new file mode 100644
index 0000000..89e7b79
--- /dev/null
+++ b/tests/tests2/69_macro_concat.expect
@@ -0,0 +1 @@
+69_macro_concat.c:2: error: '/' may not appear in parameter list
diff --git a/tests/tests2/Makefile b/tests/tests2/Makefile
index c47fe0a..64532a1 100644
--- a/tests/tests2/Makefile
+++ b/tests/tests2/Makefile
@@ -82,7 +82,9 @@ TESTS = \
64_macro_nesting.test \
65_macro_concat_start.test \
66_macro_concat_end.test \
- 67_macro_concat.test
+ 67_macro_concat.test \
+ 68_macro_concat.test \
+ 69_macro_concat.test
# 34_array_assignment.test -- array assignment is not in C standard