46 lines · plain
1// RUN: not clang-tblgen --gen-clang-diags-enums -DERROR1 -I%S %s 2>&1 | FileCheck %s --check-prefixes=CHECK,C12// RUN: not clang-tblgen --gen-clang-diags-enums -DERROR2 -I%S %s 2>&1 | FileCheck %s --check-prefixes=CHECK,C23// RUN: not clang-tblgen --gen-clang-diags-enums -DERROR3 -I%S %s 2>&1 | FileCheck %s --check-prefixes=CHECK,C34// RUN: not clang-tblgen --gen-clang-diags-enums -DERROR4 -I%S %s 2>&1 | FileCheck %s --check-prefixes=CHECK,C45include "DiagnosticBase.inc"6 7// No real reason to diagnose these, the namespace generated as the8// 'enumeration' name will never conflict with the enumerator.9def EnumerationEnumeratorDupe : Error<"%enum_select<Matchy>{%Matchy{haha}}0">;10 11// Enumerator values aren't required, though this does seem kind of silly/not12// particularly useful?13def NoEnumerators : Error<"%enum_select<Name>{foo|bar|baz}0">;14 15def DupeNames1 : Error<"%enum_select<DupeName>{}0">;16def DupeNames2 : Error<"%enum_select<DupeName>{}0">;17// CHECK: error: Duplicate enumeration name 'DupeName'18// CHECK-NEXT: def DupeNames219// CHECK: note: Previous diagnostic is here20// CHECK-NEXT: def DupeNames121 22def DupeValue : Error<"%enum_select<DupeValue>{%DName{V1}|%DName{V2}}0">;23// CHECK: error: Duplicate enumerator name 'DName'24 25#ifdef ERROR126def EnumValNotExpected : Error<"%enum_select{V1|%Val2{V2}}0">;27// C1: expected '<' after enum_select28#endif29 30#ifdef ERROR231def SelectWithArrow : Error<"%select<Something>{V1|%Val2{V2}}0">;32// C2: modifier '<' syntax not valid with %select33#endif34 35#ifdef ERROR336// Missing closing > after the name of the enumeration37def MissingClosing : Error<"%enum_select<MissingClosingName{}0">;38// C3: expected '>' while parsing %enum_select39#endif40 41#ifdef ERROR442// Missing { after the name of an enumerator43def MissingTextAfterEnumerator: Error<"%enum_select<Name>{%OtherName|foo}0">;44// C4: expected '{' while parsing %enum_select45#endif46