Skip to content

Commit 5cfdb67

Browse files
committed
move them to the correct place
1 parent a676ecd commit 5cfdb67

File tree

2 files changed

+25
-24
lines changed

2 files changed

+25
-24
lines changed

mlir/test/Dialect/LLVMIR/invalid.mlir

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,31 @@ llvm.func @scalable_vec_requires_splat() -> vector<[4]xf64> {
439439
llvm.return %0 : vector<[4]xf64>
440440
}
441441

442+
443+
// -----
444+
445+
llvm.func @integer_with_float_type() -> f32 {
446+
// expected-error @+1 {{expected integer type}}
447+
%0 = llvm.mlir.constant(1 : index) : f32
448+
llvm.return %0 : f32
449+
}
450+
451+
// -----
452+
453+
llvm.func @incompatible_float_attribute_type() -> f32 {
454+
// expected-error @below{{expected float type of width 64}}
455+
%cst = llvm.mlir.constant(1.0 : f64) : f32
456+
llvm.return %cst : f32
457+
}
458+
459+
// -----
460+
461+
llvm.func @incompatible_integer_type_for_float_attr() -> i32 {
462+
// expected-error @below{{expected integer type of width 16}}
463+
%cst = llvm.mlir.constant(1.0 : f16) : i32
464+
llvm.return %cst : i32
465+
}
466+
442467
// -----
443468

444469
func.func @insertvalue_non_llvm_type(%a : i32, %b : i32) {

mlir/test/Target/LLVMIR/llvmir-invalid.mlir

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -55,30 +55,6 @@ llvm.func @struct_wrong_attribute_element_type() -> !llvm.struct<(f64, f64)> {
5555

5656
// -----
5757

58-
llvm.func @integer_with_float_type() -> f32 {
59-
// expected-error @+1 {{expected integer type}}
60-
%0 = llvm.mlir.constant(1 : index) : f32
61-
llvm.return %0 : f32
62-
}
63-
64-
// -----
65-
66-
llvm.func @incompatible_float_attribute_type() -> f32 {
67-
// expected-error @below{{expected float type of width 64}}
68-
%cst = llvm.mlir.constant(1.0 : f64) : f32
69-
llvm.return %cst : f32
70-
}
71-
72-
// -----
73-
74-
llvm.func @incompatible_integer_type_for_float_attr() -> i32 {
75-
// expected-error @below{{expected integer type of width 16}}
76-
%cst = llvm.mlir.constant(1.0 : f16) : i32
77-
llvm.return %cst : i32
78-
}
79-
80-
// -----
81-
8258
// expected-error @below{{LLVM attribute 'readonly' does not expect a value}}
8359
llvm.func @passthrough_unexpected_value() attributes {passthrough = [["readonly", "42"]]}
8460

0 commit comments

Comments
 (0)