File tree Expand file tree Collapse file tree 2 files changed +43
-3
lines changed Expand file tree Collapse file tree 2 files changed +43
-3
lines changed Original file line number Diff line number Diff line change 7
7
// See the hack in upcall_call_shim_on_c_stack where it messes
8
8
// with the stack limit.
9
9
10
+ use std;
11
+
10
12
native mod rustrt {
13
+ fn set_min_stack ( size : uint ) ;
11
14
fn pin_task ( ) ;
12
15
}
13
16
@@ -26,10 +29,13 @@ resource and_then_get_big_again(_i: ()) {
26
29
getbig ( i - 1 ) ;
27
30
}
28
31
}
29
- getbig ( 100000 ) ;
32
+ getbig ( 10000 ) ;
30
33
}
31
34
32
35
fn main ( ) {
33
- let r = and_then_get_big_again ( ( ) ) ;
34
- getbig_call_c_and_fail ( 100000 ) ;
36
+ rustrt:: set_min_stack ( 256 u) ;
37
+ std:: task:: spawn ( ( ) , fn ( & & _i : ( ) ) {
38
+ let r = and_then_get_big_again ( ( ) ) ;
39
+ getbig_call_c_and_fail ( 10000 ) ;
40
+ } ) ;
35
41
}
Original file line number Diff line number Diff line change
1
+ // xfail-test
2
+ // error-pattern:explicit failure
3
+ // compile-flags:--stack-growth
4
+
5
+ // Just testing unwinding
6
+
7
+ use std;
8
+
9
+ native mod rustrt {
10
+ fn set_min_stack ( size : uint ) ;
11
+ }
12
+
13
+ fn getbig_and_fail ( & & i: int ) {
14
+ let r = and_then_get_big_again ( @0 ) ;
15
+ if i != 0 {
16
+ getbig_and_fail ( i - 1 ) ;
17
+ } else {
18
+ fail;
19
+ }
20
+ }
21
+
22
+ resource and_then_get_big_again ( _i: @int) {
23
+ fn getbig ( i : int ) {
24
+ if i != 0 {
25
+ getbig ( i - 1 ) ;
26
+ }
27
+ }
28
+ getbig ( 1000 ) ;
29
+ }
30
+
31
+ fn main ( ) {
32
+ rustrt:: set_min_stack ( 256 u) ;
33
+ std:: task:: spawn ( 1000 , getbig_and_fail) ;
34
+ }
You can’t perform that action at this time.
0 commit comments