]> git.lizzy.rs Git - rust.git/blob - src/test/debuginfo/gdb-pretty-struct-and-enums-pre-gdb-7-7.rs
auto merge of #16944 : alexcrichton/rust/ignore-gdb-pretty, r=brson
[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-test FIXME(#16919)
16 // ignore-tidy-linelength
17 // ignore-lldb
18 // ignore-android: FIXME(#10381)
19 // compile-flags:-g
20 // gdb-use-pretty-printer
21
22 // The following line actually doesn't have to do anything with pretty printing,
23 // it just tells GDB to print values on one line:
24 // gdb-command: set print pretty off
25
26 // gdb-command: rbreak zzz
27 // gdb-command: run
28 // gdb-command: finish
29
30 // gdb-command: print regular_struct
31 // gdb-check:$1 = RegularStruct = {the_first_field = 101, the_second_field = 102.5, the_third_field = false}
32
33 // gdb-command: print empty_struct
34 // gdb-check:$2 = EmptyStruct
35
36 // gdb-command: print c_style_enum1
37 // gdb-check:$3 = CStyleEnumVar1
38
39 // gdb-command: print c_style_enum2
40 // gdb-check:$4 = CStyleEnumVar2
41
42 // gdb-command: print c_style_enum3
43 // gdb-check:$5 = CStyleEnumVar3
44
45 struct RegularStruct {
46     the_first_field: int,
47     the_second_field: f64,
48     the_third_field: bool,
49 }
50
51 struct EmptyStruct;
52
53 enum CStyleEnum {
54     CStyleEnumVar1,
55     CStyleEnumVar2,
56     CStyleEnumVar3,
57 }
58
59 fn main() {
60
61     let regular_struct = RegularStruct {
62         the_first_field: 101,
63         the_second_field: 102.5,
64         the_third_field: false
65     };
66
67     let empty_struct = EmptyStruct;
68
69     let c_style_enum1 = CStyleEnumVar1;
70     let c_style_enum2 = CStyleEnumVar2;
71     let c_style_enum3 = CStyleEnumVar3;
72
73     zzz();
74 }
75
76 fn zzz() { () }