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 // Do not move this line; it is referred to by absolute line number in the 5 // FileCheck lines below. 6 def NamedGroup : DiagGroup<"name">; 7 8 9 def InNamedGroup : Warning<"">, InGroup<DiagGroup<"name">>; 10 // CHECK: anonymous-groups.td:[[@LINE-1]]:41: error: group 'name' is referred to anonymously 11 // CHECK-NEXT: {{^def InNamedGroup : Warning<"">, InGroup<DiagGroup<"name">>;}} 12 // CHECK-NEXT: {{^ ~~~~~~~~\^~~~~~~~~~~~~~~~~~}} 13 // CHECK-NEXT: {{^ InGroup<NamedGroup>}} 14 // CHECK-NEXT: anonymous-groups.td:6:1: note: group defined here 15 // CHECK-NEXT: def NamedGroup : DiagGroup<"name">; 16 // CHECK-NEXT: ^ 17 18 19 def AlsoInNamedGroup : Warning<"">, InGroup < DiagGroup<"name"> >; 20 // CHECK: anonymous-groups.td:[[@LINE-1]]:48: error: group 'name' is referred to anonymously 21 // CHECK-NEXT: {{^def AlsoInNamedGroup : Warning<"">, InGroup < DiagGroup<"name"> >;}} 22 // CHECK-NEXT: {{^ ~~~~~~~~~~~\^~~~~~~~~~~~~~~~~~~}} 23 // CHECK-NEXT: {{^ InGroup<NamedGroup>}} 24 // CHECK-NEXT: anonymous-groups.td:6:1: note: group defined here 25 // CHECK-NEXT: def NamedGroup : DiagGroup<"name">; 26 // CHECK-NEXT: ^ 27 28 29 def AnonymousGroup : Warning<"">, InGroup<DiagGroup<"anonymous">>; 30 def AlsoAnonymousGroup : Warning<"">, InGroup<DiagGroup<"anonymous">>; 31 def AnonymousGroupAgain : Warning<"">, 32 InGroup<DiagGroup<"anonymous">>; 33 34 // CHECK: anonymous-groups.td:[[@LINE-5]]:43: error: group 'anonymous' is referred to anonymously 35 // CHECK-NEXT: {{^def AnonymousGroup : Warning<"">, InGroup<DiagGroup<"anonymous">>;}} 36 // CHECK-NEXT: {{^ ~~~~~~~~\^~~~~~~~~~~~~~~~~~~~~~~}} 37 // CHECK-NEXT: anonymous-groups.td:[[@LINE-7]]:47: note: also referenced here 38 // CHECK-NEXT: {{^def AlsoAnonymousGroup : Warning<"">, InGroup<DiagGroup<"anonymous">>;}} 39 // CHECK-NEXT: {{^ ~~~~~~~~\^~~~~~~~~~~~~~~~~~~~~~~}} 40 // CHECK-NEXT: anonymous-groups.td:[[@LINE-8]]:11: note: also referenced here 41 // CHECK-NEXT: {{^ InGroup<DiagGroup<"anonymous">>;}} 42 // CHECK-NEXT: {{^ ~~~~~~~~\^~~~~~~~~~~~~~~~~~~~~~~}} 43