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.
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.
11 // min-lldb-version: 310
15 // === GDB TESTS ===================================================================================
19 // gdb-command:print variable
21 // gdb-command:print constant
23 // gdb-command:print a_struct
24 // gdbg-check:$3 = {a = -3, b = 4.5, c = 5}
25 // gdbr-check:$3 = var_captured_in_stack_closure::Struct {a: -3, b: 4.5, c: 5}
26 // gdb-command:print *struct_ref
27 // gdbg-check:$4 = {a = -3, b = 4.5, c = 5}
28 // gdbr-check:$4 = var_captured_in_stack_closure::Struct {a: -3, b: 4.5, c: 5}
29 // gdb-command:print *owned
32 // gdb-command:continue
34 // gdb-command:print variable
36 // gdb-command:print constant
38 // gdb-command:print a_struct
39 // gdbg-check:$8 = {a = -3, b = 4.5, c = 5}
40 // gdbr-check:$8 = var_captured_in_stack_closure::Struct {a: -3, b: 4.5, c: 5}
41 // gdb-command:print *struct_ref
42 // gdbg-check:$9 = {a = -3, b = 4.5, c = 5}
43 // gdbr-check:$9 = var_captured_in_stack_closure::Struct {a: -3, b: 4.5, c: 5}
44 // gdb-command:print *owned
48 // === LLDB TESTS ==================================================================================
52 // lldb-command:print variable
53 // lldb-check:[...]$0 = 1
54 // lldb-command:print constant
55 // lldb-check:[...]$1 = 2
56 // lldb-command:print a_struct
57 // lldb-check:[...]$2 = Struct { a: -3, b: 4.5, c: 5 }
58 // lldb-command:print *struct_ref
59 // lldb-check:[...]$3 = Struct { a: -3, b: 4.5, c: 5 }
60 // lldb-command:print *owned
61 // lldb-check:[...]$4 = 6
63 // lldb-command:continue
65 // lldb-command:print variable
66 // lldb-check:[...]$5 = 2
67 // lldb-command:print constant
68 // lldb-check:[...]$6 = 2
69 // lldb-command:print a_struct
70 // lldb-check:[...]$7 = Struct { a: -3, b: 4.5, c: 5 }
71 // lldb-command:print *struct_ref
72 // lldb-check:[...]$8 = Struct { a: -3, b: 4.5, c: 5 }
73 // lldb-command:print *owned
74 // lldb-check:[...]$9 = 6
76 #![feature(box_syntax)]
77 #![allow(unused_variables)]
78 #![feature(omit_gdb_pretty_printer_section)]
79 #![omit_gdb_pretty_printer_section]
91 let a_struct = Struct {
97 let struct_ref = &a_struct;
98 let owned: Box<_> = box 6;
101 let mut first_closure = || {
103 variable = constant + a_struct.a + struct_ref.a + *owned;
110 let mut second_closure = || {
112 variable = constant + a_struct.a + struct_ref.a + *owned;