aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDavid Greene <greened@obbligato.org>2009-06-08 23:05:37 +0000
committerDavid Greene <greened@obbligato.org>2009-06-08 23:05:37 +0000
commit0d973999f3a7973e680e12acdf6def9d769911b6 (patch)
treed26340225fa5c4ca70833825a305da557017db5e /test
parent2e7ccfce98b925d07788fdd08cccc9ddb3d7004b (diff)
downloadexternal_llvm-0d973999f3a7973e680e12acdf6def9d769911b6.zip
external_llvm-0d973999f3a7973e680e12acdf6def9d769911b6.tar.gz
external_llvm-0d973999f3a7973e680e12acdf6def9d769911b6.tar.bz2
Add a !patsubst operator. Use on string types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73099 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/TableGen/patsubst.td15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/TableGen/patsubst.td b/test/TableGen/patsubst.td
new file mode 100644
index 0000000..0a7b3d8
--- /dev/null
+++ b/test/TableGen/patsubst.td
@@ -0,0 +1,15 @@
+// RUN: tblgen %s | grep {Match1 = "v4f32"} | count 1
+// RUN: tblgen %s | grep {Match2 = "v2f64"} | count 1
+// RUN: tblgen %s | grep {Match3 = "v4f32 add"} | count 1
+// RUN: tblgen %s | grep {Match4 = "v2f64 add"} | count 1
+
+class Foo<string v> {
+ string Value = v;
+ string Match1 = !patsubst(".*ps$", "v4f32", v);
+ string Match2 = !patsubst(".*pd$", "v2f64", v);
+ string Match3 = !patsubst("(.*)ps$", "v4f32 $1", v);
+ string Match4 = !patsubst("(.*)pd$", "v2f64 $1", v);
+}
+
+def Bar : Foo<"addps">;
+def Baz : Foo<"addpd">;