Clang Project

clang_source_code/test/TableGen/tg-fixits.td
1// RUN: clang-tblgen -gen-clang-diag-groups -I%S %s -o /dev/null 2>&1 | FileCheck --strict-whitespace %s
2include "DiagnosticBase.inc"
3
4def NamedGroup : DiagGroup<"name">;
5
6def InNamedGroup : Warning<"">, InGroup<DiagGroup<"name">>;
7//      CHECK: tg-fixits.td:[[@LINE-1]]:1: error: group 'name' is referred to anonymously
8// CHECK-NEXT: {{^def InNamedGroup : Warning<"">, InGroup<DiagGroup<"name">>;}}
9
10def Wrapped : Warning<"">, InGroup<DiagGroup<
11  "name">>;
12//      CHECK: tg-fixits.td:[[@LINE-2]]:1: error: group 'name' is referred to anonymously
13// CHECK-NEXT: {{^def Wrapped : Warning<"">, InGroup<DiagGroup<}}
14
15def AlsoWrapped : Warning<"">, InGroup<
16  DiagGroup<"name">>;
17//      CHECK: tg-fixits.td:[[@LINE-2]]:1: error: group 'name' is referred to anonymously
18
19// The following line has Unicode characters in it; do not change them!
20// FIXME: For now, we just give up on printing carets/ranges/fixits for
21// lines with Unicode in them, because SMDiagnostic don't keep a byte<->column
22// map around to line things up like Clang does.
23def Unicode : Warning<"ユニコード">, InGroup<DiagGroup<"name">>;
24//      CHECK: tg-fixits.td:[[@LINE-1]]:1: error: group 'name' is referred to anonymously
25// CHECK-NEXT: def Unicode : Warning<"{{[^"]+}}">, InGroup<DiagGroup<"name">>;
26