Skip to content

Commit f6edf25

Browse files
committed
Add test
1 parent 07590ac commit f6edf25

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

mlir/test/IR/invalid-ops.mlir

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,3 +123,25 @@ func.func @invalid_splat(%v : f32) { // expected-note {{prior use here}}
123123

124124
// expected-error@+1 {{number of operands and types do not match: got 0 operands and 1 types}}
125125
test.variadic_args_types_split "hello_world" : i32
126+
127+
// -----
128+
129+
// Test multiple verifier errors in the same split to ensure all are reported.
130+
131+
func.func @verify_fail_1() {
132+
// expected-error@+1 {{'arith.constant' op integer return type must be signless}}
133+
%r = "arith.constant"() {value = -1 : si32} : () -> si32
134+
return
135+
}
136+
137+
func.func @verify_fail_2() {
138+
// expected-error@+1 {{'arith.constant' op value must be an integer, float, or elements attribute}}
139+
%r = "arith.constant"() {value = "hi" : i32} : () -> i32
140+
return
141+
}
142+
143+
func.func @verify_fail_3() {
144+
// expected-error@+1 {{'arith.constant' op integer return type must be signless}}
145+
%r = "arith.constant"() {value = -3 : si32} : () -> si32
146+
return
147+
}

0 commit comments

Comments
 (0)