Skip to content

Commit 73436a7

Browse files
committed
add gdb test for std::collections
1 parent b6d4d40 commit 73436a7

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
// Copyright 2018 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-android: FIXME(#10381)
14+
// compile-flags:-g
15+
// min-gdb-version 7.7
16+
// min-lldb-version: 310
17+
18+
// === GDB TESTS ===================================================================================
19+
20+
// gdb-command: run
21+
22+
// gdb-command: print btree_set
23+
// gdb-check:$1 = BTreeSet<i32> with 3 elements = {[0] = 3, [1] = 5, [2] = 7}
24+
25+
// gdb-command: print vec_deque
26+
// gdb-check:$2 = VecDeque<i32>(len: 3, cap: 8) = {5, 3, 7}
27+
28+
#![allow(unused_variables)]
29+
use std::collections::BTreeSet;
30+
use std::collections::VecDeque;
31+
32+
33+
fn main() {
34+
35+
// BTreeSet
36+
let mut btree_set = BTreeSet::new();
37+
btree_set.insert(5);
38+
btree_set.insert(3);
39+
btree_set.insert(7);
40+
41+
// VecDeque
42+
let mut vec_deque = VecDeque::new();
43+
vec_deque.push_back(5);
44+
vec_deque.push_back(3);
45+
vec_deque.push_back(7);
46+
47+
zzz(); // #break
48+
}
49+
50+
fn zzz() { () }

0 commit comments

Comments
 (0)