summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorDavid Greene <greened@obbligato.org>2009-06-08 17:00:34 +0000
committerDavid Greene <greened@obbligato.org>2009-06-08 17:00:34 +0000
commit07eba05a610bb1711c2d9e798ad72df0ddf90249 (patch)
treee3edf39277f259509fba97aaf71af1cb7e7a05b2 /llvm/test
parent6f998fcb1d2ebc37a255e1a5ba25e2d2cc5a611d (diff)
downloadbcm5719-llvm-07eba05a610bb1711c2d9e798ad72df0ddf90249.tar.gz
bcm5719-llvm-07eba05a610bb1711c2d9e798ad72df0ddf90249.zip
Add a !regmatch operator to do pattern matching in TableGen.
llvm-svn: 73074
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/TableGen/regmatch.td11
1 files changed, 11 insertions, 0 deletions
diff --git a/llvm/test/TableGen/regmatch.td b/llvm/test/TableGen/regmatch.td
new file mode 100644
index 00000000000..3eb35df41c3
--- /dev/null
+++ b/llvm/test/TableGen/regmatch.td
@@ -0,0 +1,11 @@
+// RUN: tblgen %s | grep {Match1 = 1} | count 1
+// RUN: tblgen %s | grep {Match2 = 1} | count 1
+
+class Foo<string v> {
+ string Value = v;
+ int Match1 = !regmatch(".*ps$", v);
+ int Match2 = !regmatch(".*pd$", v);
+}
+
+def Bar : Foo<"addps">;
+def Baz : Foo<"addpd">;
OpenPOWER on IntegriCloud