]> git.proxmox.com Git - rustc.git/blame - src/test/debuginfo/union-smoke.rs
Update unsuspicious file list
[rustc.git] / src / test / debuginfo / union-smoke.rs
CommitLineData
9e0c209e 1// min-lldb-version: 310
2c00a5a8
XL
2// ignore-gdb // Test temporarily ignored due to debuginfo tests being disabled, see PR 47155
3
8bb4bdeb 4// ignore-gdb-version: 7.11.90 - 7.12.9
9e0c209e
SL
5
6// compile-flags:-g
7
8// === GDB TESTS ===================================================================================
9
10// gdb-command:run
11// gdb-command:print u
c30ab7b3
SL
12// gdbg-check:$1 = {a = {__0 = 2 '\002', __1 = 2 '\002'}, b = 514}
13// gdbr-check:$1 = union_smoke::U {a: (2, 2), b: 514}
9e0c209e 14// gdb-command:print union_smoke::SU
c30ab7b3
SL
15// gdbg-check:$2 = {a = {__0 = 1 '\001', __1 = 1 '\001'}, b = 257}
16// gdbr-check:$2 = union_smoke::U {a: (1, 1), b: 257}
9e0c209e
SL
17
18// === LLDB TESTS ==================================================================================
19
20// lldb-command:run
21// lldb-command:print u
f035d41b
XL
22// lldbg-check:[...]$0 = { a = { 0 = '\x02' 1 = '\x02' } b = 514 }
23// lldbr-check:(union_smoke::U) u = { a = { 0 = '\x02' 1 = '\x02' } b = 514 }
0bf4aa26
XL
24
25// Don't test this with rust-enabled lldb for now; see
26// https://github.com/rust-lang-nursery/lldb/issues/18
27// lldbg-command:print union_smoke::SU
f035d41b 28// lldbg-check:[...]$1 = { a = { 0 = '\x01' 1 = '\x01' } b = 257 }
9e0c209e
SL
29
30#![allow(unused)]
31#![feature(omit_gdb_pretty_printer_section)]
32#![omit_gdb_pretty_printer_section]
9e0c209e
SL
33
34union U {
35 a: (u8, u8),
36 b: u16,
37}
38
39static mut SU: U = U { a: (1, 1) };
40
41fn main() {
42 let u = U { b: (2 << 8) + 2 };
43 unsafe { SU = U { a: (1, 1) } }
44
45 zzz(); // #break
46}
47
48fn zzz() {()}