OSDN Git Service

Index: gcc/ChangeLog
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / cpp / strp1.c
1 /* { dg-do run } */
2
3 /* Regression test for stringizing and token pasting.
4    We got internal escape markers in the strings.  */
5
6 #include <string.h>
7 #include <stdlib.h>
8
9 #define S(x) _S(x)
10 #define _S(x) #x
11
12 #define I 1
13 static const char s1[] = S(I.1);
14 static const char t1[] = "1.1";
15
16 #define f h
17 #define h(a) a+f
18 static const char s2[] = S( f(1)(2) );
19 static const char t2[] = "1+h(2)";
20
21 #undef I
22 #undef f
23 #undef h
24
25 int
26 main(void)
27 {
28   if (strcmp (s1, t1))
29     abort ();
30
31   if (strcmp (s2, t2))
32     abort ();
33
34   return 0;
35 }