Skip to content

Commit 474b3ec

Browse files
committed
---
yaml --- r: 22704 b: refs/heads/master c: 22e3a85 h: refs/heads/master v: v3
1 parent b9f95d6 commit 474b3ec

File tree

3 files changed

+33
-1
lines changed

3 files changed

+33
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 2040a5c632caa8b0918979c552530782ca9e4a81
2+
refs/heads/master: 22e3a8506f6d8ac9457214caf69de775c36b94ec
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: cd6f24f9d14ac90d167386a56e7a6ac1f0318195
55
refs/heads/try: ffbe0e0e00374358b789b0037bcb3a577cd218be
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
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+
}

0 commit comments

Comments
 (0)