2020-10-29 03:11:47 +08:00
|
|
|
// RUN: not llvm-tblgen -gen-directive-decl -I %p/../../include %s 2>&1 | FileCheck -match-full-lines %s
|
|
|
|
// RUN: not llvm-tblgen -gen-directive-impl -I %p/../../include %s 2>&1 | FileCheck -match-full-lines %s
|
|
|
|
|
|
|
|
include "llvm/Frontend/Directive/DirectiveBase.td"
|
|
|
|
|
|
|
|
def TestDirectiveLanguage : DirectiveLanguage {
|
|
|
|
let name = "TdlError";
|
|
|
|
}
|
|
|
|
|
|
|
|
def TDLC_ClauseA : Clause<"clausea"> {
|
|
|
|
let isDefault = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
def TDLC_ClauseB : Clause<"clauseb"> {
|
|
|
|
}
|
|
|
|
|
2020-11-06 05:21:15 +08:00
|
|
|
def TDLC_ClauseC : Clause<"clausec"> {
|
|
|
|
}
|
|
|
|
|
|
|
|
def TDLC_ClauseD : Clause<"claused"> {
|
|
|
|
}
|
|
|
|
|
2020-10-29 03:11:47 +08:00
|
|
|
def TDL_DirA : Directive<"dira"> {
|
|
|
|
let allowedClauses = [
|
|
|
|
VersionedClause<TDLC_ClauseA>,
|
2020-11-06 05:21:15 +08:00
|
|
|
VersionedClause<TDLC_ClauseB>,
|
|
|
|
VersionedClause<TDLC_ClauseD>
|
2020-10-29 03:11:47 +08:00
|
|
|
];
|
|
|
|
let allowedOnceClauses = [
|
2020-11-06 05:21:15 +08:00
|
|
|
VersionedClause<TDLC_ClauseA>,
|
|
|
|
VersionedClause<TDLC_ClauseC>
|
|
|
|
];
|
|
|
|
let requiredClauses = [
|
|
|
|
VersionedClause<TDLC_ClauseC>,
|
|
|
|
VersionedClause<TDLC_ClauseD>
|
2020-10-29 03:11:47 +08:00
|
|
|
];
|
|
|
|
let isDefault = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
// CHECK: error: Clause TDLC_ClauseA already defined on directive TDL_DirA
|
2020-11-06 05:21:15 +08:00
|
|
|
// CHECK: error: Clause TDLC_ClauseD already defined on directive TDL_DirA
|
2020-10-29 03:11:47 +08:00
|
|
|
// CHECK: error: One or more clauses are defined multiple times on directive TDL_DirA
|