1 // RUN: llvm-tblgen %s | FileCheck %s
5 // CHECK-NOT: WorldHelloCC
11 multiclass Names<string n, string m> {
13 def World#NAME#CC : C<m>;
16 defm Hello : Names<"hello", "world">;
18 // Ensure that the same anonymous name is used as the prefix for all defs in an
19 // anonymous multiclass.
25 multiclass MC<string name> {
27 def there : Outer<!cast<C>(!strconcat(NAME, "hi"))>;
32 multiclass MC2<string name> {
33 def there : Outer<C<name> >;
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
42 multiclass MC3<string s> {
46 defm "" : MC3<"Buzz">;
48 // CHECK: def ZFizzBuzz
49 // CHECK: string name = "Buzz";
52 multiclass MC4<string s> {
56 defm ZTagazok : MC4<"AToi">;
58 // CHECK: def ZTagazokAToi
59 // CHECK: string name = "AToi";
63 def NAME#c.name : C<c.name>;
66 def CTiger : C<"Tiger">;
67 defm Zebra : MC5<CTiger>;
69 // CHECK: def ZebraTiger
70 // CHECK: string name = "Tiger";
74 def NAME#Tiger#c.name : C<c.name>;
77 def CAligator : C<"Aligator">;
78 defm Zebra : MC6<CAligator>;
80 // CHECK: def ZebraTigerAligator
81 // CHECK: string name = "Aligator";