2016-08-22 13:11:22 -05:00
|
|
|
// min-lldb-version: 310
|
2018-01-03 12:24:25 -06:00
|
|
|
// ignore-gdb // Test temporarily ignored due to debuginfo tests being disabled, see PR 47155
|
|
|
|
|
2017-02-04 04:44:29 -06:00
|
|
|
// ignore-gdb-version: 7.11.90 - 7.12.9
|
2016-08-22 13:11:22 -05:00
|
|
|
|
|
|
|
// compile-flags:-g
|
|
|
|
|
|
|
|
// === GDB TESTS ===================================================================================
|
|
|
|
|
|
|
|
// gdb-command:run
|
|
|
|
// gdb-command:print u
|
2016-10-25 16:32:04 -05:00
|
|
|
// gdbg-check:$1 = {a = {__0 = 2 '\002', __1 = 2 '\002'}, b = 514}
|
|
|
|
// gdbr-check:$1 = union_smoke::U {a: (2, 2), b: 514}
|
2016-08-22 13:11:22 -05:00
|
|
|
// gdb-command:print union_smoke::SU
|
2016-10-25 16:32:04 -05:00
|
|
|
// gdbg-check:$2 = {a = {__0 = 1 '\001', __1 = 1 '\001'}, b = 257}
|
|
|
|
// gdbr-check:$2 = union_smoke::U {a: (1, 1), b: 257}
|
2016-08-22 13:11:22 -05:00
|
|
|
|
|
|
|
// === LLDB TESTS ==================================================================================
|
|
|
|
|
|
|
|
// lldb-command:run
|
2016-08-26 11:23:42 -05:00
|
|
|
// lldb-command:print u
|
2019-05-14 07:50:58 -05:00
|
|
|
// lldbg-check:[...]$0 = { a = { 0 = '\x02' 1 = '\x02' } b = 514 }
|
|
|
|
// lldbr-check:(union_smoke::U) u = { a = { 0 = '\x02' 1 = '\x02' } b = 514 }
|
2018-10-02 11:13:30 -05:00
|
|
|
|
|
|
|
// Don't test this with rust-enabled lldb for now; see
|
|
|
|
// https://github.com/rust-lang-nursery/lldb/issues/18
|
|
|
|
// lldbg-command:print union_smoke::SU
|
2019-05-14 07:50:58 -05:00
|
|
|
// lldbg-check:[...]$1 = { a = { 0 = '\x01' 1 = '\x01' } b = 257 }
|
2016-08-22 13:11:22 -05:00
|
|
|
|
|
|
|
#![allow(unused)]
|
|
|
|
#![feature(omit_gdb_pretty_printer_section)]
|
|
|
|
#![omit_gdb_pretty_printer_section]
|
|
|
|
|
|
|
|
union U {
|
2016-08-26 11:23:42 -05:00
|
|
|
a: (u8, u8),
|
|
|
|
b: u16,
|
2016-08-22 13:11:22 -05:00
|
|
|
}
|
|
|
|
|
2016-08-26 11:23:42 -05:00
|
|
|
static mut SU: U = U { a: (1, 1) };
|
2016-08-22 13:11:22 -05:00
|
|
|
|
|
|
|
fn main() {
|
2016-08-26 11:23:42 -05:00
|
|
|
let u = U { b: (2 << 8) + 2 };
|
|
|
|
unsafe { SU = U { a: (1, 1) } }
|
2016-08-22 13:11:22 -05:00
|
|
|
|
|
|
|
zzz(); // #break
|
|
|
|
}
|
|
|
|
|
|
|
|
fn zzz() {()}
|