Files
clang-p2996/mlir/test/Dialect/Complex/attribute.mlir
Adrian Kuegel 23c3eb7cdf [mlir][Complex] Change complex.number attribute type to ComplexType.
It is more useful to use ComplexType as type of the attribute than to
use the element type as attribute type. This means when using this
attribute in complex::ConstantOp, we just need to check whether
the types match.

Reviewed By: pifon2a

Differential Revision: https://reviews.llvm.org/D130703
2022-07-28 21:25:12 +02:00

20 lines
523 B
MLIR

// RUN: mlir-opt %s -split-input-file -allow-unregistered-dialect -verify-diagnostics | FileCheck %s
func.func @number_attr_f64() {
"test.number_attr"() {
// CHECK: attr = #complex.number<:f64 1.000000e+00, 0.000000e+00> : complex<f64>
attr = #complex.number<:f64 1.0, 0.0>
} : () -> ()
return
}
func.func @number_attr_f32() {
"test.number_attr"() {
// CHECK: attr = #complex.number<:f32 1.000000e+00, 0.000000e+00> : complex<f32>
attr = #complex.number<:f32 1.0, 0.0>
} : () -> ()
return
}