Skip to content

Commit d42d20d

Browse files
tests: simplify dont-shuffle-bswaps test
This should guarantee it tests what we want it to test and no more.
1 parent 3580698 commit d42d20d

File tree

1 file changed

+8
-30
lines changed

1 file changed

+8
-30
lines changed

tests/codegen/dont-shuffle-bswaps.rs

+8-30
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
1-
//@ revisions: OPT2 OPT3WINX64 OPT3LINX64
2-
//@ [OPT2] compile-flags: -O
3-
//@ [OPT3LINX64] compile-flags: -C opt-level=3
4-
//@ [OPT3WINX64] compile-flags: -C opt-level=3
5-
//@ [OPT3LINX64] only-linux
6-
//@ [OPT3WINX64] only-windows
7-
//@ [OPT3LINX64] only-x86_64
8-
//@ [OPT3WINX64] only-x86_64
1+
//@ revisions: OPT2 OPT3
2+
//@[OPT2] compile-flags: -Copt-level=2
3+
//@[OPT3] compile-flags: -C opt-level=3
94
//@ min-llvm-version: 18.1.3
105

116
#![crate_type = "lib"]
@@ -16,28 +11,11 @@
1611
// to avoid complicating the code.
1712
// CHECK-LABEL: define{{.*}}void @convert(
1813
// CHECK-NOT: shufflevector
19-
// OPT2: store i16
20-
// OPT2-NEXT: getelementptr inbounds{{( nuw)?}} i8, {{.+}} 2
21-
// OPT2-NEXT: store i16
22-
// OPT2-NEXT: getelementptr inbounds{{( nuw)?}} i8, {{.+}} 4
23-
// OPT2-NEXT: store i16
24-
// OPT2-NEXT: getelementptr inbounds{{( nuw)?}} i8, {{.+}} 6
25-
// OPT2-NEXT: store i16
26-
// OPT2-NEXT: getelementptr inbounds{{( nuw)?}} i8, {{.+}} 8
27-
// OPT2-NEXT: store i16
28-
// OPT2-NEXT: getelementptr inbounds{{( nuw)?}} i8, {{.+}} 10
29-
// OPT2-NEXT: store i16
30-
// OPT2-NEXT: getelementptr inbounds{{( nuw)?}} i8, {{.+}} 12
31-
// OPT2-NEXT: store i16
32-
// OPT2-NEXT: getelementptr inbounds{{( nuw)?}} i8, {{.+}} 14
33-
// OPT2-NEXT: store i16
34-
// OPT3LINX64: load <8 x i16>
35-
// OPT3LINX64-NEXT: call <8 x i16> @llvm.bswap
36-
// OPT3LINX64-NEXT: store <8 x i16>
37-
// OPT3WINX64: load <8 x i16>
38-
// OPT3WINX64-NEXT: call <8 x i16> @llvm.bswap
39-
// OPT3WINX64-NEXT: store <8 x i16>
40-
// CHECK-NEXT: ret void
14+
// On higher opt levels, this should just be a bswap:
15+
// OPT3: load <8 x i16>
16+
// OPT3-NEXT: call <8 x i16> @llvm.bswap
17+
// OPT3-NEXT: store <8 x i16>
18+
// OPT3-NEXT: ret void
4119
#[no_mangle]
4220
pub fn convert(value: [u16; 8]) -> [u8; 16] {
4321
#[cfg(target_endian = "little")]

0 commit comments

Comments
 (0)