1
+ // Copyright 2013 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
+ // xfail-win32 Broken because of LLVM bug: http://llvm.org/bugs/show_bug.cgi?id=16249
12
+
13
+ // GDB doesn't know about UTF-32 character encoding and will print a rust char as only its numerical
14
+ // value.
15
+
16
+ // compile-flags:-Z extra-debug-info
17
+ // debugger:break zzz
18
+ // debugger:run
19
+ // debugger:finish
20
+
21
+ // debugger:print *stack_val_ref
22
+ // check:$1 = {x = 10, y = 23.5}
23
+
24
+ // debugger:print *stack_val_interior_ref_1
25
+ // check:$2 = 10
26
+
27
+ // debugger:print *stack_val_interior_ref_2
28
+ // check:$3 = 23.5
29
+
30
+ // debugger:print *ref_to_unnamed
31
+ // check:$4 = {x = 11, y = 24.5}
32
+
33
+ // debugger:print *managed_val_ref
34
+ // check:$5 = {x = 12, y = 25.5}
35
+
36
+ // debugger:print *managed_val_interior_ref_1
37
+ // check:$6 = 12
38
+
39
+ // debugger:print *managed_val_interior_ref_2
40
+ // check:$7 = 25.5
41
+
42
+ // debugger:print *unique_val_ref
43
+ // check:$8 = {x = 13, y = 26.5}
44
+
45
+ // debugger:print *unique_val_interior_ref_1
46
+ // check:$9 = 13
47
+
48
+ // debugger:print *unique_val_interior_ref_2
49
+ // check:$10 = 26.5
50
+
51
+
52
+
53
+ struct SomeStruct {
54
+ x : int ,
55
+ y : f64
56
+ }
57
+
58
+ fn main ( ) {
59
+ let stack_val: SomeStruct = SomeStruct { x : 10 , y : 23.5 } ;
60
+ let stack_val_ref : & SomeStruct = & stack_val;
61
+ let stack_val_interior_ref_1 : & int = & stack_val. x ;
62
+ let stack_val_interior_ref_2 : & f64 = & stack_val. y ;
63
+ let ref_to_unnamed : & SomeStruct = & SomeStruct { x : 11 , y : 24.5 } ;
64
+
65
+ let managed_val = @SomeStruct { x : 12 , y : 25.5 } ;
66
+ let managed_val_ref : & SomeStruct = managed_val;
67
+ let managed_val_interior_ref_1 : & int = & managed_val. x ;
68
+ let managed_val_interior_ref_2 : & f64 = & managed_val. y ;
69
+
70
+ let unique_val = ~SomeStruct { x : 13 , y : 26.5 } ;
71
+ let unique_val_ref : & SomeStruct = unique_val;
72
+ let unique_val_interior_ref_1 : & int = & unique_val. x ;
73
+ let unique_val_interior_ref_2 : & f64 = & unique_val. y ;
74
+
75
+ zzz ( ) ;
76
+ }
77
+
78
+ fn zzz ( ) { ( ) }
0 commit comments