]> git.lizzy.rs Git - rust.git/blob - src/test/debuginfo/rc_arc.rs
Rollup merge of #77368 - est31:apfloat_fix, r=varkor
[rust.git] / src / test / debuginfo / rc_arc.rs
1 // ignore-windows pretty-printers are not loaded
2 // compile-flags:-g
3
4 // min-gdb-version: 8.1
5
6 // === GDB TESTS ==================================================================================
7
8 // gdb-command:run
9
10 // gdb-command:print r
11 // gdb-check:[...]$1 = Rc(strong=2, weak=1) = {value = 42, strong = 2, weak = 1}
12 // gdb-command:print a
13 // gdb-check:[...]$2 = Arc(strong=2, weak=1) = {value = 42, strong = 2, weak = 1}
14
15
16 // === LLDB TESTS ==================================================================================
17
18 // lldb-command:run
19
20 // lldb-command:print r
21 // lldb-check:[...]$0 = strong=2, weak=1 { value = 42 }
22 // lldb-command:print a
23 // lldb-check:[...]$1 = strong=2, weak=1 { data = 42 }
24
25 use std::rc::Rc;
26 use std::sync::Arc;
27
28 fn main() {
29     let r = Rc::new(42);
30     let r1 = Rc::clone(&r);
31     let w1 = Rc::downgrade(&r);
32
33     let a = Arc::new(42);
34     let a1 = Arc::clone(&a);
35     let w2 = Arc::downgrade(&a);
36
37     print!(""); // #break
38 }