2018-01-03 18:24:25 +00:00
|
|
|
//@ ignore-test // Test temporarily ignored due to debuginfo tests being disabled, see PR 47155
|
2014-10-09 14:31:03 +00:00
|
|
|
//@ min-lldb-version: 310
|
2013-11-04 06:53:01 +00:00
|
|
|
|
2014-02-07 03:57:09 +00:00
|
|
|
//@ compile-flags:-g
|
2014-07-09 12:46:09 +00:00
|
|
|
|
|
|
|
// === GDB TESTS ===================================================================================
|
|
|
|
|
2014-04-24 09:35:48 +00:00
|
|
|
// gdb-command:run
|
2013-08-29 09:44:11 +00:00
|
|
|
|
2014-04-24 09:35:48 +00:00
|
|
|
// gdb-command:print s
|
2016-10-25 21:32:04 +00:00
|
|
|
// gdbg-check:$1 = {a = 1, b = 2.5}
|
|
|
|
// gdbr-check:$1 = by_value_non_immediate_argument::Struct {a: 1, b: 2.5}
|
2014-04-24 09:35:48 +00:00
|
|
|
// gdb-command:continue
|
2013-08-29 09:44:11 +00:00
|
|
|
|
2014-04-24 09:35:48 +00:00
|
|
|
// gdb-command:print x
|
2016-10-25 21:32:04 +00:00
|
|
|
// gdbg-check:$2 = {a = 3, b = 4.5}
|
|
|
|
// gdbr-check:$2 = by_value_non_immediate_argument::Struct {a: 3, b: 4.5}
|
2014-04-24 09:35:48 +00:00
|
|
|
// gdb-command:print y
|
|
|
|
// gdb-check:$3 = 5
|
|
|
|
// gdb-command:print z
|
|
|
|
// gdb-check:$4 = 6.5
|
|
|
|
// gdb-command:continue
|
2013-08-29 09:44:11 +00:00
|
|
|
|
2014-04-24 09:35:48 +00:00
|
|
|
// gdb-command:print a
|
2016-10-25 21:32:04 +00:00
|
|
|
// gdbg-check:$5 = {__0 = 7, __1 = 8, __2 = 9.5, __3 = 10.5}
|
|
|
|
// gdbr-check:$5 = (7, 8, 9.5, 10.5)
|
2014-04-24 09:35:48 +00:00
|
|
|
// gdb-command:continue
|
2013-08-29 09:44:11 +00:00
|
|
|
|
2014-04-24 09:35:48 +00:00
|
|
|
// gdb-command:print a
|
2016-10-25 21:32:04 +00:00
|
|
|
// gdbg-check:$6 = {__0 = 11.5, __1 = 12.5, __2 = 13, __3 = 14}
|
|
|
|
// gdbr-check:$6 = by_value_non_immediate_argument::Newtype (11.5, 12.5, 13, 14)
|
2014-04-24 09:35:48 +00:00
|
|
|
// gdb-command:continue
|
2013-08-29 09:44:11 +00:00
|
|
|
|
2014-04-24 09:35:48 +00:00
|
|
|
// gdb-command:print x
|
2016-11-21 00:56:51 +00:00
|
|
|
// gdbg-check:$7 = {{RUST$ENUM$DISR = Case1, x = 0, y = 8970181431921507452}, {RUST$ENUM$DISR = Case1, [...]}}
|
2016-10-25 21:32:04 +00:00
|
|
|
// gdbr-check:$7 = by_value_non_immediate_argument::Enum::Case1{x: 0, y: 8970181431921507452}
|
2014-04-24 09:35:48 +00:00
|
|
|
// gdb-command:continue
|
2013-08-29 09:44:11 +00:00
|
|
|
|
2014-07-09 12:46:09 +00:00
|
|
|
|
|
|
|
// === LLDB TESTS ==================================================================================
|
|
|
|
|
|
|
|
// lldb-command:run
|
|
|
|
|
2024-03-15 14:05:57 +00:00
|
|
|
// lldb-command:v s
|
2024-03-10 13:55:58 +00:00
|
|
|
// lldb-check:[...] Struct { a: 1, b: 2.5 }
|
2014-07-09 12:46:09 +00:00
|
|
|
// lldb-command:continue
|
|
|
|
|
2024-03-15 14:05:57 +00:00
|
|
|
// lldb-command:v x
|
2024-03-10 13:55:58 +00:00
|
|
|
// lldb-check:[...] Struct { a: 3, b: 4.5 }
|
2024-03-15 14:05:57 +00:00
|
|
|
// lldb-command:v y
|
2024-03-10 13:55:58 +00:00
|
|
|
// lldb-check:[...] 5
|
2024-03-15 14:05:57 +00:00
|
|
|
// lldb-command:v z
|
2024-03-10 13:55:58 +00:00
|
|
|
// lldb-check:[...] 6.5
|
2014-07-09 12:46:09 +00:00
|
|
|
// lldb-command:continue
|
|
|
|
|
2024-03-15 14:05:57 +00:00
|
|
|
// lldb-command:v a
|
2024-03-10 13:55:58 +00:00
|
|
|
// lldb-check:[...] (7, 8, 9.5, 10.5)
|
2014-07-09 12:46:09 +00:00
|
|
|
// lldb-command:continue
|
|
|
|
|
2024-03-15 14:05:57 +00:00
|
|
|
// lldb-command:v a
|
2024-03-10 13:55:58 +00:00
|
|
|
// lldb-check:[...] Newtype(11.5, 12.5, 13, 14)
|
2014-07-09 12:46:09 +00:00
|
|
|
// lldb-command:continue
|
|
|
|
|
2024-03-15 14:05:57 +00:00
|
|
|
// lldb-command:v x
|
2024-03-10 13:55:58 +00:00
|
|
|
// lldb-check:[...] Case1 { x: 0, y: 8970181431921507452 }
|
2014-07-09 12:46:09 +00:00
|
|
|
// lldb-command:continue
|
|
|
|
|
2015-09-19 20:33:47 +00:00
|
|
|
#![feature(omit_gdb_pretty_printer_section)]
|
2014-12-03 22:48:18 +00:00
|
|
|
#![omit_gdb_pretty_printer_section]
|
|
|
|
|
2014-12-31 04:32:49 +00:00
|
|
|
#[derive(Clone)]
|
2013-08-29 09:44:11 +00:00
|
|
|
struct Struct {
|
2015-03-26 00:06:52 +00:00
|
|
|
a: isize,
|
2013-09-26 06:26:09 +00:00
|
|
|
b: f64
|
2013-08-29 09:44:11 +00:00
|
|
|
}
|
|
|
|
|
2014-12-31 04:32:49 +00:00
|
|
|
#[derive(Clone)]
|
2013-08-29 09:44:11 +00:00
|
|
|
struct StructStruct {
|
|
|
|
a: Struct,
|
|
|
|
b: Struct
|
|
|
|
}
|
|
|
|
|
|
|
|
fn fun(s: Struct) {
|
2014-07-09 12:46:09 +00:00
|
|
|
zzz(); // #break
|
2013-08-29 09:44:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
fn fun_fun(StructStruct { a: x, b: Struct { a: y, b: z } }: StructStruct) {
|
2014-07-09 12:46:09 +00:00
|
|
|
zzz(); // #break
|
2013-08-29 09:44:11 +00:00
|
|
|
}
|
|
|
|
|
2015-03-26 00:06:52 +00:00
|
|
|
fn tup(a: (isize, usize, f64, f64)) {
|
2014-07-09 12:46:09 +00:00
|
|
|
zzz(); // #break
|
2013-08-29 09:44:11 +00:00
|
|
|
}
|
|
|
|
|
2015-03-26 00:06:52 +00:00
|
|
|
struct Newtype(f64, f64, isize, usize);
|
2013-08-29 09:44:11 +00:00
|
|
|
|
|
|
|
fn new_type(a: Newtype) {
|
2014-07-09 12:46:09 +00:00
|
|
|
zzz(); // #break
|
2013-08-29 09:44:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// The first element is to ensure proper alignment, irrespective of the machines word size. Since
|
|
|
|
// the size of the discriminant value is machine dependent, this has be taken into account when
|
|
|
|
// datatype layout should be predictable as in this case.
|
|
|
|
enum Enum {
|
|
|
|
Case1 { x: i64, y: i64 },
|
|
|
|
Case2 (i64, i32, i32),
|
|
|
|
}
|
|
|
|
|
|
|
|
fn by_val_enum(x: Enum) {
|
2014-07-09 12:46:09 +00:00
|
|
|
zzz(); // #break
|
2013-08-29 09:44:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
fun(Struct { a: 1, b: 2.5 });
|
|
|
|
fun_fun(StructStruct { a: Struct { a: 3, b: 4.5 }, b: Struct { a: 5, b: 6.5 } });
|
|
|
|
tup((7, 8, 9.5, 10.5));
|
|
|
|
new_type(Newtype(11.5, 12.5, 13, 14));
|
|
|
|
|
|
|
|
// 0b0111110001111100011111000111110001111100011111000111110001111100 = 8970181431921507452
|
|
|
|
// 0b01111100011111000111110001111100 = 2088533116
|
|
|
|
// 0b0111110001111100 = 31868
|
|
|
|
// 0b01111100 = 124
|
2014-11-06 08:05:53 +00:00
|
|
|
by_val_enum(Enum::Case1 { x: 0, y: 8970181431921507452 });
|
2013-08-29 09:44:11 +00:00
|
|
|
}
|
|
|
|
|
2014-07-09 12:46:09 +00:00
|
|
|
fn zzz() { () }
|