Skip to content

Commit ebad7e8

Browse files
committed
---
yaml --- r: 14294 b: refs/heads/try c: 3f4872f h: refs/heads/master v: v3
1 parent 029ed82 commit ebad7e8

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
refs/heads/master: 61b1875c16de39c166b0f4d54bba19f9c6777d1a
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
5-
refs/heads/try: a393fb32211f66cd33b1b0c6cad1991ebd8fae01
5+
refs/heads/try: 3f4872f03284f4737675a68438350dd2958db229
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
native mod rustrt {
2+
fn rust_dbg_call(cb: *u8,
3+
data: ctypes::uintptr_t) -> ctypes::uintptr_t;
4+
}
5+
6+
crust fn cb(data: ctypes::uintptr_t) -> ctypes::uintptr_t {
7+
if data == 1u {
8+
data
9+
} else {
10+
count(data - 1u) + count(data - 1u)
11+
}
12+
}
13+
14+
fn count(n: uint) -> uint {
15+
task::yield();
16+
rustrt::rust_dbg_call(cb, n)
17+
}
18+
19+
fn main() {
20+
iter::repeat(10u) {||
21+
task::spawn {||
22+
let result = count(5u);
23+
#debug("result = %?", result);
24+
assert result == 16u;
25+
};
26+
}
27+
}

0 commit comments

Comments
 (0)