]> git.lizzy.rs Git - rust.git/blob - src/test/debuginfo/borrowed-unique-basic.rs
Auto merge of #28816 - petrochenkov:unistruct, r=nrc
[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 // gdb-check:$3 = 97
30
31 // gdb-command:print/d *i8_ref
32 // gdb-check:$4 = 68
33
34 // gdb-command:print *i16_ref
35 // gdb-check:$5 = -16
36
37 // gdb-command:print *i32_ref
38 // gdb-check:$6 = -32
39
40 // gdb-command:print *i64_ref
41 // gdb-check:$7 = -64
42
43 // gdb-command:print *uint_ref
44 // gdb-check:$8 = 1
45
46 // gdb-command:print/d *u8_ref
47 // gdb-check:$9 = 100
48
49 // gdb-command:print *u16_ref
50 // gdb-check:$10 = 16
51
52 // gdb-command:print *u32_ref
53 // gdb-check:$11 = 32
54
55 // gdb-command:print *u64_ref
56 // gdb-check:$12 = 64
57
58 // gdb-command:print *f32_ref
59 // gdb-check:$13 = 2.5
60
61 // gdb-command:print *f64_ref
62 // gdb-check:$14 = 3.5
63
64
65 // === LLDB TESTS ==================================================================================
66
67 // lldb-command:type format add -f decimal char
68 // lldb-command:type format add -f decimal 'unsigned char'
69 // lldb-command:run
70
71 // lldb-command:print *bool_ref
72 // lldb-check:[...]$0 = true
73
74 // lldb-command:print *int_ref
75 // lldb-check:[...]$1 = -1
76
77 // d ebugger:print *char_ref
78 // c heck:[...]$3 = 97
79
80 // lldb-command:print *i8_ref
81 // lldb-check:[...]$2 = 68
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 = 100
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(box_syntax)]
115 #![feature(omit_gdb_pretty_printer_section)]
116 #![omit_gdb_pretty_printer_section]
117
118 fn main() {
119     let bool_box: Box<bool> = box true;
120     let bool_ref: &bool = &*bool_box;
121
122     let int_box: Box<isize> = box -1;
123     let int_ref: &isize = &*int_box;
124
125     let char_box: Box<char> = box 'a';
126     let char_ref: &char = &*char_box;
127
128     let i8_box: Box<i8> = box 68;
129     let i8_ref: &i8 = &*i8_box;
130
131     let i16_box: Box<i16> = box -16;
132     let i16_ref: &i16 = &*i16_box;
133
134     let i32_box: Box<i32> = box -32;
135     let i32_ref: &i32 = &*i32_box;
136
137     let i64_box: Box<i64> = box -64;
138     let i64_ref: &i64 = &*i64_box;
139
140     let uint_box: Box<usize> = box 1;
141     let uint_ref: &usize = &*uint_box;
142
143     let u8_box: Box<u8> = box 100;
144     let u8_ref: &u8 = &*u8_box;
145
146     let u16_box: Box<u16> = box 16;
147     let u16_ref: &u16 = &*u16_box;
148
149     let u32_box: Box<u32> = box 32;
150     let u32_ref: &u32 = &*u32_box;
151
152     let u64_box: Box<u64> = box 64;
153     let u64_ref: &u64 = &*u64_box;
154
155     let f32_box: Box<f32> = box 2.5;
156     let f32_ref: &f32 = &*f32_box;
157
158     let f64_box: Box<f64> = box 3.5;
159     let f64_ref: &f64 = &*f64_box;
160
161     zzz(); // #break
162 }
163
164 fn zzz() {()}