diff options
Diffstat (limited to 'mlir/test/Target/LLVMIR/llvmir-invalid.mlir')
-rw-r--r-- | mlir/test/Target/LLVMIR/llvmir-invalid.mlir | 72 |
1 files changed, 0 insertions, 72 deletions
diff --git a/mlir/test/Target/LLVMIR/llvmir-invalid.mlir b/mlir/test/Target/LLVMIR/llvmir-invalid.mlir index a8ef401..b09ceee 100644 --- a/mlir/test/Target/LLVMIR/llvmir-invalid.mlir +++ b/mlir/test/Target/LLVMIR/llvmir-invalid.mlir @@ -7,78 +7,6 @@ func.func @foo() { // ----- -llvm.func @vector_with_non_vector_type() -> f32 { - // expected-error @below{{expected vector or array type}} - %cst = llvm.mlir.constant(dense<100.0> : vector<1xf64>) : f32 - llvm.return %cst : f32 -} - -// ----- - -llvm.func @non_array_attr_for_struct() -> !llvm.array<2 x array<2 x array<2 x struct<(i32)>>>> { - // expected-error @below{{expected an array attribute for a struct constant}} - %0 = llvm.mlir.constant(dense<[[[1, 2], [3, 4]], [[42, 43], [44, 45]]]> : tensor<2x2x2xi32>) : !llvm.array<2 x array<2 x array<2 x struct<(i32)>>>> - llvm.return %0 : !llvm.array<2 x array<2 x array<2 x struct<(i32)>>>> -} - -// ----- - -llvm.func @non_array_attr_for_struct() -> !llvm.array<2 x array<2 x array<2 x struct<(i32, i32, i32)>>>> { - // expected-error @below{{expected an array attribute for a struct constant}} - %0 = llvm.mlir.constant(dense<[[[1, 2], [3, 4]], [[42, 43], [44, 45]]]> : tensor<2x2x2xi32>) : !llvm.array<2 x array<2 x array<2 x struct<(i32, i32, i32)>>>> - llvm.return %0 : !llvm.array<2 x array<2 x array<2 x struct<(i32, i32, i32)>>>> -} - -// ----- - -llvm.func @invalid_struct_element_type() -> !llvm.struct<(f64, array<2 x i32>)> { - // expected-error @below{{expected struct element types to be floating point type or integer type}} - %0 = llvm.mlir.constant([1.0 : f64, dense<[1, 2]> : tensor<2xi32>]) : !llvm.struct<(f64, array<2 x i32>)> - llvm.return %0 : !llvm.struct<(f64, array<2 x i32>)> -} - -// ----- - -llvm.func @wrong_struct_element_attr_type() -> !llvm.struct<(f64, f64)> { - // expected-error @below{{expected struct element attribute types to be floating point type or integer type}} - %0 = llvm.mlir.constant([dense<[1, 2]> : tensor<2xi32>, 2.0 : f64]) : !llvm.struct<(f64, f64)> - llvm.return %0 : !llvm.struct<(f64, f64)> -} - -// ----- - -llvm.func @struct_wrong_attribute_element_type() -> !llvm.struct<(f64, f64)> { - // expected-error @below{{struct element at index 0 is of wrong type}} - %0 = llvm.mlir.constant([1.0 : f32, 1.0 : f32]) : !llvm.struct<(f64, f64)> - llvm.return %0 : !llvm.struct<(f64, f64)> -} - -// ----- - -llvm.func @integer_with_float_type() -> f32 { - // expected-error @+1 {{expected integer type}} - %0 = llvm.mlir.constant(1 : index) : f32 - llvm.return %0 : f32 -} - -// ----- - -llvm.func @incompatible_float_attribute_type() -> f32 { - // expected-error @below{{expected float type of width 64}} - %cst = llvm.mlir.constant(1.0 : f64) : f32 - llvm.return %cst : f32 -} - -// ----- - -llvm.func @incompatible_integer_type_for_float_attr() -> i32 { - // expected-error @below{{expected integer type of width 16}} - %cst = llvm.mlir.constant(1.0 : f16) : i32 - llvm.return %cst : i32 -} - -// ----- - // expected-error @below{{LLVM attribute 'readonly' does not expect a value}} llvm.func @passthrough_unexpected_value() attributes {passthrough = [["readonly", "42"]]} |