OSDN Git Service

simple multiclass example
authorChris Lattner <sabre@nondot.org>
Fri, 1 Sep 2006 21:14:37 +0000 (21:14 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 1 Sep 2006 21:14:37 +0000 (21:14 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30028 91177308-0d34-0410-b5e6-96231b3b80d8

test/TableGen/MultiClass.td [new file with mode: 0644]

diff --git a/test/TableGen/MultiClass.td b/test/TableGen/MultiClass.td
new file mode 100644 (file)
index 0000000..7e117d5
--- /dev/null
@@ -0,0 +1,17 @@
+// RUN: tblgen %s
+class C1<int A, string B> { 
+  int bar = A;
+  string thestr = B;
+}
+
+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">;
+}
+
+defm FOO : t<42>;