]> git.lizzy.rs Git - rust.git/blob - src/test/debug-info/borrowed-struct.rs
Ignore tests broken by failing on ICE
[rust.git] / src / test / debug-info / borrowed-struct.rs
1 // Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
4 //
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
10
11 // ignore-android: FIXME(#10381)
12
13 // compile-flags:-g
14 // debugger:rbreak zzz
15 // debugger:run
16 // debugger:finish
17
18 // debugger:print *stack_val_ref
19 // check:$1 = {x = 10, y = 23.5}
20
21 // debugger:print *stack_val_interior_ref_1
22 // check:$2 = 10
23
24 // debugger:print *stack_val_interior_ref_2
25 // check:$3 = 23.5
26
27 // debugger:print *ref_to_unnamed
28 // check:$4 = {x = 11, y = 24.5}
29
30 // debugger:print *managed_val_ref
31 // check:$5 = {x = 12, y = 25.5}
32
33 // debugger:print *managed_val_interior_ref_1
34 // check:$6 = 12
35
36 // debugger:print *managed_val_interior_ref_2
37 // check:$7 = 25.5
38
39 // debugger:print *unique_val_ref
40 // check:$8 = {x = 13, y = 26.5}
41
42 // debugger:print *unique_val_interior_ref_1
43 // check:$9 = 13
44
45 // debugger:print *unique_val_interior_ref_2
46 // check:$10 = 26.5
47
48 #![feature(managed_boxes)]
49 #![allow(unused_variable)]
50
51 struct SomeStruct {
52     x: int,
53     y: f64
54 }
55
56 fn main() {
57     let stack_val: SomeStruct = SomeStruct { x: 10, y: 23.5 };
58     let stack_val_ref: &SomeStruct = &stack_val;
59     let stack_val_interior_ref_1: &int = &stack_val.x;
60     let stack_val_interior_ref_2: &f64 = &stack_val.y;
61     let ref_to_unnamed: &SomeStruct = &SomeStruct { x: 11, y: 24.5 };
62
63     let managed_val = @SomeStruct { x: 12, y: 25.5 };
64     let managed_val_ref: &SomeStruct = managed_val;
65     let managed_val_interior_ref_1: &int = &managed_val.x;
66     let managed_val_interior_ref_2: &f64 = &managed_val.y;
67
68     let unique_val = ~SomeStruct { x: 13, y: 26.5 };
69     let unique_val_ref: &SomeStruct = unique_val;
70     let unique_val_interior_ref_1: &int = &unique_val.x;
71     let unique_val_interior_ref_2: &f64 = &unique_val.y;
72
73     zzz();
74 }
75
76 fn zzz() {()}