[llvm-commits] [llvm] r142526 - /llvm/trunk/test/TableGen/Paste.td

David Greene greened at obbligato.org
Wed Oct 19 06:04:50 PDT 2011


Author: greened
Date: Wed Oct 19 08:04:50 2011
New Revision: 142526

URL: http://llvm.org/viewvc/llvm-project?rev=142526&view=rev
Log:
Add Paste Test

This tests TableGen's paste functionality.

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

Added: llvm/trunk/test/TableGen/Paste.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/TableGen/Paste.td?rev=142526&view=auto
==============================================================================
--- llvm/trunk/test/TableGen/Paste.td (added)
+++ llvm/trunk/test/TableGen/Paste.td Wed Oct 19 08:04:50 2011
@@ -0,0 +1,35 @@
+// RUN: llvm-tblgen %s | FileCheck %s
+
+class Instr<int i> {
+  int index = i;
+}
+
+multiclass Test {
+  def Vx#NAME#PS : Instr<0>;
+  def Vx#NAME#PD : Instr<1>;
+  def Vy#NAME#PS : Instr<2>;
+  def Vy#NAME#PD : Instr<3>;
+}
+
+defm ADD : Test;
+defm SUB : Test;
+
+// CHECK: VxADDPD
+// CHECK: index = 1;
+// CHECK: VxADDPS
+// CHECK: index = 0;
+
+// CHECK: VxSUBPD
+// CHECK: index = 1;
+// CHECK: VxSUBPS
+// CHECK: index = 0;
+
+// CHECK: VyADDPD
+// CHECK: index = 3;
+// CHECK: VyADDPS
+// CHECK: index = 2;
+
+// CHECK: VySUBPD
+// CHECK: index = 3;
+// CHECK: VySUBPS
+// CHECK: index = 2;





More information about the llvm-commits mailing list