summaryrefslogtreecommitdiff
path: root/test/TableGen
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-08-04 20:43:48 +0000
committerChris Lattner <sabre@nondot.org>2003-08-04 20:43:48 +0000
commit7c1af88b8e5cf381635eeeddbcbd30e28e17e41c (patch)
treef7bd24b3e7b3e79fe8086376175918490eef5791 /test/TableGen
parent13854f295bd135ab9d2306c7e947d8e9a1be2f95 (diff)
New testcase
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7575 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/TableGen')
-rw-r--r--test/TableGen/Tree.td18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/TableGen/Tree.td b/test/TableGen/Tree.td
new file mode 100644
index 00000000000..f9f1f15139d
--- /dev/null
+++ b/test/TableGen/Tree.td
@@ -0,0 +1,18 @@
+// This tests to make sure we can parse tree patterns.
+// RUN: tblgen %s
+
+class TreeNode;
+class RegisterClass;
+
+def set : TreeNode;
+def plus : TreeNode;
+def imm : TreeNode;
+def R32 : RegisterClass;
+
+class Inst<dag T> {
+ dag Pattern = T;
+}
+
+def ADDrr32 : Inst<(set R32, (plus R32, R32))>; // a = b + c
+def ADDri32 : Inst<(set R32, (plus R32, imm))>; // a = b + imm
+