about summary refs log tree commit diff
path: root/tests/assembly/asm/aarch64-outline-atomics.rs
blob: bcf0964b722ae37d981e0305e665a46d8469b755 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//@ assembly-output: emit-asm
//@ compile-flags: -O
//@ compile-flags: --target aarch64-unknown-linux-gnu
//@ needs-llvm-components: aarch64
//@ only-aarch64
//@ only-linux

#![crate_type = "rlib"]

use std::sync::atomic::{AtomicI32, 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);
}