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