Home | History | Annotate | Download | only in TableGen
      1 // RUN: clang-tblgen -gen-clang-diag-groups -I%S %s -o /dev/null 2>&1 | FileCheck --strict-whitespace %s
      2 include "DiagnosticBase.inc"
      3 
      4 def NamedGroup : DiagGroup<"name">;
      5 
      6 def InNamedGroup : Warning<"">, InGroup<DiagGroup<"name">>;
      7 //      CHECK: tg-fixits.td:[[@LINE-1]]:41: error: group 'name' is referred to anonymously
      8 // CHECK-NEXT: {{^def InNamedGroup : Warning<"">, InGroup<DiagGroup<"name">>;}}
      9 // CHECK-NEXT: {{^                                ~~~~~~~~\^~~~~~~~~~~~~~~~~~}}
     10 // CHECK-NEXT: {{^                                InGroup<NamedGroup>}}
     11 
     12 def Wrapped : Warning<"">, InGroup<DiagGroup<
     13   "name">>;
     14 //      CHECK: tg-fixits.td:[[@LINE-2]]:36: error: group 'name' is referred to anonymously
     15 // CHECK-NEXT: {{^def Wrapped : Warning<"">, InGroup<DiagGroup<}}
     16 // CHECK-NEXT: {{^                           ~~~~~~~~\^~~~~~~~~~}}
     17 // CHECK-NEXT: {{^                           InGroup<NamedGroup>}}
     18 
     19 def AlsoWrapped : Warning<"">, InGroup<
     20   DiagGroup<"name">>;
     21 //      CHECK: tg-fixits.td:[[@LINE-1]]:3: error: group 'name' is referred to anonymously
     22 // CHECK-NEXT: {{^  DiagGroup<"name">>;}}
     23 // CHECK-NEXT: {{^~~\^~~~~~~~~~~~~~~~~~}}
     24 // CHECK-NEXT: {{^InGroup<NamedGroup>}}
     25 
     26 // The following lines contain hard tabs (\t); do not change this!
     27 def HardTabs : Warning<"">,
     28 	InGroup<	DiagGroup<"name">	>;
     29 //      CHECK: tg-fixits.td:[[@LINE-1]]:11: error: group 'name' is referred to anonymously
     30 // CHECK-NEXT: {{^        InGroup<        DiagGroup<"name">       >;}}
     31 // CHECK-NEXT: {{^        ~~~~~~~~~~~~~~~~\^~~~~~~~~~~~~~~~~~~~~~~~~}}
     32 // CHECK-NEXT: {{^        InGroup<NamedGrop>}}
     33 
     34 // The following line has Unicode characters in it; do not change them!
     35 // FIXME: For now, we just give up on printing carets/ranges/fixits for
     36 // lines with Unicode in them, because SMDiagnostic don't keep a byte<->column
     37 // map around to line things up like Clang does.
     38 def Unicode : Warning<"">, InGroup<DiagGroup<"name">>;
     39 //      CHECK: tg-fixits.td:[[@LINE-1]]:51: error: group 'name' is referred to anonymously
     40 // CHECK-NEXT: def Unicode : Warning<"{{[^"]+}}">, InGroup<DiagGroup<"name">>;
     41 // CHECK-NEXT: note:
     42