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