granite-rust/tests/ui/intrinsics/intrinsic-atomics-cc.rs

13 lines
208 B
Rust
Raw Normal View History

//@ run-pass
//@ aux-build:cci_intrinsic.rs
2012-07-24 14:55:38 -07:00
extern crate cci_intrinsic;
use cci_intrinsic::atomic_xchg_seqcst;
2012-07-24 14:55:38 -07:00
pub fn main() {
2013-08-17 08:37:42 -07:00
let mut x = 1;
atomic_xchg_seqcst(&mut x, 5);
2013-08-17 08:37:42 -07:00
assert_eq!(x, 5);
2012-07-24 14:55:38 -07:00
}