]> git.lizzy.rs Git - rust.git/blob - src/test/debuginfo/gdb-pretty-struct-and-enums-pre-gdb-7-7.rs
Auto merge of #28816 - petrochenkov:unistruct, r=nrc
[rust.git] / src / test / debuginfo / gdb-pretty-struct-and-enums-pre-gdb-7-7.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 // ignore-bitrig
12 // ignore-windows failing on win32 bot
13 // ignore-freebsd: gdb package too new
14 // ignore-tidy-linelength
15 // ignore-lldb
16 // ignore-android: FIXME(#10381)
17 // compile-flags:-g
18
19 // gdb-command: run
20
21 // gdb-command: print regular_struct
22 // gdb-check:$1 = RegularStruct = {the_first_field = 101, the_second_field = 102.5, the_third_field = false}
23
24 // gdb-command: print empty_struct
25 // gdb-check:$2 = EmptyStruct
26
27 // gdb-command: print c_style_enum1
28 // gdb-check:$3 = CStyleEnumVar1
29
30 // gdb-command: print c_style_enum2
31 // gdb-check:$4 = CStyleEnumVar2
32
33 // gdb-command: print c_style_enum3
34 // gdb-check:$5 = CStyleEnumVar3
35
36 #![allow(dead_code, unused_variables)]
37
38 struct RegularStruct {
39     the_first_field: isize,
40     the_second_field: f64,
41     the_third_field: bool,
42 }
43
44 struct EmptyStruct;
45
46 enum CStyleEnum {
47     CStyleEnumVar1,
48     CStyleEnumVar2,
49     CStyleEnumVar3,
50 }
51
52 fn main() {
53
54     let regular_struct = RegularStruct {
55         the_first_field: 101,
56         the_second_field: 102.5,
57         the_third_field: false
58     };
59
60     let empty_struct = EmptyStruct;
61
62     let c_style_enum1 = CStyleEnum::CStyleEnumVar1;
63     let c_style_enum2 = CStyleEnum::CStyleEnumVar2;
64     let c_style_enum3 = CStyleEnum::CStyleEnumVar3;
65
66     zzz(); // #break
67 }
68
69 fn zzz() { () }