shithub: scc

Download patch

ref: b3cc864f59fe9edd44a3407e9ab814323cfb424a
parent: b8b54f0d5c97324a7534bfeed523660c7296f9da
author: Roberto E. Vargas Caballero <[email protected]>
date: Sat Oct 3 08:09:34 EDT 2015

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).

--- /dev/null
+++ b/cc1/tests/test032.c
@@ -1,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;
+}
+