2018-08-30 14:18:55 +02:00
|
|
|
//@ run-pass
|
2012-07-24 14:55:38 -07:00
|
|
|
//@ aux-build:cci_intrinsic.rs
|
|
|
|
|
2015-03-22 13:13:15 -07:00
|
|
|
|
2014-02-14 10:10:06 -08:00
|
|
|
extern crate cci_intrinsic;
|
2022-06-22 13:02:23 +02:00
|
|
|
use cci_intrinsic::atomic_xchg_seqcst;
|
2012-07-24 14:55:38 -07:00
|
|
|
|
2013-02-01 19:43:17 -08:00
|
|
|
pub fn main() {
|
2013-08-17 08:37:42 -07:00
|
|
|
let mut x = 1;
|
2022-06-22 13:02:23 +02:00
|
|
|
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
|
|
|
}
|