[PowerPC] Collect some CallLowering arguments into a struct. [NFC]
[llvm-project.git] / clang / test / Preprocessor / macro_vaopt_check.cpp
blobfb52e9946af3dc01a5194644e10fe6aec6feaeb2
1 // RUN: %clang_cc1 %s -Eonly -verify -Wno-all -pedantic -std=c++2a
3 //expected-error@+1{{missing '('}}
4 #define V1(...) __VA_OPT__
5 #undef V1
6 // OK
7 #define V1(...) __VA_OPT__ ()
8 #undef V1
10 //expected-warning@+1{{can only appear in the expansion of a variadic macro}}
11 #define V2() __VA_OPT__(x)
12 #undef V2
14 //expected-error@+2{{missing ')' after}}
15 //expected-note@+1{{to match this '('}}
16 #define V3(...) __VA_OPT__(
17 #undef V3
19 #define V4(...) __VA_OPT__(__VA_ARGS__)
20 #undef V4
22 //expected-error@+1{{nested}}
23 #define V5(...) __VA_OPT__(__VA_OPT__())
24 #undef V5
26 //expected-error@+1{{not followed by}}
27 #define V1(...) __VA_OPT__ (#)
28 #undef V1
30 //expected-error@+1{{cannot appear at start}}
31 #define V1(...) __VA_OPT__ (##)
32 #undef V1
34 //expected-error@+1{{cannot appear at start}}
35 #define V1(...) __VA_OPT__ (## X) x
36 #undef V1
38 //expected-error@+1{{cannot appear at end}}
39 #define V1(...) y __VA_OPT__ (X ##)
40 #undef V1
43 #define FOO(x,...) # __VA_OPT__(x) #x #__VA_OPT__(__VA_ARGS__) //OK
45 //expected-error@+1{{not followed by a macro parameter}}
46 #define V1(...) __VA_OPT__(#)
47 #undef V1
49 //expected-error@+1{{cannot appear at start}}
50 #define V1(...) a __VA_OPT__(##) b
51 #undef V1
53 //expected-error@+1{{cannot appear at start}}
54 #define V1(...) a __VA_OPT__(a ## b) b __VA_OPT__(##)
55 #undef V1
57 #define V1(x,...) # __VA_OPT__(b x) // OK
58 #undef V1
60 //expected-error@+2{{missing ')' after}}
61 //expected-note@+1{{to match this '('}}
62 #define V1(...) __VA_OPT__ ((())
63 #undef V1