diff options
| author | Ralf Jung <post@ralfj.de> | 2025-07-19 23:23:40 +0200 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2025-07-23 08:32:55 +0200 |
| commit | de1b999ff6c981475e4491ea2fff1851655587e5 (patch) | |
| tree | 647955d91fcfb7337489f4c4fd4c8226e948aab6 /tests/codegen-llvm | |
| parent | efcae7d31d30ba8d8c806fbb8dea634e78d7b969 (diff) | |
| download | rust-de1b999ff6c981475e4491ea2fff1851655587e5.tar.gz rust-de1b999ff6c981475e4491ea2fff1851655587e5.zip | |
atomicrmw on pointers: move integer-pointer cast hacks into backend
Diffstat (limited to 'tests/codegen-llvm')
| -rw-r--r-- | tests/codegen-llvm/atomicptr.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/codegen-llvm/atomicptr.rs b/tests/codegen-llvm/atomicptr.rs index 4819af40ca2..ce6c4aa0d2b 100644 --- a/tests/codegen-llvm/atomicptr.rs +++ b/tests/codegen-llvm/atomicptr.rs @@ -1,5 +1,5 @@ // LLVM does not support some atomic RMW operations on pointers, so inside codegen we lower those -// to integer atomics, surrounded by casts to and from integer type. +// to integer atomics, followed by an inttoptr cast. // This test ensures that we do the round-trip correctly for AtomicPtr::fetch_byte_add, and also // ensures that we do not have such a round-trip for AtomicPtr::swap, because LLVM supports pointer // arguments to `atomicrmw xchg`. @@ -20,8 +20,8 @@ pub fn helper(_: usize) {} // CHECK-LABEL: @atomicptr_fetch_byte_add #[no_mangle] pub fn atomicptr_fetch_byte_add(a: &AtomicPtr<u8>, v: usize) -> *mut u8 { - // CHECK: %[[INTPTR:.*]] = ptrtoint ptr %{{.*}} to [[USIZE]] - // CHECK-NEXT: %[[RET:.*]] = atomicrmw add ptr %{{.*}}, [[USIZE]] %[[INTPTR]] + // CHECK: llvm.lifetime.start + // CHECK-NEXT: %[[RET:.*]] = atomicrmw add ptr %{{.*}}, [[USIZE]] %v // CHECK-NEXT: inttoptr [[USIZE]] %[[RET]] to ptr a.fetch_byte_add(v, Relaxed) } |
