]> git.proxmox.com Git - rustc.git/blob - src/test/debuginfo/gdb-pretty-std.rs
1da9a06b0eea4cea1b3300c13a032168ffa122f0
[rustc.git] / src / test / debuginfo / gdb-pretty-std.rs
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
13 // ignore-lldb
14 // ignore-android: FIXME(#10381)
15 // compile-flags:-g
16 // min-gdb-version 7.7
17
18 // gdb-command: run
19
20 // gdb-command: print slice
21 // gdb-check:$1 = &[i32](len: 4) = {0, 1, 2, 3}
22
23 // gdb-command: print vec
24 // gdb-check:$2 = Vec<u64>(len: 4, cap: [...]) = {4, 5, 6, 7}
25
26 // gdb-command: print str_slice
27 // gdb-check:$3 = "IAMA string slice!"
28
29 // gdb-command: print string
30 // gdb-check:$4 = "IAMA string!"
31
32 // gdb-command: print some
33 // gdb-check:$5 = Some = {8}
34
35 // gdb-command: print none
36 // gdb-check:$6 = None
37
38 fn main() {
39
40 // &[]
41 let slice: &[i32] = &[0, 1, 2, 3];
42
43 // Vec
44 let vec = vec![4u64, 5, 6, 7];
45
46 // &str
47 let str_slice = "IAMA string slice!";
48
49 // String
50 let string = "IAMA string!".to_string();
51
52 // Option
53 let some = Some(8i16);
54 let none: Option<i64> = None;
55
56 zzz(); // #break
57 }
58
59 fn zzz() { () }