2014-08-20 10:53:50 +00:00
|
|
|
// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT
|
|
|
|
// file at the top-level directory of this distribution and at
|
|
|
|
// http://rust-lang.org/COPYRIGHT.
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
|
|
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
|
|
|
// option. This file may not be copied, modified, or distributed
|
|
|
|
// except according to those terms.
|
|
|
|
|
|
|
|
// This test uses only GDB Python API features which should be available in
|
|
|
|
// older versions of GDB too. A more extensive test can be found in
|
|
|
|
// gdb-pretty-struct-and-enums.rs
|
|
|
|
|
2015-03-23 19:48:42 +00:00
|
|
|
// ignore-bitrig
|
2014-09-19 01:35:41 +00:00
|
|
|
// ignore-windows failing on win32 bot
|
2015-02-15 08:18:55 +00:00
|
|
|
// ignore-freebsd: gdb package too new
|
2014-08-20 10:53:50 +00:00
|
|
|
// ignore-tidy-linelength
|
|
|
|
// ignore-lldb
|
|
|
|
// ignore-android: FIXME(#10381)
|
|
|
|
// compile-flags:-g
|
|
|
|
|
|
|
|
// gdb-command: run
|
|
|
|
|
|
|
|
// gdb-command: print regular_struct
|
|
|
|
// gdb-check:$1 = RegularStruct = {the_first_field = 101, the_second_field = 102.5, the_third_field = false}
|
|
|
|
|
|
|
|
// gdb-command: print empty_struct
|
|
|
|
// gdb-check:$2 = EmptyStruct
|
|
|
|
|
|
|
|
// gdb-command: print c_style_enum1
|
|
|
|
// gdb-check:$3 = CStyleEnumVar1
|
|
|
|
|
|
|
|
// gdb-command: print c_style_enum2
|
|
|
|
// gdb-check:$4 = CStyleEnumVar2
|
|
|
|
|
|
|
|
// gdb-command: print c_style_enum3
|
|
|
|
// gdb-check:$5 = CStyleEnumVar3
|
|
|
|
|
|
|
|
struct RegularStruct {
|
2015-03-26 00:06:52 +00:00
|
|
|
the_first_field: isize,
|
2014-08-20 10:53:50 +00:00
|
|
|
the_second_field: f64,
|
|
|
|
the_third_field: bool,
|
|
|
|
}
|
|
|
|
|
|
|
|
struct EmptyStruct;
|
|
|
|
|
|
|
|
enum CStyleEnum {
|
|
|
|
CStyleEnumVar1,
|
|
|
|
CStyleEnumVar2,
|
|
|
|
CStyleEnumVar3,
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
|
|
|
|
let regular_struct = RegularStruct {
|
|
|
|
the_first_field: 101,
|
|
|
|
the_second_field: 102.5,
|
|
|
|
the_third_field: false
|
|
|
|
};
|
|
|
|
|
|
|
|
let empty_struct = EmptyStruct;
|
|
|
|
|
2014-11-06 08:05:53 +00:00
|
|
|
let c_style_enum1 = CStyleEnum::CStyleEnumVar1;
|
|
|
|
let c_style_enum2 = CStyleEnum::CStyleEnumVar2;
|
|
|
|
let c_style_enum3 = CStyleEnum::CStyleEnumVar3;
|
2014-08-20 10:53:50 +00:00
|
|
|
|
2014-10-29 06:13:29 +00:00
|
|
|
zzz(); // #break
|
2014-08-20 10:53:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
fn zzz() { () }
|