]> git.lizzy.rs Git - rust.git/blob - src/test/debuginfo/borrowed-basic.rs
Merge pull request #16 from ian-h-chamberlain/feature/target-thread-local
[rust.git] / src / test / debuginfo / borrowed-basic.rs
1 // Gdb doesn't know about UTF-32 character encoding and will print a rust char as only
2 // its numerical value.
3
4 // compile-flags:-g
5 // min-lldb-version: 310
6
7 // === GDB TESTS ===================================================================================
8
9 // gdb-command:run
10 // gdb-command:print *bool_ref
11 // gdb-check:$1 = true
12
13 // gdb-command:print *int_ref
14 // gdb-check:$2 = -1
15
16 // gdb-command:print *char_ref
17 // gdb-check:$3 = 97
18
19 // gdb-command:print *i8_ref
20 // gdbg-check:$4 = 68 'D'
21 // gdbr-check:$4 = 68
22
23 // gdb-command:print *i16_ref
24 // gdb-check:$5 = -16
25
26 // gdb-command:print *i32_ref
27 // gdb-check:$6 = -32
28
29 // gdb-command:print *i64_ref
30 // gdb-check:$7 = -64
31
32 // gdb-command:print *uint_ref
33 // gdb-check:$8 = 1
34
35 // gdb-command:print *u8_ref
36 // gdbg-check:$9 = 100 'd'
37 // gdbr-check:$9 = 100
38
39 // gdb-command:print *u16_ref
40 // gdb-check:$10 = 16
41
42 // gdb-command:print *u32_ref
43 // gdb-check:$11 = 32
44
45 // gdb-command:print *u64_ref
46 // gdb-check:$12 = 64
47
48 // gdb-command:print *f32_ref
49 // gdb-check:$13 = 2.5
50
51 // gdb-command:print *f64_ref
52 // gdb-check:$14 = 3.5
53
54
55 // === LLDB TESTS ==================================================================================
56
57 // lldb-command:run
58 // lldb-command:print *bool_ref
59 // lldbg-check:[...]$0 = true
60 // lldbr-check:(bool) *bool_ref = true
61
62 // lldb-command:print *int_ref
63 // lldbg-check:[...]$1 = -1
64 // lldbr-check:(isize) *int_ref = -1
65
66 // NOTE: only rust-enabled lldb supports 32bit chars
67 // lldbr-command:print *char_ref
68 // lldbr-check:(char) *char_ref = 'a'
69
70 // lldb-command:print *i8_ref
71 // lldbg-check:[...]$2 = 'D'
72 // lldbr-check:(i8) *i8_ref = 68
73
74 // lldb-command:print *i16_ref
75 // lldbg-check:[...]$3 = -16
76 // lldbr-check:(i16) *i16_ref = -16
77
78 // lldb-command:print *i32_ref
79 // lldbg-check:[...]$4 = -32
80 // lldbr-check:(i32) *i32_ref = -32
81
82 // lldb-command:print *i64_ref
83 // lldbg-check:[...]$5 = -64
84 // lldbr-check:(i64) *i64_ref = -64
85
86 // lldb-command:print *uint_ref
87 // lldbg-check:[...]$6 = 1
88 // lldbr-check:(usize) *uint_ref = 1
89
90 // lldb-command:print *u8_ref
91 // lldbg-check:[...]$7 = 'd'
92 // lldbr-check:(u8) *u8_ref = 100
93
94 // lldb-command:print *u16_ref
95 // lldbg-check:[...]$8 = 16
96 // lldbr-check:(u16) *u16_ref = 16
97
98 // lldb-command:print *u32_ref
99 // lldbg-check:[...]$9 = 32
100 // lldbr-check:(u32) *u32_ref = 32
101
102 // lldb-command:print *u64_ref
103 // lldbg-check:[...]$10 = 64
104 // lldbr-check:(u64) *u64_ref = 64
105
106 // lldb-command:print *f32_ref
107 // lldbg-check:[...]$11 = 2.5
108 // lldbr-check:(f32) *f32_ref = 2.5
109
110 // lldb-command:print *f64_ref
111 // lldbg-check:[...]$12 = 3.5
112 // lldbr-check:(f64) *f64_ref = 3.5
113
114 #![allow(unused_variables)]
115 #![feature(omit_gdb_pretty_printer_section)]
116 #![omit_gdb_pretty_printer_section]
117
118 fn main() {
119     let bool_val: bool = true;
120     let bool_ref: &bool = &bool_val;
121
122     let int_val: isize = -1;
123     let int_ref: &isize = &int_val;
124
125     let char_val: char = 'a';
126     let char_ref: &char = &char_val;
127
128     let i8_val: i8 = 68;
129     let i8_ref: &i8 = &i8_val;
130
131     let i16_val: i16 = -16;
132     let i16_ref: &i16 = &i16_val;
133
134     let i32_val: i32 = -32;
135     let i32_ref: &i32 = &i32_val;
136
137     let i64_val: i64 = -64;
138     let i64_ref: &i64 = &i64_val;
139
140     let uint_val: usize = 1;
141     let uint_ref: &usize = &uint_val;
142
143     let u8_val: u8 = 100;
144     let u8_ref: &u8 = &u8_val;
145
146     let u16_val: u16 = 16;
147     let u16_ref: &u16 = &u16_val;
148
149     let u32_val: u32 = 32;
150     let u32_ref: &u32 = &u32_val;
151
152     let u64_val: u64 = 64;
153     let u64_ref: &u64 = &u64_val;
154
155     let f32_val: f32 = 2.5;
156     let f32_ref: &f32 = &f32_val;
157
158     let f64_val: f64 = 3.5;
159     let f64_ref: &f64 = &f64_val;
160
161     zzz(); // #break
162 }
163
164 fn zzz() {()}