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