forked from llvm-mirror/llvm
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMultiClassDefName.td
More file actions
41 lines (29 loc) · 796 Bytes
/
MultiClassDefName.td
File metadata and controls
41 lines (29 loc) · 796 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// RUN: llvm-tblgen %s | FileCheck %s
// XFAIL: vg_leak
// CHECK: WorldHelloCC
// CHECK-NOT: WorldHelloCC
class C<string n> {
string name = n;
}
multiclass Names<string n, string m> {
def CC : C<n>;
def World#NAME#CC : C<m>;
}
defm Hello : Names<"hello", "world">;
// Ensure that the same anonymous name is used as the prefix for all defs in an
// anonymous multiclass.
class Outer<C i> {
C Inner = i;
}
multiclass MC<string name> {
def hi : C<name>;
def there : Outer<!cast<C>(!strconcat(NAME, "hi"))>;
}
defm : MC<"foo">;
multiclass MC2<string name> {
def there : Outer<C<name> >;
}
// Ensure that we've correctly captured the reference to name from the implicit
// anonymous C def in the template parameter list of Outer.
// CHECK-NOT: MC2::name
defm : MC2<"bar">;