1 // min-lldb-version: 310
5 // === GDB TESTS ===================================================================================
9 // gdb-command:print variable
11 // gdb-command:print constant
13 // gdb-command:print a_struct
14 // gdbg-check:$3 = {a = -3, b = 4.5, c = 5}
15 // gdbr-check:$3 = var_captured_in_nested_closure::Struct {a: -3, b: 4.5, c: 5}
16 // gdb-command:print *struct_ref
17 // gdbg-check:$4 = {a = -3, b = 4.5, c = 5}
18 // gdbr-check:$4 = var_captured_in_nested_closure::Struct {a: -3, b: 4.5, c: 5}
19 // gdb-command:print *owned
21 // gdb-command:print closure_local
23 // gdb-command:continue
25 // gdb-command:print variable
27 // gdb-command:print constant
29 // gdb-command:print a_struct
30 // gdbg-check:$9 = {a = -3, b = 4.5, c = 5}
31 // gdbr-check:$9 = var_captured_in_nested_closure::Struct {a: -3, b: 4.5, c: 5}
32 // gdb-command:print *struct_ref
33 // gdbg-check:$10 = {a = -3, b = 4.5, c = 5}
34 // gdbr-check:$10 = var_captured_in_nested_closure::Struct {a: -3, b: 4.5, c: 5}
35 // gdb-command:print *owned
37 // gdb-command:print closure_local
39 // gdb-command:continue
42 // === LLDB TESTS ==================================================================================
46 // lldb-command:print variable
47 // lldbg-check:[...]$0 = 1
48 // lldbr-check:(isize) variable = 1
49 // lldb-command:print constant
50 // lldbg-check:[...]$1 = 2
51 // lldbr-check:(isize) constant = 2
52 // lldb-command:print a_struct
53 // lldbg-check:[...]$2 = Struct { a: -3, b: 4.5, c: 5 }
54 // lldbr-check:(var_captured_in_nested_closure::Struct) a_struct = Struct { a: -3, b: 4.5, c: 5 }
55 // lldb-command:print *struct_ref
56 // lldbg-check:[...]$3 = Struct { a: -3, b: 4.5, c: 5 }
57 // lldbr-check:(var_captured_in_nested_closure::Struct) *struct_ref = Struct { a: -3, b: 4.5, c: 5 }
58 // lldb-command:print *owned
59 // lldbg-check:[...]$4 = 6
60 // lldbr-check:(isize) *owned = 6
61 // lldb-command:print closure_local
62 // lldbg-check:[...]$5 = 8
63 // lldbr-check:(isize) closure_local = 8
64 // lldb-command:continue
66 // lldb-command:print variable
67 // lldbg-check:[...]$6 = 1
68 // lldbr-check:(isize) variable = 1
69 // lldb-command:print constant
70 // lldbg-check:[...]$7 = 2
71 // lldbr-check:(isize) constant = 2
72 // lldb-command:print a_struct
73 // lldbg-check:[...]$8 = Struct { a: -3, b: 4.5, c: 5 }
74 // lldbr-check:(var_captured_in_nested_closure::Struct) a_struct = Struct { a: -3, b: 4.5, c: 5 }
75 // lldb-command:print *struct_ref
76 // lldbg-check:[...]$9 = Struct { a: -3, b: 4.5, c: 5 }
77 // lldbr-check:(var_captured_in_nested_closure::Struct) *struct_ref = Struct { a: -3, b: 4.5, c: 5 }
78 // lldb-command:print *owned
79 // lldbg-check:[...]$10 = 6
80 // lldbr-check:(isize) *owned = 6
81 // lldb-command:print closure_local
82 // lldbg-check:[...]$11 = 8
83 // lldbr-check:(isize) closure_local = 8
84 // lldb-command:continue
86 #![allow(unused_variables)]
87 #![feature(box_syntax)]
88 #![feature(omit_gdb_pretty_printer_section)]
89 #![omit_gdb_pretty_printer_section]
101 let a_struct = Struct {
107 let struct_ref = &a_struct;
108 let owned: Box<_> = box 6;
110 let mut closure = || {
111 let closure_local = 8;
113 let mut nested_closure = || {
115 variable = constant + a_struct.a + struct_ref.a + *owned + closure_local;