• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// RUN: not llvm-tblgen -gen-directive-decl -I %p/../../include %s 2>&1 | FileCheck -match-full-lines %s
2// RUN: not llvm-tblgen -gen-directive-impl -I %p/../../include %s 2>&1 | FileCheck -match-full-lines %s
3// RUN: not llvm-tblgen -gen-directive-gen -I %p/../../include %s 2>&1 | FileCheck -match-full-lines %s
4
5include "llvm/Frontend/Directive/DirectiveBase.td"
6
7def TestDirectiveLanguage : DirectiveLanguage {
8  let name = "TdlError";
9}
10
11def TDLC_ClauseA : Clause<"clausea"> {
12  let isDefault = 1;
13}
14
15def TDLC_ClauseB : Clause<"clauseb"> {
16}
17
18def TDLC_ClauseC : Clause<"clausec"> {
19}
20
21def TDLC_ClauseD : Clause<"claused"> {
22}
23
24def TDL_DirA : Directive<"dira"> {
25  let allowedClauses = [
26    VersionedClause<TDLC_ClauseA>,
27    VersionedClause<TDLC_ClauseB>,
28    VersionedClause<TDLC_ClauseD>
29  ];
30  let allowedOnceClauses = [
31    VersionedClause<TDLC_ClauseA>,
32    VersionedClause<TDLC_ClauseC>
33  ];
34  let requiredClauses = [
35    VersionedClause<TDLC_ClauseC>,
36    VersionedClause<TDLC_ClauseD>
37  ];
38  let isDefault = 1;
39}
40
41// CHECK: error: Clause TDLC_ClauseA already defined on directive TDL_DirA
42// CHECK: error: Clause TDLC_ClauseD already defined on directive TDL_DirA
43// CHECK: error: One or more clauses are defined multiple times on directive TDL_DirA
44