mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-30 18:53:39 +00:00
Test case for #3005
This commit is contained in:
parent
2040a5c632
commit
22e3a8506f
19
src/test/auxiliary/cci_intrinsic.rs
Normal file
19
src/test/auxiliary/cci_intrinsic.rs
Normal 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)
|
||||
}
|
13
src/test/run-pass/intrinsic-atomics-cc.rs
Normal file
13
src/test/run-pass/intrinsic-atomics-cc.rs
Normal 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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user