]> git.proxmox.com Git - rustc.git/blame - src/test/debuginfo/generic-function.rs
New upstream version 1.49.0+dfsg1
[rustc.git] / src / test / debuginfo / generic-function.rs
CommitLineData
1a4d82fc
JJ
1// min-lldb-version: 310
2
3// compile-flags:-g
4
5// === GDB TESTS ===================================================================================
6
7// gdb-command:run
8
9// gdb-command:print *t0
10// gdb-check:$1 = 1
11// gdb-command:print *t1
12// gdb-check:$2 = 2.5
1a4d82fc
JJ
13// gdb-command:continue
14
15// gdb-command:print *t0
72b1a166 16// gdb-check:$3 = 3.5
1a4d82fc 17// gdb-command:print *t1
72b1a166 18// gdb-check:$4 = 4
1a4d82fc
JJ
19// gdb-command:continue
20
21// gdb-command:print *t0
72b1a166 22// gdb-check:$5 = 5
1a4d82fc 23// gdb-command:print *t1
72b1a166
FG
24// gdbg-check:$6 = {a = 6, b = 7.5}
25// gdbr-check:$6 = generic_function::Struct {a: 6, b: 7.5}
1a4d82fc
JJ
26// gdb-command:continue
27
1a4d82fc
JJ
28// === LLDB TESTS ==================================================================================
29
30// lldb-command:run
31
32// lldb-command:print *t0
0bf4aa26
XL
33// lldbg-check:[...]$0 = 1
34// lldbr-check:(i32) *t0 = 1
1a4d82fc 35// lldb-command:print *t1
0bf4aa26
XL
36// lldbg-check:[...]$1 = 2.5
37// lldbr-check:(f64) *t1 = 2.5
1a4d82fc
JJ
38// lldb-command:continue
39
40// lldb-command:print *t0
72b1a166 41// lldbg-check:[...]$2 = 3.5
0bf4aa26 42// lldbr-check:(f64) *t0 = 3.5
1a4d82fc 43// lldb-command:print *t1
72b1a166 44// lldbg-check:[...]$3 = 4
0bf4aa26 45// lldbr-check:(u16) *t1 = 4
1a4d82fc
JJ
46// lldb-command:continue
47
48// lldb-command:print *t0
72b1a166 49// lldbg-check:[...]$4 = 5
0bf4aa26 50// lldbr-check:(i32) *t0 = 5
1a4d82fc 51// lldb-command:print *t1
72b1a166
FG
52// lldbg-check:[...]$5 = { a = 6 b = 7.5 }
53// lldbr-check:(generic_function::Struct) *t1 = { a = 6 b = 7.5 }
1a4d82fc
JJ
54// lldb-command:continue
55
b039eaaf 56#![feature(omit_gdb_pretty_printer_section)]
1a4d82fc
JJ
57#![omit_gdb_pretty_printer_section]
58
59#[derive(Clone)]
60struct Struct {
c34b1796 61 a: isize,
1a4d82fc
JJ
62 b: f64
63}
64
65fn dup_tup<T0: Clone, T1: Clone>(t0: &T0, t1: &T1) -> ((T0, T1), (T1, T0)) {
66 let ret = ((t0.clone(), t1.clone()), (t1.clone(), t0.clone()));
67 zzz(); // #break
68 ret
69}
70
71fn main() {
72
85aaf69f 73 let _ = dup_tup(&1, &2.5f64);
1a4d82fc 74 let _ = dup_tup(&3.5f64, &4_u16);
85aaf69f 75 let _ = dup_tup(&5, &Struct { a: 6, b: 7.5 });
1a4d82fc
JJ
76}
77
78fn zzz() {()}