]> git.lizzy.rs Git - rust.git/blob - src/test/debuginfo/gdb-pretty-struct-and-enums-pre-gdb-7-7.rs
Add verbose option to rustdoc in order to fix problem with --version
[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 // 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-windows failing on win32 bot
16 // ignore-tidy-linelength
17 // ignore-lldb
18 // ignore-android: FIXME(#10381)
19 // compile-flags:-g
20 // gdb-use-pretty-printer
21
22 // gdb-command: run
23
24 // gdb-command: print regular_struct
25 // gdb-check:$1 = RegularStruct = {the_first_field = 101, the_second_field = 102.5, the_third_field = false}
26
27 // gdb-command: print empty_struct
28 // gdb-check:$2 = EmptyStruct
29
30 // gdb-command: print c_style_enum1
31 // gdb-check:$3 = CStyleEnumVar1
32
33 // gdb-command: print c_style_enum2
34 // gdb-check:$4 = CStyleEnumVar2
35
36 // gdb-command: print c_style_enum3
37 // gdb-check:$5 = CStyleEnumVar3
38
39 struct RegularStruct {
40     the_first_field: int,
41     the_second_field: f64,
42     the_third_field: bool,
43 }
44
45 struct EmptyStruct;
46
47 enum CStyleEnum {
48     CStyleEnumVar1,
49     CStyleEnumVar2,
50     CStyleEnumVar3,
51 }
52
53 fn main() {
54
55     let regular_struct = RegularStruct {
56         the_first_field: 101,
57         the_second_field: 102.5,
58         the_third_field: false
59     };
60
61     let empty_struct = EmptyStruct;
62
63     let c_style_enum1 = CStyleEnum::CStyleEnumVar1;
64     let c_style_enum2 = CStyleEnum::CStyleEnumVar2;
65     let c_style_enum3 = CStyleEnum::CStyleEnumVar3;
66
67     zzz(); // #break
68 }
69
70 fn zzz() { () }