scc

simple C compiler
git clone git://git.2f30.org/scc
Log | Files | Refs | README | LICENSE

commit b3cc864f59fe9edd44a3407e9ab814323cfb424a
parent b8b54f0d5c97324a7534bfeed523660c7296f9da
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Sat,  3 Oct 2015 12:09:34 +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).

Diffstat:
Acc1/tests/test032.c | 25+++++++++++++++++++++++++
1 file changed, 25 insertions(+), 0 deletions(-)

diff --git a/cc1/tests/test032.c 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; +} +