FSF GCC merge 02/23/03
[official-gcc.git] / gcc / testsuite / gcc.dg / cpp / strp2.c
blobd1fcd91824dcd49e3427be2f79ab9a161c4de37e
1 /* { dg-do run } */
3 /* Test for odd corner cases in stringizing/pasting.
4 Taken more or less verbatim from C99 section 6.10.3.3. */
6 #include <stdlib.h>
7 #include <string.h>
9 #define hash_hash # ## #
10 #define mkstr(a) # a
11 #define in_between(a) mkstr(a)
12 #define join(c, d) in_between(c hash_hash d)
14 const char p[] = join(x, y);
15 const char q[] = "x ## y";
17 int
18 main (void)
20 if (strcmp (p, q))
21 abort ();
22 return 0;