mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 03:02:36 +01:00
021bbc7b82
Validity check introduce in D90241 are a bit too restrict and this patch propose to losen them a bit. The duplicate clauses is now check only between the three allowed lists and between the requiredClauses and allowedClauses lists. This allows to enable some check where a clause can be required but also appear only once on the directive. We found these kind of restriction useful on the set directive in OpenACC for example. Reviewed By: kiranchandramohan Differential Revision: https://reviews.llvm.org/D90770
44 lines
1.2 KiB
TableGen
44 lines
1.2 KiB
TableGen
// 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
|
|
// RUN: not llvm-tblgen -gen-directive-gen -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"> {
|
|
}
|
|
|
|
def TDLC_ClauseC : Clause<"clausec"> {
|
|
}
|
|
|
|
def TDLC_ClauseD : Clause<"claused"> {
|
|
}
|
|
|
|
def TDL_DirA : Directive<"dira"> {
|
|
let allowedClauses = [
|
|
VersionedClause<TDLC_ClauseA>,
|
|
VersionedClause<TDLC_ClauseB>,
|
|
VersionedClause<TDLC_ClauseD>
|
|
];
|
|
let allowedOnceClauses = [
|
|
VersionedClause<TDLC_ClauseA>,
|
|
VersionedClause<TDLC_ClauseC>
|
|
];
|
|
let requiredClauses = [
|
|
VersionedClause<TDLC_ClauseC>,
|
|
VersionedClause<TDLC_ClauseD>
|
|
];
|
|
let isDefault = 1;
|
|
}
|
|
|
|
// CHECK: error: Clause TDLC_ClauseA already defined on directive TDL_DirA
|
|
// CHECK: error: Clause TDLC_ClauseD already defined on directive TDL_DirA
|
|
// CHECK: error: One or more clauses are defined multiple times on directive TDL_DirA
|