File: redefined-group.td

package info (click to toggle)
llvm-toolchain-19 1%3A19.1.7-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,998,520 kB
  • sloc: cpp: 6,951,680; ansic: 1,486,157; asm: 913,598; python: 232,024; f90: 80,126; objc: 75,281; lisp: 37,276; pascal: 16,990; sh: 10,009; ml: 5,058; perl: 4,724; awk: 3,523; makefile: 3,167; javascript: 2,504; xml: 892; fortran: 664; cs: 573
file content (43 lines) | stat: -rw-r--r-- 2,281 bytes parent folder | download | duplicates (12)
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]]:5: error: group 'a' is defined more than once
// CHECK: redefined-group.td:[[@LINE-3]]:5: note: also implicitly defined here
// CHECK: redefined-group.td:[[@LINE-3]]:5: 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]]:5: 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]]:5: error: group 'c' is implicitly defined more than once
// CHECK: redefined-group.td:[[@LINE-4]]:5: note: also implicitly defined here
// CHECK: redefined-group.td:[[@LINE-4]]:5: note: also implicitly defined here

def NamedAndUnnamed : DiagGroup<"d">;
def : DiagGroup<"d">;
// CHECK: redefined-group.td:[[@LINE-2]]:5: 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]]:5: 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]]:5: note: also implicitly defined here
// CHECK: redefined-group.td:[[@LINE-6]]:5: note: also implicitly defined here
// CHECK: redefined-group.td:[[@LINE-4]]:5: note: also implicitly defined here