Home | History | Annotate | Download | only in Preprocessor
      1 // RUN: %clang_cc1 -E %s | FileCheck --strict-whitespace %s
      2 
      3 // Check that this doesn't crash
      4 
      5 #define IDENTITY1(x) x
      6 #define IDENTITY2(x) IDENTITY1(x) IDENTITY1(x) IDENTITY1(x) IDENTITY1(x)
      7 #define IDENTITY3(x) IDENTITY2(x) IDENTITY2(x) IDENTITY2(x) IDENTITY2(x)
      8 #define IDENTITY4(x) IDENTITY3(x) IDENTITY3(x) IDENTITY3(x) IDENTITY3(x)
      9 #define IDENTITY5(x) IDENTITY4(x) IDENTITY4(x) IDENTITY4(x) IDENTITY4(x)
     10 #define IDENTITY6(x) IDENTITY5(x) IDENTITY5(x) IDENTITY5(x) IDENTITY5(x)
     11 #define IDENTITY7(x) IDENTITY6(x) IDENTITY6(x) IDENTITY6(x) IDENTITY6(x)
     12 #define IDENTITY8(x) IDENTITY7(x) IDENTITY7(x) IDENTITY7(x) IDENTITY7(x)
     13 #define IDENTITY9(x) IDENTITY8(x) IDENTITY8(x) IDENTITY8(x) IDENTITY8(x)
     14 #define IDENTITY0(x) IDENTITY9(x) IDENTITY9(x) IDENTITY9(x) IDENTITY9(x)
     15 IDENTITY0()
     16 
     17 #define FOO() BAR() second
     18 #define BAR()
     19 first // CHECK: {{^}}first{{$}}
     20 FOO() // CHECK: {{^}} second{{$}}
     21 third // CHECK: {{^}}third{{$}}
     22