]>
Commit | Line | Data |
---|---|---|
c34b1796 AL |
1 | // Copyright 2013-2015 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. | |
4 | // | |
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. | |
10 | ||
11 | // ignore-windows failing on win32 bot | |
12 | // ignore-freebsd: gdb package too new | |
c34b1796 AL |
13 | // ignore-android: FIXME(#10381) |
14 | // compile-flags:-g | |
15 | // min-gdb-version 7.7 | |
62682a34 SL |
16 | // min-lldb-version: 310 |
17 | ||
18 | // === GDB TESTS =================================================================================== | |
c34b1796 AL |
19 | |
20 | // gdb-command: run | |
21 | ||
22 | // gdb-command: print slice | |
23 | // gdb-check:$1 = &[i32](len: 4) = {0, 1, 2, 3} | |
24 | ||
25 | // gdb-command: print vec | |
26 | // gdb-check:$2 = Vec<u64>(len: 4, cap: [...]) = {4, 5, 6, 7} | |
27 | ||
28 | // gdb-command: print str_slice | |
29 | // gdb-check:$3 = "IAMA string slice!" | |
30 | ||
31 | // gdb-command: print string | |
32 | // gdb-check:$4 = "IAMA string!" | |
33 | ||
34 | // gdb-command: print some | |
35 | // gdb-check:$5 = Some = {8} | |
36 | ||
37 | // gdb-command: print none | |
c30ab7b3 SL |
38 | // gdbg-check:$6 = None |
39 | // gdbr-check:$6 = core::option::Option::None | |
c34b1796 | 40 | |
041b39d2 XL |
41 | // gdb-command: print os_string |
42 | // gdb-check:$7 = "IAMA OS string 😃" | |
43 | ||
44 | // gdb-command: print some_string | |
45 | // gdb-check:$8 = Some = {"IAMA optional string!"} | |
46 | ||
62682a34 SL |
47 | |
48 | // === LLDB TESTS ================================================================================== | |
49 | ||
50 | // lldb-command: run | |
51 | ||
52 | // lldb-command: print slice | |
53 | // lldb-check:[...]$0 = &[0, 1, 2, 3] | |
54 | ||
55 | // lldb-command: print vec | |
56 | // lldb-check:[...]$1 = vec![4, 5, 6, 7] | |
57 | ||
58 | // lldb-command: print str_slice | |
59 | // lldb-check:[...]$2 = "IAMA string slice!" | |
60 | ||
61 | // lldb-command: print string | |
62 | // lldb-check:[...]$3 = "IAMA string!" | |
63 | ||
64 | // lldb-command: print some | |
65 | // lldb-check:[...]$4 = Some(8) | |
66 | ||
67 | // lldb-command: print none | |
68 | // lldb-check:[...]$5 = None | |
69 | ||
70 | ||
d9579d0f | 71 | #![allow(unused_variables)] |
041b39d2 XL |
72 | use std::ffi::OsString; |
73 | ||
d9579d0f | 74 | |
c34b1796 AL |
75 | fn main() { |
76 | ||
77 | // &[] | |
78 | let slice: &[i32] = &[0, 1, 2, 3]; | |
79 | ||
80 | // Vec | |
81 | let vec = vec![4u64, 5, 6, 7]; | |
82 | ||
83 | // &str | |
84 | let str_slice = "IAMA string slice!"; | |
85 | ||
86 | // String | |
87 | let string = "IAMA string!".to_string(); | |
88 | ||
041b39d2 XL |
89 | // OsString |
90 | let os_string = OsString::from("IAMA OS string \u{1F603}"); | |
91 | ||
c34b1796 AL |
92 | // Option |
93 | let some = Some(8i16); | |
94 | let none: Option<i64> = None; | |
95 | ||
041b39d2 XL |
96 | let some_string = Some("IAMA optional string!".to_owned()); |
97 | ||
c34b1796 AL |
98 | zzz(); // #break |
99 | } | |
100 | ||
101 | fn zzz() { () } |