Changeset View
Changeset View
Standalone View
Standalone View
mlir/test/Transforms/test-legalizer-full.mlir
Show First 20 Lines • Show All 63 Lines • ▼ Show 20 Lines | |||||
// Test that unknown operations can be dynamically legal. | // Test that unknown operations can be dynamically legal. | ||||
func @test_unknown_dynamically_legal() { | func @test_unknown_dynamically_legal() { | ||||
"foo.unknown_op"() {test.dynamically_legal} : () -> () | "foo.unknown_op"() {test.dynamically_legal} : () -> () | ||||
// expected-error@+1 {{failed to legalize operation 'foo.unknown_op'}} | // expected-error@+1 {{failed to legalize operation 'foo.unknown_op'}} | ||||
"foo.unknown_op"() {} : () -> () | "foo.unknown_op"() {} : () -> () | ||||
"test.return"() : () -> () | "test.return"() : () -> () | ||||
} | } | ||||
// ----- | |||||
// Test that region inlining can be properly undone. | |||||
func @test_undo_region_inline() { | |||||
"test.region"() ({ | |||||
^bb1(%i0: i64): | |||||
// expected-error@+1 {{failed to legalize operation 'std.br'}} | |||||
br ^bb2(%i0 : i64) | |||||
^bb2(%i1: i64): | |||||
"test.invalid"(%i1) : (i64) -> () | |||||
}) {} : () -> () | |||||
"test.return"() : () -> () | |||||
} |