Skip to content

Commit 8e7e6b5

Browse files
committed
Add test
1 parent 07590ac commit 8e7e6b5

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

mlir/test/IR/invalid-ops.mlir

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,3 +123,23 @@ 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+
func.func @verify_fail_1() {
130+
// expected-error@+1 {{'arith.constant' op integer return type must be signless}}
131+
%r = "arith.constant"() {value = -1 : si32} : () -> si32
132+
return
133+
}
134+
135+
func.func @verify_fail_2() {
136+
// expected-error@+1 {{'arith.constant' op value must be an integer, float, or elements attribute}}
137+
%r = "arith.constant"() {value = "hi" : i32} : () -> i32
138+
return
139+
}
140+
141+
func.func @verify_fail_3() {
142+
// expected-error@+1 {{'arith.constant' op integer return type must be signless}}
143+
%r = "arith.constant"() {value = -3 : si32} : () -> si32
144+
return
145+
}

0 commit comments

Comments
 (0)