Skip to content

Commit 5663bb3

Browse files
committed
Add test for issue rust-lang#85872
This has been fixed by the LLVM 15 upgrade, add a codegen test. Fixes rust-lang#85872.
1 parent 0631ea5 commit 5663bb3

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// min-llvm-version: 15.0.0
2+
// compile-flags: -O
3+
4+
#![crate_type = "lib"]
5+
6+
#[no_mangle]
7+
pub fn u16_be_to_arch(mut data: [u8; 2]) -> [u8; 2] {
8+
// CHECK-LABEL: @u16_be_to_arch
9+
// CHECK: @llvm.bswap.i16
10+
data.reverse();
11+
data
12+
}
13+
14+
#[no_mangle]
15+
pub fn u32_be_to_arch(mut data: [u8; 4]) -> [u8; 4] {
16+
// CHECK-LABEL: @u32_be_to_arch
17+
// CHECK: @llvm.bswap.i32
18+
data.reverse();
19+
data
20+
}

0 commit comments

Comments
 (0)