rust/tests/debuginfo/union-smoke.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

39 lines
917 B
Rust
Raw Normal View History

2016-08-22 13:11:22 -05:00
//@ compile-flags:-g
// === GDB TESTS ===================================================================================
// gdb-command:run
// gdb-command:print u
2024-08-17 16:31:49 -05:00
// gdb-check:$1 = union_smoke::U {a: (2, 2), b: 514}
2016-08-22 13:11:22 -05:00
// gdb-command:print union_smoke::SU
2024-08-17 16:31:49 -05:00
// gdb-check:$2 = union_smoke::U {a: (1, 1), b: 257}
2016-08-22 13:11:22 -05:00
// === LLDB TESTS ==================================================================================
// lldb-command:run
// lldb-command:v u
2024-08-18 16:00:33 -05:00
// lldb-check:[...] { a = { 0 = '\x02' 1 = '\x02' } b = 514 }
2024-08-18 16:00:33 -05:00
// lldb-command:print union_smoke::SU
// lldb-check:[...] { 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() {()}