]> git.lizzy.rs Git - rust.git/blob - src/test/debuginfo/closure-in-generic-function.rs
Rollup merge of #77368 - est31:apfloat_fix, r=varkor
[rust.git] / src / test / debuginfo / closure-in-generic-function.rs
1 // min-lldb-version: 310
2
3 // compile-flags:-g
4
5 // === GDB TESTS ===================================================================================
6
7 // gdb-command:run
8
9 // gdb-command:print x
10 // gdb-check:$1 = 0.5
11 // gdb-command:print y
12 // gdb-check:$2 = 10
13 // gdb-command:continue
14
15 // gdb-command:print *x
16 // gdb-check:$3 = 29
17 // gdb-command:print *y
18 // gdb-check:$4 = 110
19 // gdb-command:continue
20
21
22 // === LLDB TESTS ==================================================================================
23
24 // lldb-command:run
25
26 // lldb-command:print x
27 // lldbg-check:[...]$0 = 0.5
28 // lldbr-check:(f64) x = 0.5
29 // lldb-command:print y
30 // lldbg-check:[...]$1 = 10
31 // lldbr-check:(i32) y = 10
32 // lldb-command:continue
33
34 // lldb-command:print *x
35 // lldbg-check:[...]$2 = 29
36 // lldbr-check:(i32) *x = 29
37 // lldb-command:print *y
38 // lldbg-check:[...]$3 = 110
39 // lldbr-check:(i32) *y = 110
40 // lldb-command:continue
41
42 #![feature(box_syntax)]
43 #![feature(omit_gdb_pretty_printer_section)]
44 #![omit_gdb_pretty_printer_section]
45
46 fn some_generic_fun<T1, T2>(a: T1, b: T2) -> (T2, T1) {
47
48     let closure = |x, y| {
49         zzz(); // #break
50         (y, x)
51     };
52
53     closure(a, b)
54 }
55
56 fn main() {
57     some_generic_fun(0.5f64, 10);
58     some_generic_fun(&29, Box::new(110));
59 }
60
61 fn zzz() { () }