rust/src/test/debuginfo/rc_arc.rs
ortem 47c26e69a9 Implement new gdb/lldb pretty-printers
Replace old GDB and LLDB pretty-printers with new ones
which were originally written for IntelliJ Rust.
New LLDB pretty-printers support synthetic children.
New GDB/LLDB pretty-printers support all Rust types
supported by old pretty-printers, and also support:
Rc, Arc, Cell, Ref, RefCell, RefMut, HashMap, HashSet.
2020-06-09 16:13:11 +03:00

37 lines
914 B
Rust

// compile-flags:-g
// min-gdb-version: 8.1
// === GDB TESTS ==================================================================================
// gdb-command:run
// gdb-command:print r
// gdb-check:[...]$1 = Rc(strong=2, weak=1) = {value = 42, strong = 2, weak = 1}
// gdb-command:print a
// gdb-check:[...]$2 = Arc(strong=2, weak=1) = {value = 42, strong = 2, weak = 1}
// === LLDB TESTS ==================================================================================
// lldb-command:run
// lldb-command:print r
// lldb-check:[...]$0 = strong=2, weak=1 { value = 42 }
// lldb-command:print a
// lldb-check:[...]$1 = strong=2, weak=1 { data = 42 }
use std::rc::Rc;
use std::sync::Arc;
fn main() {
let r = Rc::new(42);
let r1 = Rc::clone(&r);
let w1 = Rc::downgrade(&r);
let a = Arc::new(42);
let a1 = Arc::clone(&a);
let w2 = Arc::downgrade(&a);
print!(""); // #break
}