]> git.lizzy.rs Git - rust.git/blob - src/test/debuginfo/borrowed-unique-basic.rs
Auto merge of #54720 - davidtwco:issue-51191, r=nikomatsakis
[rust.git] / src / test / debuginfo / borrowed-unique-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 // min-lldb-version: 310
12
13 // Gdb doesn't know about UTF-32 character encoding and will print a rust char as only
14 // its numerical value.
15
16 // compile-flags:-g
17
18 // === GDB TESTS ===================================================================================
19
20 // gdb-command:run
21
22 // gdb-command:print *bool_ref
23 // gdb-check:$1 = true
24
25 // gdb-command:print *int_ref
26 // gdb-check:$2 = -1
27
28 // gdb-command:print *char_ref
29 // gdbg-check:$3 = 97
30 // gdbr-check:$3 = 97 'a'
31
32 // gdb-command:print/d *i8_ref
33 // gdb-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/d *u8_ref
48 // gdb-check:$9 = 100
49
50 // gdb-command:print *u16_ref
51 // gdb-check:$10 = 16
52
53 // gdb-command:print *u32_ref
54 // gdb-check:$11 = 32
55
56 // gdb-command:print *u64_ref
57 // gdb-check:$12 = 64
58
59 // gdb-command:print *f32_ref
60 // gdb-check:$13 = 2.5
61
62 // gdb-command:print *f64_ref
63 // gdb-check:$14 = 3.5
64
65
66 // === LLDB TESTS ==================================================================================
67
68 // lldb-command:type format add -f decimal char
69 // lldb-command:type format add -f decimal 'unsigned char'
70 // lldb-command:run
71
72 // lldb-command:print *bool_ref
73 // lldb-check:[...]$0 = true
74
75 // lldb-command:print *int_ref
76 // lldb-check:[...]$1 = -1
77
78 // d ebugger:print *char_ref
79 // c heck:[...]$3 = 97
80
81 // lldb-command:print *i8_ref
82 // lldb-check:[...]$2 = 68
83
84 // lldb-command:print *i16_ref
85 // lldb-check:[...]$3 = -16
86
87 // lldb-command:print *i32_ref
88 // lldb-check:[...]$4 = -32
89
90 // lldb-command:print *i64_ref
91 // lldb-check:[...]$5 = -64
92
93 // lldb-command:print *uint_ref
94 // lldb-check:[...]$6 = 1
95
96 // lldb-command:print *u8_ref
97 // lldb-check:[...]$7 = 100
98
99 // lldb-command:print *u16_ref
100 // lldb-check:[...]$8 = 16
101
102 // lldb-command:print *u32_ref
103 // lldb-check:[...]$9 = 32
104
105 // lldb-command:print *u64_ref
106 // lldb-check:[...]$10 = 64
107
108 // lldb-command:print *f32_ref
109 // lldb-check:[...]$11 = 2.5
110
111 // lldb-command:print *f64_ref
112 // lldb-check:[...]$12 = 3.5
113
114 #![allow(unused_variables)]
115 #![feature(box_syntax)]
116 #![feature(omit_gdb_pretty_printer_section)]
117 #![omit_gdb_pretty_printer_section]
118
119 fn main() {
120     let bool_box: Box<bool> = box true;
121     let bool_ref: &bool = &*bool_box;
122
123     let int_box: Box<isize> = box -1;
124     let int_ref: &isize = &*int_box;
125
126     let char_box: Box<char> = box 'a';
127     let char_ref: &char = &*char_box;
128
129     let i8_box: Box<i8> = box 68;
130     let i8_ref: &i8 = &*i8_box;
131
132     let i16_box: Box<i16> = box -16;
133     let i16_ref: &i16 = &*i16_box;
134
135     let i32_box: Box<i32> = box -32;
136     let i32_ref: &i32 = &*i32_box;
137
138     let i64_box: Box<i64> = box -64;
139     let i64_ref: &i64 = &*i64_box;
140
141     let uint_box: Box<usize> = box 1;
142     let uint_ref: &usize = &*uint_box;
143
144     let u8_box: Box<u8> = box 100;
145     let u8_ref: &u8 = &*u8_box;
146
147     let u16_box: Box<u16> = box 16;
148     let u16_ref: &u16 = &*u16_box;
149
150     let u32_box: Box<u32> = box 32;
151     let u32_ref: &u32 = &*u32_box;
152
153     let u64_box: Box<u64> = box 64;
154     let u64_ref: &u64 = &*u64_box;
155
156     let f32_box: Box<f32> = box 2.5;
157     let f32_ref: &f32 = &*f32_box;
158
159     let f64_box: Box<f64> = box 3.5;
160     let f64_ref: &f64 = &*f64_box;
161
162     zzz(); // #break
163 }
164
165 fn zzz() {()}