diff options
| author | bors <bors@rust-lang.org> | 2016-07-04 15:09:36 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-07-04 15:09:36 -0700 |
| commit | d7ef1ac0d0d74b54404c579c1ed9cb8e43d7a0fb (patch) | |
| tree | 5d74eedc6ab8fee81444e78bbf2f0e21d65919ef /src/test/debuginfo | |
| parent | e7cf491d22dbc2b97021e6eaa34eba8588d2ac86 (diff) | |
| parent | 5de76afcfda5d167ece05cf020dc77c5e3ea4a3c (diff) | |
| download | rust-d7ef1ac0d0d74b54404c579c1ed9cb8e43d7a0fb.tar.gz rust-d7ef1ac0d0d74b54404c579c1ed9cb8e43d7a0fb.zip | |
Auto merge of #34639 - dzamlo:master, r=michaelwoerister
Use lazy iterator in vec/slice gdb pretty printers
Diffstat (limited to 'src/test/debuginfo')
| -rw-r--r-- | src/test/debuginfo/pretty-huge-vec.rs | 41 | ||||
| -rw-r--r-- | src/test/debuginfo/pretty-uninitialized-vec.rs | 36 |
2 files changed, 77 insertions, 0 deletions
diff --git a/src/test/debuginfo/pretty-huge-vec.rs b/src/test/debuginfo/pretty-huge-vec.rs new file mode 100644 index 00000000000..bb538523523 --- /dev/null +++ b/src/test/debuginfo/pretty-huge-vec.rs @@ -0,0 +1,41 @@ +// Copyright 2013-2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or +// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license +// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// ignore-windows failing on win32 bot +// ignore-freebsd: gdb package too new +// ignore-android: FIXME(#10381) +// compile-flags:-g +// min-gdb-version 7.7 +// min-lldb-version: 310 + +// === GDB TESTS =================================================================================== + +// gdb-command: run + +// gdb-command: print vec +// gdb-check:$1 = Vec<u8>(len: 1000000000, cap: 1000000000) = {[...]...} + +// gdb-command: print slice +// gdb-check:$2 = &[u8](len: 1000000000) = {[...]...} + + +#![allow(unused_variables)] + +fn main() { + + // Vec + let mut vec: Vec<u8> = Vec::with_capacity(1_000_000_000); + unsafe{ vec.set_len(1_000_000_000) } + let slice = &vec[..]; + + zzz(); // #break +} + +fn zzz() { () } diff --git a/src/test/debuginfo/pretty-uninitialized-vec.rs b/src/test/debuginfo/pretty-uninitialized-vec.rs new file mode 100644 index 00000000000..75169658fe6 --- /dev/null +++ b/src/test/debuginfo/pretty-uninitialized-vec.rs @@ -0,0 +1,36 @@ +// Copyright 2013-2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or +// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license +// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// ignore-windows failing on win32 bot +// ignore-freebsd: gdb package too new +// ignore-android: FIXME(#10381) +// compile-flags:-g +// min-gdb-version 7.7 +// min-lldb-version: 310 + +// === GDB TESTS =================================================================================== + +// gdb-command: run + +// gdb-command: print vec +// gdb-check:$1 = Vec<i32>(len: [...], cap: [...])[...] + + +#![allow(unused_variables)] + +fn main() { + + let vec; + zzz(); // #break + vec = vec![0]; + +} + +fn zzz() { () } |
