]> git.lizzy.rs Git - rust.git/blob - src/test/debuginfo/basic-types.rs
Auto merge of #28816 - petrochenkov:unistruct, r=nrc
[rust.git] / src / test / debuginfo / basic-types.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
21 // === GDB TESTS ===================================================================================
22
23 // gdb-command:run
24 // gdb-command:print b
25 // gdb-check:$1 = false
26 // gdb-command:print i
27 // gdb-check:$2 = -1
28 // gdb-command:print c
29 // gdb-check:$3 = 97
30 // gdb-command:print/d i8
31 // gdb-check:$4 = 68
32 // gdb-command:print i16
33 // gdb-check:$5 = -16
34 // gdb-command:print i32
35 // gdb-check:$6 = -32
36 // gdb-command:print i64
37 // gdb-check:$7 = -64
38 // gdb-command:print u
39 // gdb-check:$8 = 1
40 // gdb-command:print/d u8
41 // gdb-check:$9 = 100
42 // gdb-command:print u16
43 // gdb-check:$10 = 16
44 // gdb-command:print u32
45 // gdb-check:$11 = 32
46 // gdb-command:print u64
47 // gdb-check:$12 = 64
48 // gdb-command:print f32
49 // gdb-check:$13 = 2.5
50 // gdb-command:print f64
51 // gdb-check:$14 = 3.5
52
53
54 // === LLDB TESTS ==================================================================================
55
56 // lldb-command:run
57 // lldb-command:print b
58 // lldb-check:[...]$0 = false
59 // lldb-command:print i
60 // lldb-check:[...]$1 = -1
61
62 // NOTE: LLDB does not support 32bit chars
63 // d ebugger:print (usize)(c)
64 // c heck:$3 = 97
65
66 // lldb-command:print i8
67 // lldb-check:[...]$2 = 'D'
68 // lldb-command:print i16
69 // lldb-check:[...]$3 = -16
70 // lldb-command:print i32
71 // lldb-check:[...]$4 = -32
72 // lldb-command:print i64
73 // lldb-check:[...]$5 = -64
74 // lldb-command:print u
75 // lldb-check:[...]$6 = 1
76 // lldb-command:print u8
77 // lldb-check:[...]$7 = 'd'
78 // lldb-command:print u16
79 // lldb-check:[...]$8 = 16
80 // lldb-command:print u32
81 // lldb-check:[...]$9 = 32
82 // lldb-command:print u64
83 // lldb-check:[...]$10 = 64
84 // lldb-command:print f32
85 // lldb-check:[...]$11 = 2.5
86 // lldb-command:print f64
87 // lldb-check:[...]$12 = 3.5
88
89 #![allow(unused_variables)]
90 #![feature(omit_gdb_pretty_printer_section)]
91 #![omit_gdb_pretty_printer_section]
92
93 fn main() {
94     let b: bool = false;
95     let i: isize = -1;
96     let c: char = 'a';
97     let i8: i8 = 68;
98     let i16: i16 = -16;
99     let i32: i32 = -32;
100     let i64: i64 = -64;
101     let u: usize = 1;
102     let u8: u8 = 100;
103     let u16: u16 = 16;
104     let u32: u32 = 32;
105     let u64: u64 = 64;
106     let f32: f32 = 2.5;
107     let f64: f64 = 3.5;
108     _zzz(); // #break
109 }
110
111 fn _zzz() {()}