]> git.proxmox.com Git - rustc.git/blame - src/test/debuginfo/gdb-pretty-struct-and-enums-pre-gdb-7-7.rs
Imported Upstream version 1.1.0+dfsg1
[rustc.git] / src / test / debuginfo / gdb-pretty-struct-and-enums-pre-gdb-7-7.rs
CommitLineData
1a4d82fc
JJ
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
9346a6ac 15// ignore-bitrig
1a4d82fc 16// ignore-windows failing on win32 bot
85aaf69f 17// ignore-freebsd: gdb package too new
1a4d82fc
JJ
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
d9579d0f
AL
40#![allow(dead_code, unused_variables)]
41
1a4d82fc 42struct RegularStruct {
c34b1796 43 the_first_field: isize,
1a4d82fc
JJ
44 the_second_field: f64,
45 the_third_field: bool,
46}
47
48struct EmptyStruct;
49
50enum CStyleEnum {
51 CStyleEnumVar1,
52 CStyleEnumVar2,
53 CStyleEnumVar3,
54}
55
56fn 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
73fn zzz() { () }