Test case for #3005

This commit is contained in:
Eric Holk 2012-07-24 14:55:38 -07:00
parent 2040a5c632
commit 22e3a8506f
2 changed files with 32 additions and 0 deletions

View file

@ -0,0 +1,19 @@
#[abi = "rust-intrinsic"]
extern mod rusti {
fn atomic_xchng(&dst: int, src: int) -> int;
fn atomic_xchng_acq(&dst: int, src: int) -> int;
fn atomic_xchng_rel(&dst: int, src: int) -> int;
fn atomic_add(&dst: int, src: int) -> int;
fn atomic_add_acq(&dst: int, src: int) -> int;
fn atomic_add_rel(&dst: int, src: int) -> int;
fn atomic_sub(&dst: int, src: int) -> int;
fn atomic_sub_acq(&dst: int, src: int) -> int;
fn atomic_sub_rel(&dst: int, src: int) -> int;
}
#[inline(always)]
fn atomic_xchng(&dst: int, src: int) -> int {
rusti::atomic_xchng(dst, src)
}

View file

@ -0,0 +1,13 @@
// xfail-fast - check-fast doesn't understand aux-build
// aux-build:cci_intrinsic.rs
// xfail-check
use cci_intrinsic;
import cci_intrinsic::atomic_xchng;
fn main() {
let mut x = 1;
atomic_xchng(x, 5);
assert x == 5;
}