1// RUN: mlir-opt -split-input-file -allow-unregistered-dialect -verify-diagnostics %s
2
3ml_program.func @ssa_enforced(%arg0 : i32) -> i32 {
4  // expected-error @+1 {{does not dominate this use}}
5  %1 = "unregistered.dummy"(%0) : (i32) -> i32
6  // expected-note @+1 {{operand defined here}}
7  %0 = "unregistered.dummy"(%arg0) : (i32) -> i32
8  ml_program.return %0 : i32
9}
10
11// -----
12ml_program.func @return_arity_match(%arg0 : i32) -> i32 {
13  // expected-error @+1 {{enclosing function (@return_arity_match) returns 1}}
14  ml_program.return %arg0, %arg0 : i32, i32
15}
16
17// -----
18ml_program.func @return_type_match(%arg0 : i64) -> i32 {
19  // expected-error @+1 {{doesn't match function result}}
20  ml_program.return %arg0 : i64
21}
22
23// -----
24ml_program.subgraph @output_arity_match(%arg0 : i32) -> i32 {
25  // expected-error @+1 {{enclosing function (@output_arity_match) outputs 1}}
26  ml_program.output %arg0, %arg0 : i32, i32
27}
28
29// -----
30ml_program.subgraph @output_type_match(%arg0 : i64) -> i32 {
31  // expected-error @+1 {{doesn't match function result}}
32  ml_program.output %arg0 : i64
33}
34