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 constant
21 // gdb-command:print a_struct
22 // gdb-check:$2 = {a = -2, b = 3.5, c = 4}
23 // gdb-command:print *owned
25 // gdb-command:continue
27 // gdb-command:print constant2
29 // gdb-command:continue
31 // === LLDB TESTS ==================================================================================
35 // lldb-command:print constant
36 // lldb-check:[...]$0 = 1
37 // lldb-command:print a_struct
38 // lldb-check:[...]$1 = Struct { a: -2, b: 3.5, c: 4 }
39 // lldb-command:print *owned
40 // lldb-check:[...]$2 = 5
42 #![allow(unused_variables)]
43 #![feature(unboxed_closures, box_syntax)]
44 #![feature(omit_gdb_pretty_printer_section)]
45 #![omit_gdb_pretty_printer_section]
56 let a_struct = Struct {
62 let owned: Box<_> = box 5;
64 let closure = move || {
66 do_something(&constant, &a_struct.a, &*owned);
71 let constant2 = 6_usize;
73 // The `self` argument of the following closure should be passed by value
74 // to FnOnce::call_once(self, args), which gets translated a bit differently
75 // than the regular case. Let's make sure this is supported too.
76 let immedate_env = move || {
84 fn do_something(_: &isize, _:&isize, _:&isize) {