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