6b6cab11cb728d15ffbb54861215da166fcb406f
[oota-llvm.git] / test / TableGen / MultiClass.td
1 // RUN: llvm-tblgen %s | FileCheck %s
2
3 // CHECK: zing = 4
4 // CHECK: zing = 4
5 // CHECK-NOT: zing = 4
6
7 class C1<int A, string B> { 
8   int bar = A;
9   string thestr = B;
10   int zing;
11 }
12
13 def T : C1<4, "blah">;
14
15 multiclass t<int a> {
16   def S1 : C1<a, "foo"> {
17     int foo = 4;
18     let bar = 1;
19   }
20   def S2 : C1<a, "bar">;
21 }
22
23 defm FOO : t<42>;
24
25 def T4 : C1<6, "foo">;
26
27 let zing = 4 in
28   defm BAZ : t<3>;
29