xref: /llvm-project/mlir/test/Transforms/test-legalizer-analysis.mlir (revision cda6aa78f8e7346382a204306c4d86ffbab99785)
1// RUN: mlir-opt -allow-unregistered-dialect -test-legalize-patterns -verify-diagnostics -test-legalize-mode=analysis %s | FileCheck %s
2// expected-remark@-2 {{op 'builtin.module' is legalizable}}
3
4// expected-remark@+1 {{op 'func.func' is legalizable}}
5func.func @test(%arg0: f32) {
6  // expected-remark@+1 {{op 'test.illegal_op_a' is legalizable}}
7  %result = "test.illegal_op_a"() : () -> (i32)
8  "foo.region"() ({
9      // expected-remark@+1 {{op 'test.invalid' is legalizable}}
10      "test.invalid"() : () -> ()
11  }) : () -> ()
12  return
13}
14
15// Check that none of the legalizable operations were modified.
16// CHECK-LABEL: func @test
17// CHECK-NEXT: "test.illegal_op_a"
18// CHECK: "test.invalid"
19