]> git.lizzy.rs Git - rust.git/blob - tests/debuginfo/basic-types-metadata.rs
Rollup merge of #107819 - clubby789:x-py-root, r=jyn514
[rust.git] / tests / debuginfo / basic-types-metadata.rs
1 // min-lldb-version: 310
2 // ignore-gdb // Test temporarily ignored due to debuginfo tests being disabled, see PR 47155
3
4 // compile-flags:-g
5 // gdb-command:run
6 // gdb-command:whatis unit
7 // gdb-check:type = ()
8 // gdb-command:whatis b
9 // gdb-check:type = bool
10 // gdb-command:whatis i
11 // gdb-check:type = isize
12 // gdb-command:whatis c
13 // gdb-check:type = char
14 // gdb-command:whatis i8
15 // gdb-check:type = i8
16 // gdb-command:whatis i16
17 // gdb-check:type = i16
18 // gdb-command:whatis i32
19 // gdb-check:type = i32
20 // gdb-command:whatis i64
21 // gdb-check:type = i64
22 // gdb-command:whatis u
23 // gdb-check:type = usize
24 // gdb-command:whatis u8
25 // gdb-check:type = u8
26 // gdb-command:whatis u16
27 // gdb-check:type = u16
28 // gdb-command:whatis u32
29 // gdb-check:type = u32
30 // gdb-command:whatis u64
31 // gdb-check:type = u64
32 // gdb-command:whatis f32
33 // gdb-check:type = f32
34 // gdb-command:whatis f64
35 // gdb-check:type = f64
36 // gdb-command:whatis fnptr
37 // gdb-check:type = [...] (*)([...])
38 // gdb-command:info functions _yyy
39 // gdbg-check:[...]![...]_yyy([...]);
40 // gdbr-check:static fn basic_types_metadata::_yyy() -> !;
41 // gdb-command:ptype closure_0
42 // gdbr-check: type = struct closure
43 // gdbg-check: type = struct closure {
44 // gdbg-check:     <no data fields>
45 // gdbg-check: }
46 // gdb-command:ptype closure_1
47 // gdbg-check: type = struct closure {
48 // gdbg-check:     bool *__0;
49 // gdbg-check: }
50 // gdbr-check: type = struct closure (
51 // gdbr-check:     bool *,
52 // gdbr-check: )
53 // gdb-command:ptype closure_2
54 // gdbg-check: type = struct closure {
55 // gdbg-check:     bool *__0;
56 // gdbg-check:     isize *__1;
57 // gdbg-check: }
58 // gdbr-check: type = struct closure (
59 // gdbr-check:     bool *,
60 // gdbr-check:     isize *,
61 // gdbr-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!()}