gcc/testsuite/c-c++-common/cpp/va-opt-8.c
raw| 1 | /* PR preprocessor/103415 */ |
| 2 | /* { dg-do run } */ |
| 3 | /* { dg-options "-std=gnu99" { target c } } */ |
| 4 | /* { dg-options "-std=c++20" { target c++ } } */ |
| 5 | |
| 6 | #define n(x, ...) = #__VA_OPT__(x##3) |
| 7 | #define o(x, ...) #__VA_OPT__(x##__VA_ARGS__##9) |
| 8 | const char *c n(1 2, 4); |
| 9 | const char *d = o(5 6, 7 8); |
| 10 | |
| 11 | int |
| 12 | main () |
| 13 | { |
| 14 | if (__builtin_strcmp (c, "1 23") |
| 15 | || __builtin_strcmp (d, "5 67 89")) |
| 16 | __builtin_abort (); |
| 17 | return 0; |
| 18 | } |