1 // RUN: mlir-opt %s | mlir-opt -test-patterns | FileCheck %s
3 // CHECK-LABEL: @test_enum_attr_roundtrip
4 func.func @test_enum_attr_roundtrip() -> () {
5 // CHECK: value = #test<enum first>
6 "test.op"() {value = #test<enum first>} : () -> ()
7 // CHECK: value = #test<enum second>
8 "test.op"() {value = #test<enum second>} : () -> ()
9 // CHECK: value = #test<enum third>
10 "test.op"() {value = #test<enum third>} : () -> ()
14 // CHECK-LABEL: @test_op_with_enum
15 func.func @test_op_with_enum() -> () {
16 // CHECK: test.op_with_enum third
17 test.op_with_enum third
21 // CHECK-LABEL: @test_match_op_with_enum
22 func.func @test_match_op_with_enum() -> () {
23 // CHECK: test.op_with_enum third tag 0 : i32
24 test.op_with_enum third tag 0 : i32
25 // CHECK: test.op_with_enum second tag 1 : i32
26 test.op_with_enum first tag 0 : i32