1// RUN: mlir-opt -split-input-file %s -verify-diagnostics
2
3func.func @complex_constant_wrong_array_attribute_length() {
4  // expected-error @+1 {{requires 'value' to be a complex constant, represented as array of two values}}
5  %0 = complex.constant [1.0 : f32] : complex<f32>
6  return
7}
8
9// -----
10
11func.func @complex_constant_wrong_element_types() {
12  // expected-error @+1 {{requires attribute's element types ('f32', 'f32') to match the element type of the op's return type ('f64')}}
13  %0 = complex.constant [1.0 : f32, -1.0 : f32] : complex<f64>
14  return
15}
16
17// -----
18
19func.func @complex_constant_two_different_element_types() {
20  // expected-error @+1 {{requires attribute's element types ('f32', 'f64') to match the element type of the op's return type ('f64')}}
21  %0 = complex.constant [1.0 : f32, -1.0 : f64] : complex<f64>
22  return
23}
24