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