]> git.proxmox.com Git - rustc.git/blob - src/test/debuginfo/generic-function.rs
f1bfc08915edd86258f6e1a0af53dcf2215fffed
[rustc.git] / src / test / debuginfo / generic-function.rs
1 // Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
4 //
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
10
11 // ignore-tidy-linelength
12
13 // min-lldb-version: 310
14
15 // compile-flags:-g
16
17 // === GDB TESTS ===================================================================================
18
19 // gdb-command:run
20
21 // gdb-command:print *t0
22 // gdb-check:$1 = 1
23 // gdb-command:print *t1
24 // gdb-check:$2 = 2.5
25 // gdb-command:print ret
26 // gdbg-check:$3 = {__0 = {__0 = 1, __1 = 2.5}, __1 = {__0 = 2.5, __1 = 1}}
27 // gdbr-check:$3 = ((1, 2.5), (2.5, 1))
28 // gdb-command:continue
29
30 // gdb-command:print *t0
31 // gdb-check:$4 = 3.5
32 // gdb-command:print *t1
33 // gdb-check:$5 = 4
34 // gdb-command:print ret
35 // gdbg-check:$6 = {__0 = {__0 = 3.5, __1 = 4}, __1 = {__0 = 4, __1 = 3.5}}
36 // gdbr-check:$6 = ((3.5, 4), (4, 3.5))
37 // gdb-command:continue
38
39 // gdb-command:print *t0
40 // gdb-check:$7 = 5
41 // gdb-command:print *t1
42 // gdbg-check:$8 = {a = 6, b = 7.5}
43 // gdbr-check:$8 = generic_function::Struct {a: 6, b: 7.5}
44 // gdb-command:print ret
45 // gdbg-check:$9 = {__0 = {__0 = 5, __1 = {a = 6, b = 7.5}}, __1 = {__0 = {a = 6, b = 7.5}, __1 = 5}}
46 // gdbr-check:$9 = ((5, generic_function::Struct {a: 6, b: 7.5}), (generic_function::Struct {a: 6, b: 7.5}, 5))
47 // gdb-command:continue
48
49
50 // === LLDB TESTS ==================================================================================
51
52 // lldb-command:run
53
54 // lldb-command:print *t0
55 // lldb-check:[...]$0 = 1
56 // lldb-command:print *t1
57 // lldb-check:[...]$1 = 2.5
58 // lldb-command:print ret
59 // lldb-check:[...]$2 = ((1, 2.5), (2.5, 1))
60 // lldb-command:continue
61
62 // lldb-command:print *t0
63 // lldb-check:[...]$3 = 3.5
64 // lldb-command:print *t1
65 // lldb-check:[...]$4 = 4
66 // lldb-command:print ret
67 // lldb-check:[...]$5 = ((3.5, 4), (4, 3.5))
68 // lldb-command:continue
69
70 // lldb-command:print *t0
71 // lldb-check:[...]$6 = 5
72 // lldb-command:print *t1
73 // lldb-check:[...]$7 = Struct { a: 6, b: 7.5 }
74 // lldb-command:print ret
75 // lldb-check:[...]$8 = ((5, Struct { a: 6, b: 7.5 }), (Struct { a: 6, b: 7.5 }, 5))
76 // lldb-command:continue
77
78 #![feature(omit_gdb_pretty_printer_section)]
79 #![omit_gdb_pretty_printer_section]
80
81 #[derive(Clone)]
82 struct Struct {
83 a: isize,
84 b: f64
85 }
86
87 fn dup_tup<T0: Clone, T1: Clone>(t0: &T0, t1: &T1) -> ((T0, T1), (T1, T0)) {
88 let ret = ((t0.clone(), t1.clone()), (t1.clone(), t0.clone()));
89 zzz(); // #break
90 ret
91 }
92
93 fn main() {
94
95 let _ = dup_tup(&1, &2.5f64);
96 let _ = dup_tup(&3.5f64, &4_u16);
97 let _ = dup_tup(&5, &Struct { a: 6, b: 7.5 });
98 }
99
100 fn zzz() {()}