1 // # RUN: mlir-opt -test-print-invalid %s | FileCheck %s
2 // # RUN: mlir-opt -test-print-invalid %s --mlir-print-assume-verified | FileCheck %s --check-prefix=ASSUME-VERIFIED
4 // The pass creates some ops and prints them to stdout, the input is just an
8 // The operation is invalid because the body does not have a terminator, print
10 // CHECK: Invalid operation:
11 // CHECK-NEXT: "func.func"() <{function_type = () -> (), sym_name = "test"}> ({
15 // The operation is valid because the body has a terminator, print the custom
17 // CHECK: Valid operation:
18 // CHECK-NEXT: func @test() {
22 // With --mlir-print-assume-verified the custom form is printed in both cases.
23 // This works in this particular case, but may crash in general.
25 // ASSUME-VERIFIED: Invalid operation:
26 // ASSUME-VERIFIED-NEXT: func @test() {
27 // ASSUME-VERIFIED-NEXT: }
29 // ASSUME-VERIFIED: Valid operation:
30 // ASSUME-VERIFIED-NEXT: func @test() {
31 // ASSUME-VERIFIED-NEXT: return
32 // ASSUME-VERIFIED-NEXT: }