repo.or.cz
/
llvm-project.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
[docs] Add LICENSE.txt to the root of the mono-repo
[llvm-project.git]
/
llvm
/
test
/
TableGen
/
cast-multiclass.td
blob
7c8ed5f1f048708b0400c5439409d999a548fb40
1
// RUN: llvm-tblgen %s | FileCheck %s
2
3
class AClass<bit C> {
4
bit Cond = C;
5
}
6
7
def A0: AClass<0>;
8
def A1: AClass<1>;
9
10
class BoolToList<bit Value> {
11
list<int> ret = !if(Value, [1]<int>, []<int>);
12
}
13
14
multiclass P<string AStr> {
15
foreach i = BoolToList<!cast<AClass>(AStr).Cond>.ret in
16
def SubDef;
17
}
18
19
// CHECK-NOT: def XSubDef
20
defm X : P<"A0">;
21
22
// CHECK: def YSubDef
23
defm Y : P<"A1">;