From 73436a7233e5a6ce2b2f98ee9747662eaeadb082 Mon Sep 17 00:00:00 2001 From: fukatani Date: Tue, 7 Aug 2018 22:05:32 +0900 Subject: [PATCH] add gdb test for std::collections --- src/test/debuginfo/pretty-std-collections.rs | 50 ++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 src/test/debuginfo/pretty-std-collections.rs diff --git a/src/test/debuginfo/pretty-std-collections.rs b/src/test/debuginfo/pretty-std-collections.rs new file mode 100644 index 00000000000..ca01b823b44 --- /dev/null +++ b/src/test/debuginfo/pretty-std-collections.rs @@ -0,0 +1,50 @@ +// Copyright 2018 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 or the MIT license +// , 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 btree_set +// gdb-check:$1 = BTreeSet with 3 elements = {[0] = 3, [1] = 5, [2] = 7} + +// gdb-command: print vec_deque +// gdb-check:$2 = VecDeque(len: 3, cap: 8) = {5, 3, 7} + +#![allow(unused_variables)] +use std::collections::BTreeSet; +use std::collections::VecDeque; + + +fn main() { + + // BTreeSet + let mut btree_set = BTreeSet::new(); + btree_set.insert(5); + btree_set.insert(3); + btree_set.insert(7); + + // VecDeque + let mut vec_deque = VecDeque::new(); + vec_deque.push_back(5); + vec_deque.push_back(3); + vec_deque.push_back(7); + + zzz(); // #break +} + +fn zzz() { () }