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.
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.
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
15 // ignore-windows failing on win32 bot
16 // ignore-tidy-linelength
18 // ignore-android: FIXME(#10381)
20 // gdb-use-pretty-printer
24 // gdb-command: print regular_struct
25 // gdb-check:$1 = RegularStruct = {the_first_field = 101, the_second_field = 102.5, the_third_field = false}
27 // gdb-command: print empty_struct
28 // gdb-check:$2 = EmptyStruct
30 // gdb-command: print c_style_enum1
31 // gdb-check:$3 = CStyleEnumVar1
33 // gdb-command: print c_style_enum2
34 // gdb-check:$4 = CStyleEnumVar2
36 // gdb-command: print c_style_enum3
37 // gdb-check:$5 = CStyleEnumVar3
39 struct RegularStruct {
41 the_second_field: f64,
42 the_third_field: bool,
55 let regular_struct = RegularStruct {
57 the_second_field: 102.5,
58 the_third_field: false
61 let empty_struct = EmptyStruct;
63 let c_style_enum1 = CStyleEnum::CStyleEnumVar1;
64 let c_style_enum2 = CStyleEnum::CStyleEnumVar2;
65 let c_style_enum3 = CStyleEnum::CStyleEnumVar3;