File tree Expand file tree Collapse file tree 2 files changed +28
-1
lines changed
branches/try/src/test/run-pass Expand file tree Collapse file tree 2 files changed +28
-1
lines changed Original file line number Diff line number Diff line change 2
2
refs/heads/master: 61b1875c16de39c166b0f4d54bba19f9c6777d1a
3
3
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4
4
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
5
- refs/heads/try: a393fb32211f66cd33b1b0c6cad1991ebd8fae01
5
+ refs/heads/try: 3f4872f03284f4737675a68438350dd2958db229
6
6
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
Original file line number Diff line number Diff line change
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 == 1 u {
8
+ data
9
+ } else {
10
+ count ( data - 1 u) + count ( data - 1 u)
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 ( 10 u) { ||
21
+ task:: spawn { ||
22
+ let result = count ( 5 u) ;
23
+ #debug ( "result = %?" , result) ;
24
+ assert result == 16 u;
25
+ } ;
26
+ }
27
+ }
You can’t perform that action at this time.
0 commit comments