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