mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 23:04:33 +00:00
Directly use volatile_load intrinsic
This makes the test work if libstd is compiled with debug assertions.
This commit is contained in:
parent
7a0415ce37
commit
ce2d91dccd
@ -8,6 +8,8 @@
|
||||
// CHECK: %ScalarPair = type { i32, [3 x i32], i128 }
|
||||
// CHECK: %Struct = type { i32, i32, [2 x i32], i128 }
|
||||
|
||||
#![feature(core_intrinsics)]
|
||||
|
||||
#[repr(C)]
|
||||
#[derive(Clone, Copy)]
|
||||
pub struct ScalarPair {
|
||||
@ -59,7 +61,7 @@ pub fn load_volatile(x: &ScalarPair) -> ScalarPair {
|
||||
// CHECK-NEXT: [[A:%.*]] = load i32, ptr [[TMP]], align 16
|
||||
// CHECK-NEXT: [[GEP:%.*]] = getelementptr inbounds i8, ptr [[TMP]], i64 16
|
||||
// CHECK-NEXT: [[B:%.*]] = load i128, ptr [[GEP]], align 16
|
||||
unsafe { std::ptr::read_volatile(x) }
|
||||
unsafe { std::intrinsics::volatile_load(x) }
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
|
Loading…
Reference in New Issue
Block a user