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