summaryrefslogtreecommitdiffstats
path: root/mlir/test
diff options
context:
space:
mode:
Diffstat (limited to 'mlir/test')
-rw-r--r--mlir/test/IR/test-matchers.mlir1
-rw-r--r--mlir/test/lib/IR/TestMatchers.cpp3
2 files changed, 4 insertions, 0 deletions
diff --git a/mlir/test/IR/test-matchers.mlir b/mlir/test/IR/test-matchers.mlir
index 7808f25a2f8..60d5bcf7d81 100644
--- a/mlir/test/IR/test-matchers.mlir
+++ b/mlir/test/IR/test-matchers.mlir
@@ -40,3 +40,4 @@ func @test2(%a: f32) -> f32 {
// CHECK-LABEL: test2
// CHECK: Pattern add(add(a, constant), a) matched and bound constant to: 1.000000e+00
+// CHECK: Pattern add(add(a, constant), a) matched
diff --git a/mlir/test/lib/IR/TestMatchers.cpp b/mlir/test/lib/IR/TestMatchers.cpp
index b62daa8437c..6061b251d72 100644
--- a/mlir/test/lib/IR/TestMatchers.cpp
+++ b/mlir/test/lib/IR/TestMatchers.cpp
@@ -126,12 +126,15 @@ void test2(FuncOp f) {
auto a = m_Val(f.getArgument(0));
FloatAttr floatAttr;
auto p = m_Op<MulFOp>(a, m_Op<AddFOp>(a, m_Constant(&floatAttr)));
+ auto p1 = m_Op<MulFOp>(a, m_Op<AddFOp>(a, m_Constant()));
// Last operation that is not the terminator.
Operation *lastOp = f.getBody().front().back().getPrevNode();
if (p.match(lastOp))
llvm::outs()
<< "Pattern add(add(a, constant), a) matched and bound constant to: "
<< floatAttr.getValueAsDouble() << "\n";
+ if (p1.match(lastOp))
+ llvm::outs() << "Pattern add(add(a, constant), a) matched\n";
}
void TestMatchers::runOnFunction() {
OpenPOWER on IntegriCloud