]> git.lizzy.rs Git - rust.git/blob - tests/assembly/asm/aarch64-outline-atomics.rs
Rollup merge of #106855 - klensy:rd-s, r=notriddle
[rust.git] / tests / assembly / asm / aarch64-outline-atomics.rs
1 // assembly-output: emit-asm
2 // compile-flags: -O
3 // compile-flags: --target aarch64-unknown-linux-gnu
4 // needs-llvm-components: aarch64
5 // only-aarch64
6 // only-linux
7
8 #![crate_type = "rlib"]
9
10 use std::sync::atomic::{AtomicI32, Ordering::*};
11
12 pub fn compare_exchange(a: &AtomicI32) {
13     // On AArch64 LLVM should outline atomic operations.
14     // CHECK: __aarch64_cas4_relax
15     let _ = a.compare_exchange(0, 10, Relaxed, Relaxed);
16 }