1// RUN: llvm-tblgen %s | FileCheck %s 2// XFAIL: vg_leak 3 4// CHECK: WorldHelloCC 5// CHECK-NOT: WorldHelloCC 6 7class C<string n> { 8 string name = n; 9} 10 11multiclass Names<string n, string m> { 12 def CC : C<n>; 13 def World#NAME#CC : C<m>; 14} 15 16defm Hello : Names<"hello", "world">; 17 18// Ensure that the same anonymous name is used as the prefix for all defs in an 19// anonymous multiclass. 20 21class Outer<C i> { 22 C Inner = i; 23} 24 25multiclass MC<string name> { 26 def hi : C<name>; 27 def there : Outer<!cast<C>(!strconcat(NAME, "hi"))>; 28} 29 30defm : MC<"foo">; 31 32multiclass MC2<string name> { 33 def there : Outer<C<name> >; 34} 35 36// Ensure that we've correctly captured the reference to name from the implicit 37// anonymous C def in the template parameter list of Outer. 38// CHECK-NOT: MC2::name 39 40defm : MC2<"bar">; 41 42