File tree 2 files changed +32
-0
lines changed
2 files changed +32
-0
lines changed Original file line number Diff line number Diff line change
1
+ #[ abi = "rust-intrinsic" ]
2
+ extern mod rusti {
3
+ fn atomic_xchng ( & dst: int , src : int ) -> int ;
4
+ fn atomic_xchng_acq ( & dst: int , src : int ) -> int ;
5
+ fn atomic_xchng_rel ( & dst: int , src : int ) -> int ;
6
+
7
+ fn atomic_add ( & dst: int , src : int ) -> int ;
8
+ fn atomic_add_acq ( & dst: int , src : int ) -> int ;
9
+ fn atomic_add_rel ( & dst: int , src : int ) -> int ;
10
+
11
+ fn atomic_sub ( & dst: int , src : int ) -> int ;
12
+ fn atomic_sub_acq ( & dst: int , src : int ) -> int ;
13
+ fn atomic_sub_rel ( & dst: int , src : int ) -> int ;
14
+ }
15
+
16
+ #[ inline( always) ]
17
+ fn atomic_xchng ( & dst: int , src : int ) -> int {
18
+ rusti:: atomic_xchng ( dst, src)
19
+ }
Original file line number Diff line number Diff line change
1
+ // xfail-fast - check-fast doesn't understand aux-build
2
+ // aux-build:cci_intrinsic.rs
3
+
4
+ // xfail-check
5
+
6
+ use cci_intrinsic;
7
+ import cci_intrinsic:: atomic_xchng;
8
+
9
+ fn main ( ) {
10
+ let mut x = 1 ;
11
+ atomic_xchng ( x, 5 ) ;
12
+ assert x == 5 ;
13
+ }
You can’t perform that action at this time.
0 commit comments