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