1 // RUN: mlir-opt -verify-diagnostics -split-input-file %s
3 func.func @test_invalid_enum_case() -> () {
4 // expected-error@+2 {{expected test::TestEnum to be one of: first, second, third}}
5 // expected-error@+1 {{failed to parse TestEnumAttr}}
6 test.op_with_enum #test<enum fourth>
11 func.func @test_invalid_enum_case() -> () {
12 // expected-error@+1 {{expected test::TestEnum to be one of: first, second, third}}
13 test.op_with_enum fourth
14 // expected-error@+1 {{failed to parse TestEnumAttr}}
19 func.func @test_invalid_attr() -> () {
20 // expected-error@+1 {{op attribute 'value' failed to satisfy constraint: a test enum}}
21 "test.op_with_enum"() {value = 1 : index} : () -> ()
26 func.func @test_parse_invalid_attr() -> () {
27 // expected-error@+2 {{expected valid keyword}}
28 // expected-error@+1 {{failed to parse TestEnumAttr parameter 'value'}}
29 test.op_with_enum 1 : index