File: redefined-group.td

package info (click to toggle)
llvm-toolchain-15 1%3A15.0.6-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,554,644 kB
  • sloc: cpp: 5,922,452; ansic: 1,012,136; asm: 674,362; python: 191,568; objc: 73,855; f90: 42,327; lisp: 31,913; pascal: 11,973; javascript: 10,144; sh: 9,421; perl: 7,447; ml: 5,527; awk: 3,523; makefile: 2,520; xml: 885; cs: 573; fortran: 567
file content (43 lines) | stat: -rw-r--r-- 2,281 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// RUN: clang-tblgen -gen-clang-diag-groups -I%S %s -o /dev/null 2>&1 | FileCheck %s
include "DiagnosticBase.inc"

def NamedGroup : DiagGroup<"a">;
def InNamedGroup1 : Warning<"">, InGroup<DiagGroup<"a">>;
def InNamedGroup2 : Warning<"">, InGroup  < DiagGroup<"a"> >;
// CHECK: redefined-group.td:[[@LINE-3]]:1: error: group 'a' is defined more than once
// CHECK: redefined-group.td:[[@LINE-3]]:1: note: also implicitly defined here
// CHECK: redefined-group.td:[[@LINE-3]]:1: note: also implicitly defined here

def : DiagGroup<"b">;
def InUnnamedGroup : Warning<"">, InGroup<DiagGroup<"b">>;
// CHECK: redefined-group.td:[[@LINE-2]]:1: error: group 'b' is defined more than once
// CHECK: redefined-group.td:[[@LINE-2]]:1: note: also implicitly defined here

def ImplicitGroup1 : Warning<"">, InGroup<DiagGroup<"c">>;
def ImplicitGroup2 : Warning<"">, InGroup<DiagGroup<"c">>;
def ImplicitGroup3 : Warning<"">,
  InGroup<DiagGroup<"c">>;
// CHECK: redefined-group.td:[[@LINE-4]]:1: error: group 'c' is implicitly defined more than once
// CHECK: redefined-group.td:[[@LINE-4]]:1: note: also implicitly defined here
// CHECK: redefined-group.td:[[@LINE-4]]:1: note: also implicitly defined here

def NamedAndUnnamed : DiagGroup<"d">;
def : DiagGroup<"d">;
// CHECK: redefined-group.td:[[@LINE-2]]:1: error: group 'd' is defined more than once
// CHECK: redefined-group.td:[[@LINE-2]]:1: note: also defined here

def : DiagGroup<"e">;
def NamedAndUnnamed2 : DiagGroup<"e">;
// CHECK: redefined-group.td:[[@LINE-1]]:1: error: group 'e' is defined more than once
// CHECK: redefined-group.td:[[@LINE-3]]:1: note: also defined here

def InGroupF1 : Warning<"">, InGroup<DiagGroup<"f">>;
def : DiagGroup<"f">; // FIXME: It'd be nice to also note this, but it's hard to detect.
def InGroupF2 : Warning<"">, InGroup<DiagGroup<"f">>;
def GroupF : DiagGroup<"f">;
def InGroupF3 : Warning<"">, InGroup<GroupF>;
def InGroupF4 : Warning<"">, InGroup<DiagGroup<"f">>;
// CHECK: redefined-group.td:[[@LINE-5]]:1: error: group 'f' is defined more than once
// CHECK: redefined-group.td:[[@LINE-7]]:1: note: also implicitly defined here
// CHECK: redefined-group.td:[[@LINE-6]]:1: note: also implicitly defined here
// CHECK: redefined-group.td:[[@LINE-4]]:1: note: also implicitly defined here