Skip to content

Commit c61e8fa

Browse files
committed
fix test suite
1 parent 2a245e0 commit c61e8fa

7 files changed

+59
-70
lines changed

src/test/incremental/issue-61530.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ extern "platform-intrinsic" {
1111

1212
fn main() {
1313
unsafe {
14-
let _: I32x2 = simd_shuffle2(I32x2(1, 2), I32x2(3, 4), [0, 0]);
15-
let _: I32x2 = simd_shuffle2(I32x2(1, 2), I32x2(3, 4), [0, 0]);
14+
const IDX: [u32; 2] = [0, 0];
15+
let _: I32x2 = simd_shuffle2(I32x2(1, 2), I32x2(3, 4), IDX);
16+
let _: I32x2 = simd_shuffle2(I32x2(1, 2), I32x2(3, 4), IDX);
1617
}
1718
}

src/test/ui/issues/issue-38074.rs

-20
This file was deleted.

src/test/ui/simd-intrinsic/simd-intrinsic-generic-elements.rs

+12-9
Original file line numberDiff line numberDiff line change
@@ -50,25 +50,28 @@ fn main() {
5050
simd_extract::<_, f32>(x, 0);
5151
//~^ ERROR expected return type `i32` (element of input `i32x4`), found `f32`
5252

53-
simd_shuffle2::<i32, i32>(0, 0, [0; 2]);
53+
const IDX2: [u32; 2] = [0; 2];
54+
simd_shuffle2::<i32, i32>(0, 0, IDX2);
5455
//~^ ERROR expected SIMD input type, found non-SIMD `i32`
55-
simd_shuffle4::<i32, i32>(0, 0, [0; 4]);
56+
const IDX4: [u32; 4] = [0; 4];
57+
simd_shuffle4::<i32, i32>(0, 0, IDX4);
5658
//~^ ERROR expected SIMD input type, found non-SIMD `i32`
57-
simd_shuffle8::<i32, i32>(0, 0, [0; 8]);
59+
const IDX8: [u32; 8] = [0; 8];
60+
simd_shuffle8::<i32, i32>(0, 0, IDX8);
5861
//~^ ERROR expected SIMD input type, found non-SIMD `i32`
5962

60-
simd_shuffle2::<_, f32x2>(x, x, [0; 2]);
63+
simd_shuffle2::<_, f32x2>(x, x, IDX2);
6164
//~^ ERROR element type `i32` (element of input `i32x4`), found `f32x2` with element type `f32`
62-
simd_shuffle4::<_, f32x4>(x, x, [0; 4]);
65+
simd_shuffle4::<_, f32x4>(x, x, IDX4);
6366
//~^ ERROR element type `i32` (element of input `i32x4`), found `f32x4` with element type `f32`
64-
simd_shuffle8::<_, f32x8>(x, x, [0; 8]);
67+
simd_shuffle8::<_, f32x8>(x, x, IDX8);
6568
//~^ ERROR element type `i32` (element of input `i32x4`), found `f32x8` with element type `f32`
6669

67-
simd_shuffle2::<_, i32x8>(x, x, [0; 2]);
70+
simd_shuffle2::<_, i32x8>(x, x, IDX2);
6871
//~^ ERROR expected return type of length 2, found `i32x8` with length 8
69-
simd_shuffle4::<_, i32x8>(x, x, [0; 4]);
72+
simd_shuffle4::<_, i32x8>(x, x, IDX4);
7073
//~^ ERROR expected return type of length 4, found `i32x8` with length 8
71-
simd_shuffle8::<_, i32x2>(x, x, [0; 8]);
74+
simd_shuffle8::<_, i32x2>(x, x, IDX8);
7275
//~^ ERROR expected return type of length 8, found `i32x2` with length 2
7376
}
7477
}

src/test/ui/simd-intrinsic/simd-intrinsic-generic-elements.stderr

+27-27
Original file line numberDiff line numberDiff line change
@@ -17,58 +17,58 @@ LL | simd_extract::<_, f32>(x, 0);
1717
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1818

1919
error[E0511]: invalid monomorphization of `simd_shuffle2` intrinsic: expected SIMD input type, found non-SIMD `i32`
20-
--> $DIR/simd-intrinsic-generic-elements.rs:53:9
20+
--> $DIR/simd-intrinsic-generic-elements.rs:54:9
2121
|
22-
LL | simd_shuffle2::<i32, i32>(0, 0, [0; 2]);
23-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
22+
LL | simd_shuffle2::<i32, i32>(0, 0, IDX2);
23+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2424

2525
error[E0511]: invalid monomorphization of `simd_shuffle4` intrinsic: expected SIMD input type, found non-SIMD `i32`
26-
--> $DIR/simd-intrinsic-generic-elements.rs:55:9
26+
--> $DIR/simd-intrinsic-generic-elements.rs:57:9
2727
|
28-
LL | simd_shuffle4::<i32, i32>(0, 0, [0; 4]);
29-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
28+
LL | simd_shuffle4::<i32, i32>(0, 0, IDX4);
29+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3030

3131
error[E0511]: invalid monomorphization of `simd_shuffle8` intrinsic: expected SIMD input type, found non-SIMD `i32`
32-
--> $DIR/simd-intrinsic-generic-elements.rs:57:9
32+
--> $DIR/simd-intrinsic-generic-elements.rs:60:9
3333
|
34-
LL | simd_shuffle8::<i32, i32>(0, 0, [0; 8]);
35-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
34+
LL | simd_shuffle8::<i32, i32>(0, 0, IDX8);
35+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3636

3737
error[E0511]: invalid monomorphization of `simd_shuffle2` intrinsic: expected return element type `i32` (element of input `i32x4`), found `f32x2` with element type `f32`
38-
--> $DIR/simd-intrinsic-generic-elements.rs:60:9
38+
--> $DIR/simd-intrinsic-generic-elements.rs:63:9
3939
|
40-
LL | simd_shuffle2::<_, f32x2>(x, x, [0; 2]);
41-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
40+
LL | simd_shuffle2::<_, f32x2>(x, x, IDX2);
41+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4242

4343
error[E0511]: invalid monomorphization of `simd_shuffle4` intrinsic: expected return element type `i32` (element of input `i32x4`), found `f32x4` with element type `f32`
44-
--> $DIR/simd-intrinsic-generic-elements.rs:62:9
44+
--> $DIR/simd-intrinsic-generic-elements.rs:65:9
4545
|
46-
LL | simd_shuffle4::<_, f32x4>(x, x, [0; 4]);
47-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
46+
LL | simd_shuffle4::<_, f32x4>(x, x, IDX4);
47+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4848

4949
error[E0511]: invalid monomorphization of `simd_shuffle8` intrinsic: expected return element type `i32` (element of input `i32x4`), found `f32x8` with element type `f32`
50-
--> $DIR/simd-intrinsic-generic-elements.rs:64:9
50+
--> $DIR/simd-intrinsic-generic-elements.rs:67:9
5151
|
52-
LL | simd_shuffle8::<_, f32x8>(x, x, [0; 8]);
53-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
52+
LL | simd_shuffle8::<_, f32x8>(x, x, IDX8);
53+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5454

5555
error[E0511]: invalid monomorphization of `simd_shuffle2` intrinsic: expected return type of length 2, found `i32x8` with length 8
56-
--> $DIR/simd-intrinsic-generic-elements.rs:67:9
56+
--> $DIR/simd-intrinsic-generic-elements.rs:70:9
5757
|
58-
LL | simd_shuffle2::<_, i32x8>(x, x, [0; 2]);
59-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
58+
LL | simd_shuffle2::<_, i32x8>(x, x, IDX2);
59+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6060

6161
error[E0511]: invalid monomorphization of `simd_shuffle4` intrinsic: expected return type of length 4, found `i32x8` with length 8
62-
--> $DIR/simd-intrinsic-generic-elements.rs:69:9
62+
--> $DIR/simd-intrinsic-generic-elements.rs:72:9
6363
|
64-
LL | simd_shuffle4::<_, i32x8>(x, x, [0; 4]);
65-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
64+
LL | simd_shuffle4::<_, i32x8>(x, x, IDX4);
65+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6666

6767
error[E0511]: invalid monomorphization of `simd_shuffle8` intrinsic: expected return type of length 8, found `i32x2` with length 2
68-
--> $DIR/simd-intrinsic-generic-elements.rs:71:9
68+
--> $DIR/simd-intrinsic-generic-elements.rs:74:9
6969
|
70-
LL | simd_shuffle8::<_, i32x2>(x, x, [0; 8]);
71-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
70+
LL | simd_shuffle8::<_, i32x2>(x, x, IDX8);
71+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
7272

7373
error: aborting due to 12 previous errors
7474

src/test/ui/simd-intrinsic/simd-intrinsic-inlining-issue67557-ice.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,6 @@ fn main() {
2121

2222
#[inline(always)]
2323
unsafe fn inline_me() -> Simd2 {
24-
simd_shuffle2(Simd2(10, 11), Simd2(12, 13), [0, 3])
24+
const IDX: [u32; 2] = [0, 3];
25+
simd_shuffle2(Simd2(10, 11), Simd2(12, 13), IDX)
2526
}

src/test/ui/simd-intrinsic/simd-intrinsic-inlining-issue67557.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ struct Simd2(u8, u8);
1515

1616
fn main() {
1717
unsafe {
18-
let p_res: Simd2 = simd_shuffle2(Simd2(10, 11), Simd2(12, 13), [0, 1]);
18+
const IDX: [u32; 2] = [0, 1];
19+
let p_res: Simd2 = simd_shuffle2(Simd2(10, 11), Simd2(12, 13), IDX);
1920
let a_res: Simd2 = inline_me();
2021

2122
assert_10_11(p_res);
@@ -36,5 +37,6 @@ fn assert_10_13(x: Simd2) {
3637

3738
#[inline(always)]
3839
unsafe fn inline_me() -> Simd2 {
39-
simd_shuffle2(Simd2(10, 11), Simd2(12, 13), [0, 3])
40+
const IDX: [u32; 2] = [0, 3];
41+
simd_shuffle2(Simd2(10, 11), Simd2(12, 13), IDX)
4042
}

src/test/ui/simd/simd-intrinsic-generic-elements.rs

+11-9
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
// ignore-emscripten FIXME(#45351) hits an LLVM assert
33

44
#![feature(repr_simd, platform_intrinsics)]
5+
#![allow(incomplete_features)]
6+
#![feature(inline_const)]
57

68
#[repr(simd)]
79
#[derive(Copy, Clone, Debug, PartialEq)]
@@ -82,19 +84,19 @@ fn main() {
8284
let y4 = i32x4(140, 141, 142, 143);
8385
let y8 = i32x8(180, 181, 182, 183, 184, 185, 186, 187);
8486
unsafe {
85-
all_eq!(simd_shuffle2(x2, y2, [3, 0]), i32x2(121, 20));
86-
all_eq!(simd_shuffle4(x2, y2, [3, 0, 1, 2]), i32x4(121, 20, 21, 120));
87-
all_eq!(simd_shuffle8(x2, y2, [3, 0, 1, 2, 1, 2, 3, 0]),
87+
all_eq!(simd_shuffle2(x2, y2, const { [3u32, 0] }), i32x2(121, 20));
88+
all_eq!(simd_shuffle4(x2, y2, const { [3u32, 0, 1, 2] }), i32x4(121, 20, 21, 120));
89+
all_eq!(simd_shuffle8(x2, y2, const { [3u32, 0, 1, 2, 1, 2, 3, 0] }),
8890
i32x8(121, 20, 21, 120, 21, 120, 121, 20));
8991

90-
all_eq!(simd_shuffle2(x4, y4, [7, 2]), i32x2(143, 42));
91-
all_eq!(simd_shuffle4(x4, y4, [7, 2, 5, 0]), i32x4(143, 42, 141, 40));
92-
all_eq!(simd_shuffle8(x4, y4, [7, 2, 5, 0, 3, 6, 4, 1]),
92+
all_eq!(simd_shuffle2(x4, y4, const { [7u32, 2] }), i32x2(143, 42));
93+
all_eq!(simd_shuffle4(x4, y4, const { [7u32, 2, 5, 0] }), i32x4(143, 42, 141, 40));
94+
all_eq!(simd_shuffle8(x4, y4, const { [7u32, 2, 5, 0, 3, 6, 4, 1] }),
9395
i32x8(143, 42, 141, 40, 43, 142, 140, 41));
9496

95-
all_eq!(simd_shuffle2(x8, y8, [11, 5]), i32x2(183, 85));
96-
all_eq!(simd_shuffle4(x8, y8, [11, 5, 15, 0]), i32x4(183, 85, 187, 80));
97-
all_eq!(simd_shuffle8(x8, y8, [11, 5, 15, 0, 3, 8, 12, 1]),
97+
all_eq!(simd_shuffle2(x8, y8, const { [11u32, 5] }), i32x2(183, 85));
98+
all_eq!(simd_shuffle4(x8, y8, const { [11u32, 5, 15, 0] }), i32x4(183, 85, 187, 80));
99+
all_eq!(simd_shuffle8(x8, y8, const { [11u32, 5, 15, 0, 3, 8, 12, 1] }),
98100
i32x8(183, 85, 187, 80, 83, 180, 184, 81));
99101
}
100102

0 commit comments

Comments
 (0)