llvm-6502/test/TableGen/MultiClassInherit.td
David Greene de444af6bb Implement multiclass inheritance.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69810 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-22 16:42:54 +00:00

33 lines
478 B
TableGen

// RUN: tblgen %s | grep {zing = 4} | count 4
class C1<int A, string B> {
int bar = A;
string thestr = B;
int zing;
}
def T : C1<4, "blah">;
multiclass t<int a> {
def S1 : C1<a, "foo"> {
int foo = 4;
let bar = 1;
}
def S2 : C1<a, "bar">;
}
multiclass s<int a, int b> : t<a> {
def S3 : C1<b, "moo"> {
int moo = 3;
let bar = 1;
}
def S4 : C1<b, "baz">;
}
defm FOO : s<42, 24>;
def T4 : C1<6, "foo">;
let zing = 4 in
defm BAZ : s<3, 4>;