2021-04-05 12:17:23 -05:00
|
|
|
//@ assembly-output: emit-asm
|
|
|
|
//@ compile-flags: -O
|
|
|
|
//@ compile-flags: --target aarch64-unknown-linux-gnu
|
|
|
|
//@ needs-llvm-components: aarch64
|
|
|
|
//@ only-aarch64
|
2021-10-14 23:19:08 -05:00
|
|
|
//@ only-linux
|
2021-04-05 12:17:23 -05:00
|
|
|
|
|
|
|
#![crate_type = "rlib"]
|
|
|
|
|
|
|
|
use std::sync::atomic::AtomicI32;
|
|
|
|
use std::sync::atomic::Ordering::*;
|
|
|
|
|
|
|
|
pub fn compare_exchange(a: &AtomicI32) {
|
|
|
|
// On AArch64 LLVM should outline atomic operations.
|
|
|
|
// CHECK: __aarch64_cas4_relax
|
|
|
|
let _ = a.compare_exchange(0, 10, Relaxed, Relaxed);
|
|
|
|
}
|