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