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