]> git.lizzy.rs Git - rust.git/blob - tests/debuginfo/basic-types-mut-globals.rs
Merge commit '7d53619064ab7045c383644cb445052d2a3d46db' into sync_cg_clif-2023-02-09
[rust.git] / tests / debuginfo / basic-types-mut-globals.rs
1 // Caveats - gdb prints any 8-bit value (meaning rust I8 and u8 values)
2 // as its numerical value along with its associated ASCII char, there
3 // doesn't seem to be any way around this. Also, gdb doesn't know
4 // about UTF-32 character encoding and will print a rust char as only
5 // its numerical value.
6
7 // min-lldb-version: 310
8 // ignore-gdb // Test temporarily ignored due to debuginfo tests being disabled, see PR 47155
9
10 // compile-flags:-g
11
12 // gdb-command:run
13
14 // Check initializers
15 // gdbg-command:print 'basic_types_mut_globals::B'
16 // gdbr-command:print B
17 // gdb-check:$1 = false
18 // gdbg-command:print 'basic_types_mut_globals::I'
19 // gdbr-command:print I
20 // gdb-check:$2 = -1
21 // gdbg-command:print/d 'basic_types_mut_globals::C'
22 // gdbr-command:print C
23 // gdbg-check:$3 = 97
24 // gdbr-check:$3 = 97 'a'
25 // gdbg-command:print/d 'basic_types_mut_globals::I8'
26 // gdbr-command:print I8
27 // gdb-check:$4 = 68
28 // gdbg-command:print 'basic_types_mut_globals::I16'
29 // gdbr-command:print I16
30 // gdb-check:$5 = -16
31 // gdbg-command:print 'basic_types_mut_globals::I32'
32 // gdbr-command:print I32
33 // gdb-check:$6 = -32
34 // gdbg-command:print 'basic_types_mut_globals::I64'
35 // gdbr-command:print I64
36 // gdb-check:$7 = -64
37 // gdbg-command:print 'basic_types_mut_globals::U'
38 // gdbr-command:print U
39 // gdb-check:$8 = 1
40 // gdbg-command:print/d 'basic_types_mut_globals::U8'
41 // gdbr-command:print U8
42 // gdb-check:$9 = 100
43 // gdbg-command:print 'basic_types_mut_globals::U16'
44 // gdbr-command:print U16
45 // gdb-check:$10 = 16
46 // gdbg-command:print 'basic_types_mut_globals::U32'
47 // gdbr-command:print U32
48 // gdb-check:$11 = 32
49 // gdbg-command:print 'basic_types_mut_globals::U64'
50 // gdbr-command:print U64
51 // gdb-check:$12 = 64
52 // gdbg-command:print 'basic_types_mut_globals::F32'
53 // gdbr-command:print F32
54 // gdb-check:$13 = 2.5
55 // gdbg-command:print 'basic_types_mut_globals::F64'
56 // gdbr-command:print F64
57 // gdb-check:$14 = 3.5
58 // gdb-command:continue
59
60 // Check new values
61 // gdbg-command:print 'basic_types_mut_globals'::B
62 // gdbr-command:print B
63 // gdb-check:$15 = true
64 // gdbg-command:print 'basic_types_mut_globals'::I
65 // gdbr-command:print I
66 // gdb-check:$16 = 2
67 // gdbg-command:print/d 'basic_types_mut_globals'::C
68 // gdbr-command:print C
69 // gdbg-check:$17 = 102
70 // gdbr-check:$17 = 102 'f'
71 // gdbg-command:print/d 'basic_types_mut_globals'::I8
72 // gdbr-command:print/d I8
73 // gdb-check:$18 = 78
74 // gdbg-command:print 'basic_types_mut_globals'::I16
75 // gdbr-command:print I16
76 // gdb-check:$19 = -26
77 // gdbg-command:print 'basic_types_mut_globals'::I32
78 // gdbr-command:print I32
79 // gdb-check:$20 = -12
80 // gdbg-command:print 'basic_types_mut_globals'::I64
81 // gdbr-command:print I64
82 // gdb-check:$21 = -54
83 // gdbg-command:print 'basic_types_mut_globals'::U
84 // gdbr-command:print U
85 // gdb-check:$22 = 5
86 // gdbg-command:print/d 'basic_types_mut_globals'::U8
87 // gdbr-command:print/d U8
88 // gdb-check:$23 = 20
89 // gdbg-command:print 'basic_types_mut_globals'::U16
90 // gdbr-command:print U16
91 // gdb-check:$24 = 32
92 // gdbg-command:print 'basic_types_mut_globals'::U32
93 // gdbr-command:print U32
94 // gdb-check:$25 = 16
95 // gdbg-command:print 'basic_types_mut_globals'::U64
96 // gdbr-command:print U64
97 // gdb-check:$26 = 128
98 // gdbg-command:print 'basic_types_mut_globals'::F32
99 // gdbr-command:print F32
100 // gdb-check:$27 = 5.75
101 // gdbg-command:print 'basic_types_mut_globals'::F64
102 // gdbr-command:print F64
103 // gdb-check:$28 = 9.25
104
105 #![allow(unused_variables)]
106 #![feature(omit_gdb_pretty_printer_section)]
107 #![omit_gdb_pretty_printer_section]
108
109 static mut B: bool = false;
110 static mut I: isize = -1;
111 static mut C: char = 'a';
112 static mut I8: i8 = 68;
113 static mut I16: i16 = -16;
114 static mut I32: i32 = -32;
115 static mut I64: i64 = -64;
116 static mut U: usize = 1;
117 static mut U8: u8 = 100;
118 static mut U16: u16 = 16;
119 static mut U32: u32 = 32;
120 static mut U64: u64 = 64;
121 static mut F32: f32 = 2.5;
122 static mut F64: f64 = 3.5;
123
124 fn main() {
125     _zzz(); // #break
126
127     unsafe {
128         B = true;
129         I = 2;
130         C = 'f';
131         I8 = 78;
132         I16 = -26;
133         I32 = -12;
134         I64 = -54;
135         U = 5;
136         U8 = 20;
137         U16 = 32;
138         U32 = 16;
139         U64 = 128;
140         F32 = 5.75;
141         F64 = 9.25;
142     }
143
144     _zzz(); // #break
145 }
146
147 fn _zzz() {()}