]> git.proxmox.com Git - rustc.git/blob - src/test/debuginfo/basic-types-metadata.rs
New upstream version 1.14.0+dfsg1
[rustc.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 // gdbg-check:[...]![...]_yyy([...]);
49 // gdbr-check:static fn basic_types_metadata::_yyy() -> !;
50 // gdb-command:ptype closure_0
51 // gdbr-check: type = struct closure
52 // gdbg-check: type = struct closure {
53 // gdbg-check: <no data fields>
54 // gdbg-check: }
55 // gdb-command:ptype closure_1
56 // gdbg-check: type = struct closure {
57 // gdbg-check: bool *__0;
58 // gdbg-check: }
59 // gdbr-check: type = struct closure (
60 // gdbr-check: bool *,
61 // gdbr-check: )
62 // gdb-command:ptype closure_2
63 // gdbg-check: type = struct closure {
64 // gdbg-check: bool *__0;
65 // gdbg-check: isize *__1;
66 // gdbg-check: }
67 // gdbr-check: type = struct closure (
68 // gdbr-check: bool *,
69 // gdbr-check: isize *,
70 // gdbr-check: )
71
72 //
73 // gdb-command:continue
74
75 #![allow(unused_variables)]
76 #![feature(omit_gdb_pretty_printer_section)]
77 #![omit_gdb_pretty_printer_section]
78
79 fn main() {
80 let unit: () = ();
81 let b: bool = false;
82 let i: isize = -1;
83 let c: char = 'a';
84 let i8: i8 = 68;
85 let i16: i16 = -16;
86 let i32: i32 = -32;
87 let i64: i64 = -64;
88 let u: usize = 1;
89 let u8: u8 = 100;
90 let u16: u16 = 16;
91 let u32: u32 = 32;
92 let u64: u64 = 64;
93 let f32: f32 = 2.5;
94 let f64: f64 = 3.5;
95 let fnptr : fn() = _zzz;
96 let closure_0 = || {};
97 let closure_1 = || { b; };
98 let closure_2 = || { if b { i } else { i }; };
99 _zzz(); // #break
100 if 1 == 1 { _yyy(); }
101 }
102
103 fn _zzz() {()}
104 fn _yyy() -> ! {panic!()}