Home | History | Annotate | Download | only in Preprocessor
      1 // RUN: %clang_cc1 -E %s | FileCheck --strict-whitespace %s
      2 
      3 #define A  x ## y
      4 blah
      5 
      6 A
      7 // CHECK: {{^}}xy{{$}}
      8 
      9 #define B(x, y) [v ## w] [ v##w] [v##w ] [w ## x] [ w##x] [w##x ] [x ## y] [ x##y] [x##y ] [y ## z] [ y##z] [y##z ]
     10 B(x,y)
     11 // CHECK: [vw] [ vw] [vw ] [wx] [ wx] [wx ] [xy] [ xy] [xy ] [yz] [ yz] [yz ]
     12 B(x,)
     13 // CHECK: [vw] [ vw] [vw ] [wx] [ wx] [wx ] [x] [ x] [x ] [z] [ z] [z ]
     14 B(,y)
     15 // CHECK: [vw] [ vw] [vw ] [w] [ w] [w ] [y] [ y] [y ] [yz] [ yz] [yz ]
     16 B(,)
     17 // CHECK: [vw] [ vw] [vw ] [w] [ w] [w ] [] [ ] [ ] [z] [ z] [z ]
     18 
     19 #define C(x, y, z) [x ## y ## z]
     20 C(,,) C(a,,) C(,b,) C(,,c) C(a,b,) C(a,,c) C(,b,c) C(a,b,c)
     21 // CHECK: [] [a] [b] [c] [ab] [ac] [bc] [abc]
     22