rkayaith | 13bd410 | 2022-10-18 18:44:11 | [diff] [blame^] | 1 | // RUN: mlir-opt %s -verify-diagnostics -pass-pipeline='builtin.module(any(cse, test-interface-pass))' -allow-unregistered-dialect -o /dev/null |
River Riddle | c2fb9c2 | 2022-04-11 09:36:10 | [diff] [blame] | 2 | |
| 3 | // Test that we execute generic pipelines correctly. The `cse` pass is fully generic and should execute |
| 4 | // on both the module and the func. The `test-interface-pass` filters based on FunctionOpInterface and |
| 5 | // should only execute on the func. |
| 6 | |
| 7 | // expected-remark@below {{Executing interface pass on operation}} |
| 8 | func.func @main() -> (i1, i1) { |
| 9 | // CHECK-LABEL: func @main |
| 10 | // CHECK-NEXT: arith.constant true |
| 11 | // CHECK-NEXT: return |
| 12 | %true = arith.constant true |
| 13 | %true1 = arith.constant true |
| 14 | return %true, %true1 : i1, i1 |
| 15 | } |
| 16 | |
| 17 | module @module { |
| 18 | // CHECK-LABEL: module @main |
| 19 | // CHECK-NEXT: arith.constant true |
| 20 | // CHECK-NEXT: foo.op |
| 21 | %true = arith.constant true |
| 22 | %true1 = arith.constant true |
| 23 | "foo.op"(%true, %true1) : (i1, i1) -> () |
| 24 | } |