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