]> git.lizzy.rs Git - rust.git/blob - src/test/debuginfo/basic-types-globals.rs
Auto merge of #54720 - davidtwco:issue-51191, r=nikomatsakis
[rust.git] / src / test / debuginfo / basic-types-globals.rs
1 // Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
4 //
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
10
11 // Caveats - gdb prints any 8-bit value (meaning rust I8 and u8 values)
12 // as its numerical value along with its associated ASCII char, there
13 // doesn't seem to be any way around this. Also, gdb doesn't know
14 // about UTF-32 character encoding and will print a rust char as only
15 // its numerical value.
16
17 // min-lldb-version: 310
18 // ignore-gdb // Test temporarily ignored due to debuginfo tests being disabled, see PR 47155
19
20 // compile-flags:-g
21 // gdb-command:run
22 // gdbg-command:print 'basic_types_globals::B'
23 // gdbr-command:print B
24 // gdb-check:$1 = false
25 // gdbg-command:print 'basic_types_globals::I'
26 // gdbr-command:print I
27 // gdb-check:$2 = -1
28 // gdbg-command:print 'basic_types_globals::C'
29 // gdbr-command:print C
30 // gdbg-check:$3 = 97
31 // gdbr-check:$3 = 97 'a'
32 // gdbg-command:print/d 'basic_types_globals::I8'
33 // gdbr-command:print I8
34 // gdb-check:$4 = 68
35 // gdbg-command:print 'basic_types_globals::I16'
36 // gdbr-command:print I16
37 // gdb-check:$5 = -16
38 // gdbg-command:print 'basic_types_globals::I32'
39 // gdbr-command:print I32
40 // gdb-check:$6 = -32
41 // gdbg-command:print 'basic_types_globals::I64'
42 // gdbr-command:print I64
43 // gdb-check:$7 = -64
44 // gdbg-command:print 'basic_types_globals::U'
45 // gdbr-command:print U
46 // gdb-check:$8 = 1
47 // gdbg-command:print/d 'basic_types_globals::U8'
48 // gdbr-command:print U8
49 // gdb-check:$9 = 100
50 // gdbg-command:print 'basic_types_globals::U16'
51 // gdbr-command:print U16
52 // gdb-check:$10 = 16
53 // gdbg-command:print 'basic_types_globals::U32'
54 // gdbr-command:print U32
55 // gdb-check:$11 = 32
56 // gdbg-command:print 'basic_types_globals::U64'
57 // gdbr-command:print U64
58 // gdb-check:$12 = 64
59 // gdbg-command:print 'basic_types_globals::F32'
60 // gdbr-command:print F32
61 // gdb-check:$13 = 2.5
62 // gdbg-command:print 'basic_types_globals::F64'
63 // gdbr-command:print F64
64 // gdb-check:$14 = 3.5
65 // gdb-command:continue
66
67 #![allow(unused_variables)]
68 #![feature(omit_gdb_pretty_printer_section)]
69 #![omit_gdb_pretty_printer_section]
70
71 // N.B. These are `mut` only so they don't constant fold away.
72 static mut B: bool = false;
73 static mut I: isize = -1;
74 static mut C: char = 'a';
75 static mut I8: i8 = 68;
76 static mut I16: i16 = -16;
77 static mut I32: i32 = -32;
78 static mut I64: i64 = -64;
79 static mut U: usize = 1;
80 static mut U8: u8 = 100;
81 static mut U16: u16 = 16;
82 static mut U32: u32 = 32;
83 static mut U64: u64 = 64;
84 static mut F32: f32 = 2.5;
85 static mut F64: f64 = 3.5;
86
87 fn main() {
88     _zzz(); // #break
89
90     let a = unsafe { (B, I, C, I8, I16, I32, I64, U, U8, U16, U32, U64, F32, F64) };
91 }
92
93 fn _zzz() {()}