]> git.lizzy.rs Git - rust.git/blob - src/test/debuginfo/basic-types-globals.rs
Rollup merge of #98916 - ChrisDenton:hiberfil.sys, r=thomcc
[rust.git] / src / test / debuginfo / basic-types-globals.rs
1 // Caveat - gdb doesn't know about UTF-32 character encoding and will print a
2 // rust char as only its numerical value.
3
4 // min-lldb-version: 310
5 // min-gdb-version: 8.0
6
7 // compile-flags:-g
8 // gdb-command:run
9 // gdbg-command:print 'basic_types_globals::B'
10 // gdbr-command:print B
11 // gdb-check:$1 = false
12 // gdbg-command:print 'basic_types_globals::I'
13 // gdbr-command:print I
14 // gdb-check:$2 = -1
15 // gdbg-command:print 'basic_types_globals::C'
16 // gdbr-command:print/d C
17 // gdbg-check:$3 = 97
18 // gdbr-check:$3 = 97
19 // gdbg-command:print/d 'basic_types_globals::I8'
20 // gdbr-command:print I8
21 // gdb-check:$4 = 68
22 // gdbg-command:print 'basic_types_globals::I16'
23 // gdbr-command:print I16
24 // gdb-check:$5 = -16
25 // gdbg-command:print 'basic_types_globals::I32'
26 // gdbr-command:print I32
27 // gdb-check:$6 = -32
28 // gdbg-command:print 'basic_types_globals::I64'
29 // gdbr-command:print I64
30 // gdb-check:$7 = -64
31 // gdbg-command:print 'basic_types_globals::U'
32 // gdbr-command:print U
33 // gdb-check:$8 = 1
34 // gdbg-command:print/d 'basic_types_globals::U8'
35 // gdbr-command:print U8
36 // gdb-check:$9 = 100
37 // gdbg-command:print 'basic_types_globals::U16'
38 // gdbr-command:print U16
39 // gdb-check:$10 = 16
40 // gdbg-command:print 'basic_types_globals::U32'
41 // gdbr-command:print U32
42 // gdb-check:$11 = 32
43 // gdbg-command:print 'basic_types_globals::U64'
44 // gdbr-command:print U64
45 // gdb-check:$12 = 64
46 // gdbg-command:print 'basic_types_globals::F32'
47 // gdbr-command:print F32
48 // gdb-check:$13 = 2.5
49 // gdbg-command:print 'basic_types_globals::F64'
50 // gdbr-command:print F64
51 // gdb-check:$14 = 3.5
52 // gdb-command:continue
53
54 #![allow(unused_variables)]
55 #![feature(omit_gdb_pretty_printer_section)]
56 #![omit_gdb_pretty_printer_section]
57
58 // N.B. These are `mut` only so they don't constant fold away.
59 static mut B: bool = false;
60 static mut I: isize = -1;
61 static mut C: char = 'a';
62 static mut I8: i8 = 68;
63 static mut I16: i16 = -16;
64 static mut I32: i32 = -32;
65 static mut I64: i64 = -64;
66 static mut U: usize = 1;
67 static mut U8: u8 = 100;
68 static mut U16: u16 = 16;
69 static mut U32: u32 = 32;
70 static mut U64: u64 = 64;
71 static mut F32: f32 = 2.5;
72 static mut F64: f64 = 3.5;
73
74 fn main() {
75     _zzz(); // #break
76
77     let a = unsafe { (B, I, C, I8, I16, I32, I64, U, U8, U16, U32, U64, F32, F64) };
78 }
79
80 fn _zzz() {()}