]> git.lizzy.rs Git - rust.git/blob - src/test/debuginfo/basic-types-metadata.rs
Auto merge of #28816 - petrochenkov:unistruct, r=nrc
[rust.git] / src / test / debuginfo / basic-types-metadata.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 // min-lldb-version: 310
12
13 // compile-flags:-g
14 // gdb-command:run
15 // gdb-command:whatis unit
16 // gdb-check:type = ()
17 // gdb-command:whatis b
18 // gdb-check:type = bool
19 // gdb-command:whatis i
20 // gdb-check:type = isize
21 // gdb-command:whatis c
22 // gdb-check:type = char
23 // gdb-command:whatis i8
24 // gdb-check:type = i8
25 // gdb-command:whatis i16
26 // gdb-check:type = i16
27 // gdb-command:whatis i32
28 // gdb-check:type = i32
29 // gdb-command:whatis i64
30 // gdb-check:type = i64
31 // gdb-command:whatis u
32 // gdb-check:type = usize
33 // gdb-command:whatis u8
34 // gdb-check:type = u8
35 // gdb-command:whatis u16
36 // gdb-check:type = u16
37 // gdb-command:whatis u32
38 // gdb-check:type = u32
39 // gdb-command:whatis u64
40 // gdb-check:type = u64
41 // gdb-command:whatis f32
42 // gdb-check:type = f32
43 // gdb-command:whatis f64
44 // gdb-check:type = f64
45 // gdb-command:whatis fnptr
46 // gdb-check:type = [...] (*)([...])
47 // gdb-command:info functions _yyy
48 // gdb-check:[...]![...]_yyy([...]);
49 // gdb-command:ptype closure_0
50 // gdb-check: type = struct closure {
51 // gdb-check:     <no data fields>
52 // gdb-check: }
53 // gdb-command:ptype closure_1
54 // gdb-check: type = struct closure {
55 // gdb-check:     bool *__0;
56 // gdb-check: }
57 // gdb-command:ptype closure_2
58 // gdb-check: type = struct closure {
59 // gdb-check:     bool *__0;
60 // gdb-check:     isize *__1;
61 // gdb-check: }
62
63 //
64 // gdb-command:continue
65
66 #![allow(unused_variables)]
67 #![feature(omit_gdb_pretty_printer_section)]
68 #![omit_gdb_pretty_printer_section]
69
70 fn main() {
71     let unit: () = ();
72     let b: bool = false;
73     let i: isize = -1;
74     let c: char = 'a';
75     let i8: i8 = 68;
76     let i16: i16 = -16;
77     let i32: i32 = -32;
78     let i64: i64 = -64;
79     let u: usize = 1;
80     let u8: u8 = 100;
81     let u16: u16 = 16;
82     let u32: u32 = 32;
83     let u64: u64 = 64;
84     let f32: f32 = 2.5;
85     let f64: f64 = 3.5;
86     let fnptr : fn() = _zzz;
87     let closure_0 = || {};
88     let closure_1 = || { b; };
89     let closure_2 = || { if b { i } else { i }; };
90     _zzz(); // #break
91     if 1 == 1 { _yyy(); }
92 }
93
94 fn _zzz() {()}
95 fn _yyy() -> ! {panic!()}