diff options
| author | David Greene <greened@obbligato.org> | 2009-06-08 17:00:34 +0000 |
|---|---|---|
| committer | David Greene <greened@obbligato.org> | 2009-06-08 17:00:34 +0000 |
| commit | 07eba05a610bb1711c2d9e798ad72df0ddf90249 (patch) | |
| tree | e3edf39277f259509fba97aaf71af1cb7e7a05b2 /llvm/test | |
| parent | 6f998fcb1d2ebc37a255e1a5ba25e2d2cc5a611d (diff) | |
| download | bcm5719-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.td | 11 |
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">; |

