[llvm-commits] [llvm] r141234 - /llvm/trunk/test/TableGen/MultiDef.td

David Greene greened at obbligato.org
Wed Oct 5 15:42:47 PDT 2011


Author: greened
Date: Wed Oct  5 17:42:47 2011
New Revision: 141234

URL: http://llvm.org/viewvc/llvm-project?rev=141234&view=rev
Log:
Add a Multidef Test

Add a simple test for multidefs.

Added:
    llvm/trunk/test/TableGen/MultiDef.td

Added: llvm/trunk/test/TableGen/MultiDef.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/TableGen/MultiDef.td?rev=141234&view=auto
==============================================================================
--- llvm/trunk/test/TableGen/MultiDef.td (added)
+++ llvm/trunk/test/TableGen/MultiDef.td Wed Oct  5 17:42:47 2011
@@ -0,0 +1,18 @@
+// RUN: tblgen %s | FileCheck %s
+// RUN: tblgen %s | FileCheck %s
+
+class Base<int i> {
+  int value = i;
+}
+
+multiclass Multi<list<int> values> {
+  def ONE : Base<values[0]>;
+  def TWO : Base<values[1]>;
+
+  multidef COUNT<values, int v, 2> : Base<v>;
+}
+
+defm List : Multi<[1, 2, 3, 4, 5, 6]>;
+
+// CHECK: MD4.ListCOUNT
+// CHECK: int value = 6





More information about the llvm-commits mailing list