| 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]]:1: error: group 'name' is referred to anonymously |
| 11 | // CHECK-NEXT: {{^def InNamedGroup : Warning<"">, InGroup<DiagGroup<"name">>;}} |
| 12 | // CHECK: anonymous-groups.td:6:1: note: group defined here |
| 13 | // CHECK-NEXT: def NamedGroup : DiagGroup<"name">; |
| 14 | // CHECK-NEXT: ^ |
| 15 | |
| 16 | |
| 17 | def AlsoInNamedGroup : Warning<"">, InGroup < DiagGroup<"name"> >; |
| 18 | // CHECK: anonymous-groups.td:[[@LINE-1]]:1: error: group 'name' is referred to anonymously |
| 19 | // CHECK-NEXT: {{^def AlsoInNamedGroup : Warning<"">, InGroup < DiagGroup<"name"> >;}} |
| 20 | // CHECK: anonymous-groups.td:6:1: note: group defined here |
| 21 | // CHECK-NEXT: def NamedGroup : DiagGroup<"name">; |
| 22 | // CHECK-NEXT: ^ |
| 23 | |
| 24 | |
| 25 | def AnonymousGroup : Warning<"">, InGroup<DiagGroup<"anonymous">>; |
| 26 | def AlsoAnonymousGroup : Warning<"">, InGroup<DiagGroup<"anonymous">>; |
| 27 | def AnonymousGroupAgain : Warning<"">, |
| 28 | InGroup<DiagGroup<"anonymous">>; |
| 29 | |
| 30 | // CHECK: anonymous-groups.td:[[@LINE-5]]:1: error: group 'anonymous' is referred to anonymously |
| 31 | // CHECK-NEXT: {{^def AnonymousGroup : Warning<"">, InGroup<DiagGroup<"anonymous">>;}} |
| 32 | // CHECK: anonymous-groups.td:[[@LINE-6]]:1: note: also referenced here |
| 33 | // CHECK-NEXT: {{^def AlsoAnonymousGroup : Warning<"">, InGroup<DiagGroup<"anonymous">>;}} |
| 34 | // CHECK: anonymous-groups.td:[[@LINE-7]]:1: note: also referenced here |
| 35 | |