44 lines · plain
1// RUN: clang-tblgen -gen-clang-diag-groups -I%S %s -o /dev/null 2>&1 | FileCheck %s2include "DiagnosticBase.inc"3 4def NamedGroup : DiagGroup<"a">;5def InNamedGroup1 : Warning<"">, InGroup<DiagGroup<"a">>;6def InNamedGroup2 : Warning<"">, InGroup < DiagGroup<"a"> >;7// CHECK: redefined-group.td:[[@LINE-3]]:5: error: group 'a' is defined more than once8// CHECK: redefined-group.td:[[@LINE-3]]:5: note: also implicitly defined here9// CHECK: redefined-group.td:[[@LINE-3]]:5: note: also implicitly defined here10 11def : DiagGroup<"b">;12def InUnnamedGroup : Warning<"">, InGroup<DiagGroup<"b">>;13// CHECK: redefined-group.td:[[@LINE-2]]:1: error: group 'b' is defined more than once14// CHECK: redefined-group.td:[[@LINE-2]]:5: note: also implicitly defined here15 16def ImplicitGroup1 : Warning<"">, InGroup<DiagGroup<"c">>;17def ImplicitGroup2 : Warning<"">, InGroup<DiagGroup<"c">>;18def ImplicitGroup3 : Warning<"">,19 InGroup<DiagGroup<"c">>;20// CHECK: redefined-group.td:[[@LINE-4]]:5: error: group 'c' is implicitly defined more than once21// CHECK: redefined-group.td:[[@LINE-4]]:5: note: also implicitly defined here22// CHECK: redefined-group.td:[[@LINE-4]]:5: note: also implicitly defined here23 24def NamedAndUnnamed : DiagGroup<"d">;25def : DiagGroup<"d">;26// CHECK: redefined-group.td:[[@LINE-2]]:5: error: group 'd' is defined more than once27// CHECK: redefined-group.td:[[@LINE-2]]:1: note: also defined here28 29def : DiagGroup<"e">;30def NamedAndUnnamed2 : DiagGroup<"e">;31// CHECK: redefined-group.td:[[@LINE-1]]:5: error: group 'e' is defined more than once32// CHECK: redefined-group.td:[[@LINE-3]]:1: note: also defined here33 34def InGroupF1 : Warning<"">, InGroup<DiagGroup<"f">>;35def : DiagGroup<"f">; // FIXME: It'd be nice to also note this, but it's hard to detect.36def InGroupF2 : Warning<"">, InGroup<DiagGroup<"f">>;37def GroupF : DiagGroup<"f">;38def InGroupF3 : Warning<"">, InGroup<GroupF>;39def InGroupF4 : Warning<"">, InGroup<DiagGroup<"f">>;40// CHECK: redefined-group.td:[[@LINE-5]]:1: error: group 'f' is defined more than once41// CHECK: redefined-group.td:[[@LINE-7]]:5: note: also implicitly defined here42// CHECK: redefined-group.td:[[@LINE-6]]:5: note: also implicitly defined here43// CHECK: redefined-group.td:[[@LINE-4]]:5: note: also implicitly defined here44