diff options
| author | Nikita Popov <npopov@redhat.com> | 2024-01-19 09:28:42 +0100 |
|---|---|---|
| committer | Nikita Popov <npopov@redhat.com> | 2024-01-19 10:52:01 +0100 |
| commit | ce2d91dccd48b1adc7224993829394682fd5ce19 (patch) | |
| tree | 441fe79a03fa5d65455da157dc1b77c4b00b6644 | |
| parent | 7a0415ce3728cb29e313429118cd113405273745 (diff) | |
| download | rust-ce2d91dccd48b1adc7224993829394682fd5ce19.tar.gz rust-ce2d91dccd48b1adc7224993829394682fd5ce19.zip | |
Directly use volatile_load intrinsic
This makes the test work if libstd is compiled with debug assertions.
| -rw-r--r-- | tests/codegen/i128-x86-align.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/codegen/i128-x86-align.rs b/tests/codegen/i128-x86-align.rs index ef1313ddb67..aaf5785dc9f 100644 --- a/tests/codegen/i128-x86-align.rs +++ b/tests/codegen/i128-x86-align.rs @@ -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] |
