• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Test the GNU comma swallowing extension.
2 // RUN: %clang_cc1 %s -E | FileCheck -strict-whitespace %s
3 
4 // CHECK: 1: foo{A, }
5 #define X(Y) foo{A, Y}
6 1: X()
7 
8 
9 // CHECK: 2: fo2{A,}
10 #define X2(Y) fo2{A,##Y}
11 2: X2()
12 
13 // should eat the comma.
14 // CHECK: 3: {foo}
15 #define X3(b, ...) {b, ## __VA_ARGS__}
16 3: X3(foo)
17 
18 
19 
20 // PR3880
21 // CHECK: 4: AA BB
22 #define X4(...)  AA , ## __VA_ARGS__ BB
23 4: X4()
24 
25 // PR7943
26 // CHECK: 5: 1
27 #define X5(x,...) x##,##__VA_ARGS__
28 5: X5(1)
29