[hackers] [scc] Add test for special characters in macro definition || Roberto E. Vargas Caballero
commit b3cc864f59fe9edd44a3407e9ab814323cfb424a
Author: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
AuthorDate: Sat Oct 3 12:09:34 2015 +0200
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
CommitDate: Sat Oct 3 12:12:46 2015 +0200
Add test for special characters in macro definition
_AT_ 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
_AT_@ -0,0 +1,25 @@
+
+/*
+name: TEST032
+description: test special characters _AT_ 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;
+}
+
Received on Sat Oct 03 2015 - 12:13:12 CEST
This archive was generated by hypermail 2.3.0
: Sat Oct 03 2015 - 12:24:18 CEST