gcc/testsuite/c-c++-common/cpp/pr104147.c
raw| 1 | /* PR preprocessor/104147 */ |
| 2 | /* { dg-do run } */ |
| 3 | |
| 4 | #define X(x,y) x y |
| 5 | #define STR_(x) #x |
| 6 | #define STR(x) STR_(x) |
| 7 | const char *str = |
| 8 | STR(X(Y,Y)) |
| 9 | #define Y() |
| 10 | STR(X(Y,Y)) |
| 11 | #undef Y |
| 12 | STR(X(Y,Y)) |
| 13 | #define Y() |
| 14 | STR(X(Y,Y)) |
| 15 | STR(X(Y, |
| 16 | Y)) |
| 17 | STR(X(Y |
| 18 | ,Y)) |
| 19 | ; |
| 20 | |
| 21 | int |
| 22 | main () |
| 23 | { |
| 24 | if (__builtin_strcmp (str, "Y YY YY YY YY YY Y") != 0) |
| 25 | __builtin_abort (); |
| 26 | return 0; |
| 27 | } |