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