rust/src/test/auxiliary/cci_intrinsic.rs
2012-08-23 17:19:35 -04:00

20 lines
652 B
Rust

#[abi = "rust-intrinsic"]
extern mod rusti {
fn atomic_xchg(dst: &mut int, src: int) -> int;
fn atomic_xchg_acq(dst: &mut int, src: int) -> int;
fn atomic_xchg_rel(dst: &mut int, src: int) -> int;
fn atomic_xadd(dst: &mut int, src: int) -> int;
fn atomic_xadd_acq(dst: &mut int, src: int) -> int;
fn atomic_xadd_rel(dst: &mut int, src: int) -> int;
fn atomic_xsub(dst: &mut int, src: int) -> int;
fn atomic_xsub_acq(dst: &mut int, src: int) -> int;
fn atomic_xsub_rel(dst: &mut int, src: int) -> int;
}
#[inline(always)]
fn atomic_xchg(dst: &mut int, src: int) -> int {
rusti::atomic_xchg(dst, src)
}