// RUN: llvm-tblgen %s | FileCheck %s // XFAIL: vg_leak // CHECK: WorldHelloCC // CHECK-NOT: WorldHelloCC class C { string name = n; } multiclass Names { def CC : C; def World#NAME#CC : C; } 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 Inner = i; } multiclass MC { def hi : C; def there : Outer(!strconcat(NAME, "hi"))>; } defm : MC<"foo">; multiclass MC2 { def there : Outer >; } // 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">; multiclass MC3 { def ZFizz#s : C; } defm : MC3<"Buzz">; // CHECK: def ZFizzBuzz // CHECK: string name = "Buzz"; // CHECK-NOT: MC3::s multiclass MC4 { def NAME#s : C; } defm ZTagazok : MC4<"AToi">; // CHECK: def ZTagazokAToi // CHECK: string name = "AToi"; // CHECK-NOT: MC4::s multiclass MC5 { def NAME#c.name : C; } def CTiger : C<"Tiger">; defm Zebra : MC5; // CHECK: def ZebraTiger // CHECK: string name = "Tiger"; // CHECK-NOT: MC5::c multiclass MC6 { def NAME#Tiger#c.name : C; } def CAligator : C<"Aligator">; defm Zebra : MC6; // CHECK: def ZebraTigerAligator // CHECK: string name = "Aligator"; // CHECK-NOT: MC6::c