MachObjectWriter: optimize the string table for common suffices
[oota-llvm.git] / test / TableGen / MultiClassDefName.td
1 // RUN: llvm-tblgen %s | FileCheck %s
2 // XFAIL: vg_leak
3
4 // CHECK: WorldHelloCC
5 // CHECK-NOT: WorldHelloCC
6
7 class C<string n> {
8   string name = n;
9 }
10
11 multiclass Names<string n, string m> {
12    def CC : C<n>;
13    def World#NAME#CC : C<m>;
14 }
15
16 defm 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
21 class Outer<C i> {
22   C Inner = i;
23 }
24
25 multiclass MC<string name> {
26   def hi : C<name>;
27   def there : Outer<!cast<C>(!strconcat(NAME, "hi"))>;
28 }
29
30 defm : MC<"foo">;
31
32 multiclass 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
40 defm : MC2<"bar">;
41