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 // gdb-check:$3 = {a = -3, b = 4.5, c = 5}
25 // gdb-command:print *struct_ref
26 // gdb-check:$4 = {a = -3, b = 4.5, c = 5}
27 // gdb-command:print *owned
30 // gdb-command:continue
32 // gdb-command:print variable
34 // gdb-command:print constant
36 // gdb-command:print a_struct
37 // gdb-check:$8 = {a = -3, b = 4.5, c = 5}
38 // gdb-command:print *struct_ref
39 // gdb-check:$9 = {a = -3, b = 4.5, c = 5}
40 // gdb-command:print *owned
44 // === LLDB TESTS ==================================================================================
48 // lldb-command:print variable
49 // lldb-check:[...]$0 = 1
50 // lldb-command:print constant
51 // lldb-check:[...]$1 = 2
52 // lldb-command:print a_struct
53 // lldb-check:[...]$2 = Struct { a: -3, b: 4.5, c: 5 }
54 // lldb-command:print *struct_ref
55 // lldb-check:[...]$3 = Struct { a: -3, b: 4.5, c: 5 }
56 // lldb-command:print *owned
57 // lldb-check:[...]$4 = 6
59 // lldb-command:continue
61 // lldb-command:print variable
62 // lldb-check:[...]$5 = 2
63 // lldb-command:print constant
64 // lldb-check:[...]$6 = 2
65 // lldb-command:print a_struct
66 // lldb-check:[...]$7 = Struct { a: -3, b: 4.5, c: 5 }
67 // lldb-command:print *struct_ref
68 // lldb-check:[...]$8 = Struct { a: -3, b: 4.5, c: 5 }
69 // lldb-command:print *owned
70 // lldb-check:[...]$9 = 6
72 #![feature(unboxed_closures, box_syntax)]
73 #![allow(unused_variables)]
74 #![feature(omit_gdb_pretty_printer_section)]
75 #![omit_gdb_pretty_printer_section]
87 let a_struct = Struct {
93 let struct_ref = &a_struct;
94 let owned: Box<_> = box 6;
97 let mut first_closure = || {
99 variable = constant + a_struct.a + struct_ref.a + *owned;
106 let mut second_closure = || {
108 variable = constant + a_struct.a + struct_ref.a + *owned;