commit b3cc864f59fe9edd44a3407e9ab814323cfb424a
Author: Roberto E. Vargas Caballero <[email protected]>
AuthorDate: Sat Oct 3 12:09:34 2015 +0200
Commit: Roberto E. Vargas Caballero <[email protected]>
CommitDate: Sat Oct 3 12:12:46 2015 +0200
Add test for special characters in macro definition
@ and $ only can appear in strings or in characters,
and cc1 use them for special purposes in macro
definitions. Test that it is ok is they are in
a macro (character test should be done to).
diff --git a/cc1/tests/test032.c b/cc1/tests/test032.c
new file mode 100644
index 0000000..c94f6b5
--- /dev/null
+++ b/cc1/tests/test032.c
@@ -0,0 +1,25 @@
+
+/*
+name: TEST032
+description: test special characters @ and $ in macro definitions
+output:
+F3 I
+G4 F3 main
+{
+\
+A6 P p
+ A6
"54686973206973206120737472696E672024206F722023206F72202323616E64206974206973206F6B2021
'P :P
+ r A6 #P0 !I
+}
+*/
+
+#define M1(x) "This is a string $ or # or ##" ## #x
+
+int
+main(void)
+{
+ char *p = M1(and it is ok!);
+
+ return p != 0;
+}
+