Bill Wendling | b4be7f6 | 2013-08-22 20:46:05 +0000 | [diff] [blame] | 1 | // RUN: llvm-tblgen %s | FileCheck %s |
2 | |||||
3 | // CHECK: zing = 4 | ||||
4 | // CHECK: zing = 4 | ||||
5 | // CHECK: zing = 4 | ||||
6 | // CHECK: zing = 4 | ||||
7 | // CHECK-NOT: zing = 4 | ||||
David Greene | 5654613 | 2009-04-22 22:17:51 +0000 | [diff] [blame] | 8 | |
9 | class C1<int A, string B> { | ||||
10 | int bar = A; | ||||
11 | string thestr = B; | ||||
12 | int zing; | ||||
13 | } | ||||
14 | |||||
15 | def T : C1<4, "blah">; | ||||
16 | |||||
17 | multiclass t<int a> { | ||||
18 | def S1 : C1<a, "foo"> { | ||||
19 | int foo = 4; | ||||
20 | let bar = 1; | ||||
21 | } | ||||
22 | def S2 : C1<a, "bar">; | ||||
23 | } | ||||
24 | |||||
25 | multiclass s<int a> { | ||||
26 | def S3 : C1<a, "moo"> { | ||||
27 | int moo = 3; | ||||
28 | let bar = 1; | ||||
29 | } | ||||
30 | def S4 : C1<a, "baz">; | ||||
31 | } | ||||
32 | |||||
33 | defm FOO : t<42>, s<24>; | ||||
34 | |||||
35 | def T4 : C1<6, "foo">; | ||||
36 | |||||
37 | let zing = 4 in | ||||
38 | defm BAZ : t<3>, s<4>; |