Nicolai Haehnle | 02dea26 | 2018-03-21 17:12:53 +0000 | [diff] [blame] | 1 | // RUN: llvm-tblgen %s | FileCheck %s |
| 2 | // XFAIL: vg_leak |
| 3 | |
Nicolai Haehnle | 02dea26 | 2018-03-21 17:12:53 +0000 | [diff] [blame] | 4 | // CHECK: def B0a { |
| 5 | // CHECK: string e = "B0"; |
| 6 | // CHECK: } |
| 7 | |
| 8 | // CHECK: def B0ba { |
Nicolai Haehnle | 26db53e | 2018-06-04 14:26:05 +0000 | [diff] [blame] | 9 | // CHECK: string a = "B0b"; |
Nicolai Haehnle | 02dea26 | 2018-03-21 17:12:53 +0000 | [diff] [blame] | 10 | // CHECK: string b = "B0"; |
| 11 | // CHECK: } |
| 12 | |
Nicolai Haehnle | 26db53e | 2018-06-04 14:26:05 +0000 | [diff] [blame] | 13 | // CHECK: def B0bys { |
| 14 | // CHECK: string f = "B0b"; |
| 15 | // CHECK: string g = "B0"; |
| 16 | // CHECK: } |
| 17 | |
Nicolai Haehnle | 02dea26 | 2018-03-21 17:12:53 +0000 | [diff] [blame] | 18 | // CHECK: def B0cza { |
Nicolai Haehnle | 26db53e | 2018-06-04 14:26:05 +0000 | [diff] [blame] | 19 | // CHECK: string a = "B0cz"; |
Nicolai Haehnle | 02dea26 | 2018-03-21 17:12:53 +0000 | [diff] [blame] | 20 | // CHECK: string b = "B0"; |
| 21 | // CHECK: } |
| 22 | |
Nicolai Haehnle | 26db53e | 2018-06-04 14:26:05 +0000 | [diff] [blame] | 23 | // CHECK: def B0czyt { |
| 24 | // CHECK: string f = "B0cz"; |
| 25 | // CHECK: string g = "B0"; |
Nicolai Haehnle | 02dea26 | 2018-03-21 17:12:53 +0000 | [diff] [blame] | 26 | // CHECK: } |
| 27 | |
Nicolai Haehnle | 26db53e | 2018-06-04 14:26:05 +0000 | [diff] [blame] | 28 | // CHECK: def C0 { |
| 29 | // CHECK: string a = "C0"; |
| 30 | // CHECK: string b = "C0"; |
| 31 | // CHECK: string c = "a"; |
| 32 | // CHECK: } |
| 33 | |
| 34 | // CHECK: def D0a { |
| 35 | // CHECK: string a = "D0a"; |
| 36 | // CHECK: string b = "D0a"; |
| 37 | // CHECK: string c = "D0"; |
| 38 | // CHECK: } |
| 39 | |
| 40 | // CHECK: def D0b { |
| 41 | // CHECK: string a = "D0b"; |
| 42 | // CHECK: string b = "D0b"; |
| 43 | // CHECK: string c = "a"; |
| 44 | // CHECK: } |
| 45 | |
| 46 | // CHECK: def xB0b { |
| 47 | // CHECK: string c = "B0b"; |
| 48 | // CHECK: string d = "B0"; |
Nicolai Haehnle | 02dea26 | 2018-03-21 17:12:53 +0000 | [diff] [blame] | 49 | // CHECK: } |
| 50 | |
| 51 | // CHECK: def xB0cz { |
| 52 | // CHECK: string c = "B0cz"; |
Nicolai Haehnle | 26db53e | 2018-06-04 14:26:05 +0000 | [diff] [blame] | 53 | // CHECK: string d = "B0"; |
Nicolai Haehnle | 02dea26 | 2018-03-21 17:12:53 +0000 | [diff] [blame] | 54 | // CHECK: } |
| 55 | |
| 56 | multiclass A<string p, string q> { |
| 57 | def a { |
| 58 | string a = NAME; |
| 59 | string b = p; |
| 60 | } |
| 61 | |
| 62 | def x # NAME { |
| 63 | string c = NAME; |
| 64 | string d = p; |
| 65 | } |
| 66 | |
| 67 | def y # q { |
| 68 | string f = NAME; |
| 69 | string g = p; |
| 70 | } |
| 71 | } |
| 72 | |
| 73 | multiclass B<string name, string t> { |
| 74 | def a { |
| 75 | string e = NAME; |
| 76 | } |
| 77 | |
| 78 | defm b : A<NAME, "s">; |
| 79 | |
| 80 | defm NAME # c # name : A<NAME, t>; |
| 81 | } |
| 82 | |
| 83 | defm B0 : B<"z", "t">; |
Nicolai Haehnle | 26db53e | 2018-06-04 14:26:05 +0000 | [diff] [blame] | 84 | |
| 85 | class Cbase { |
| 86 | string a = NAME; |
| 87 | } |
| 88 | |
| 89 | class C<string arg> : Cbase { |
| 90 | string b = NAME; |
| 91 | string c = arg; |
| 92 | } |
| 93 | |
| 94 | def C0 : C<"a">; |
| 95 | |
| 96 | multiclass D<string arg> { |
| 97 | def a : C<NAME>; |
| 98 | def b : C<arg>; |
| 99 | } |
| 100 | |
| 101 | defm D0 : D<"a">; |