]> git.proxmox.com Git - rustc.git/blame - src/test/debuginfo/issue-22656.rs
Update unsuspicious file list
[rustc.git] / src / test / debuginfo / issue-22656.rs
CommitLineData
c34b1796
AL
1// This test makes sure that the LLDB pretty printer does not throw an exception
2// when trying to handle a Vec<> or anything else that contains zero-sized
3// fields.
4
5// min-lldb-version: 310
6// ignore-gdb
c34b1796
AL
7
8// compile-flags:-g
9
10// === LLDB TESTS ==================================================================================
11// lldb-command:run
12
13// lldb-command:print v
f035d41b
XL
14// lldbg-check:[...]$0 = size=3 { [0] = 1 [1] = 2 [2] = 3 }
15// lldbr-check:(alloc::vec::Vec<i32>) v = size=3 { [0] = 1 [1] = 2 [2] = 3 }
c34b1796 16// lldb-command:print zs
f035d41b
XL
17// lldbg-check:[...]$1 = { x = y = 123 z = w = 456 }
18// lldbr-check:(issue_22656::StructWithZeroSizedField) zs = { x = y = 123 z = w = 456 }
0bf4aa26 19// lldbr-command:continue
c34b1796
AL
20
21#![allow(unused_variables)]
22#![allow(dead_code)]
b039eaaf 23#![feature(omit_gdb_pretty_printer_section)]
c34b1796
AL
24#![omit_gdb_pretty_printer_section]
25
26struct ZeroSizedStruct;
27
28struct StructWithZeroSizedField {
29 x: ZeroSizedStruct,
30 y: u32,
31 z: ZeroSizedStruct,
32 w: u64
33}
34
35fn main() {
36 let v = vec![1,2,3];
37
38 let zs = StructWithZeroSizedField {
39 x: ZeroSizedStruct,
40 y: 123,
41 z: ZeroSizedStruct,
42 w: 456
43 };
44
45 zzz(); // #break
46}
47
48fn zzz() { () }