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
29 // gdb-command:print closure_local
31 // gdb-command:continue
33 // gdb-command:print variable
35 // gdb-command:print constant
37 // gdb-command:print a_struct
38 // gdb-check:$9 = {a = -3, b = 4.5, c = 5}
39 // gdb-command:print *struct_ref
40 // gdb-check:$10 = {a = -3, b = 4.5, c = 5}
41 // gdb-command:print *owned
43 // gdb-command:print closure_local
45 // gdb-command:continue
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
62 // lldb-command:print closure_local
63 // lldb-check:[...]$5 = 8
64 // lldb-command:continue
66 // lldb-command:print variable
67 // lldb-check:[...]$6 = 1
68 // lldb-command:print constant
69 // lldb-check:[...]$7 = 2
70 // lldb-command:print a_struct
71 // lldb-check:[...]$8 = Struct { a: -3, b: 4.5, c: 5 }
72 // lldb-command:print *struct_ref
73 // lldb-check:[...]$9 = Struct { a: -3, b: 4.5, c: 5 }
74 // lldb-command:print *owned
75 // lldb-check:[...]$10 = 6
76 // lldb-command:print closure_local
77 // lldb-check:[...]$11 = 8
78 // lldb-command:continue
80 #![allow(unused_variables)]
81 #![feature(box_syntax)]
82 #![feature(omit_gdb_pretty_printer_section)]
83 #![omit_gdb_pretty_printer_section]
95 let a_struct = Struct {
101 let struct_ref = &a_struct;
102 let owned: Box<_> = box 6;
104 let mut closure = || {
105 let closure_local = 8;
107 let mut nested_closure = || {
109 variable = constant + a_struct.a + struct_ref.a + *owned + closure_local;