1 // ignore-windows-gnu: pretty-printers are not loaded
4 // min-gdb-version: 8.1
5 // min-cdb-version: 10.0.18317.1001
7 // === GDB TESTS ==================================================================================
11 // gdb-command:print r
12 // gdb-check:[...]$1 = Rc(strong=2, weak=1) = {value = 42, strong = 2, weak = 1}
13 // gdb-command:print a
14 // gdb-check:[...]$2 = Arc(strong=2, weak=1) = {value = 42, strong = 2, weak = 1}
17 // === LLDB TESTS ==================================================================================
21 // lldb-command:print r
22 // lldb-check:[...]$0 = strong=2, weak=1 { value = 42 }
23 // lldb-command:print a
24 // lldb-check:[...]$1 = strong=2, weak=1 { data = 42 }
26 // === CDB TESTS ==================================================================================
31 // cdb-check:r,d : 42 [Type: alloc::rc::Rc<i32>]
32 // cdb-check: [<Raw View>] [Type: alloc::rc::Rc<i32>]
33 // cdb-check: [Reference count] : 2 [Type: core::cell::Cell<usize>]
34 // cdb-check: [Weak reference count] : 2 [Type: core::cell::Cell<usize>]
36 // cdb-command:dx r1,d
37 // cdb-check:r1,d : 42 [Type: alloc::rc::Rc<i32>]
38 // cdb-check: [<Raw View>] [Type: alloc::rc::Rc<i32>]
39 // cdb-check: [Reference count] : 2 [Type: core::cell::Cell<usize>]
40 // cdb-check: [Weak reference count] : 2 [Type: core::cell::Cell<usize>]
42 // cdb-command:dx w1,d
43 // cdb-check:w1,d : 42 [Type: alloc::rc::Weak<i32>]
44 // cdb-check: [<Raw View>] [Type: alloc::rc::Weak<i32>]
45 // cdb-check: [Reference count] : 2 [Type: core::cell::Cell<usize>]
46 // cdb-check: [Weak reference count] : 2 [Type: core::cell::Cell<usize>]
49 // cdb-check:a,d : 42 [Type: alloc::sync::Arc<i32>]
50 // cdb-check: [<Raw View>] [Type: alloc::sync::Arc<i32>]
51 // cdb-check: [Reference count] : 2 [Type: core::sync::atomic::AtomicUsize]
52 // cdb-check: [Weak reference count] : 2 [Type: core::sync::atomic::AtomicUsize]
54 // cdb-command:dx a1,d
55 // cdb-check:a1,d : 42 [Type: alloc::sync::Arc<i32>]
56 // cdb-check: [<Raw View>] [Type: alloc::sync::Arc<i32>]
57 // cdb-check: [Reference count] : 2 [Type: core::sync::atomic::AtomicUsize]
58 // cdb-check: [Weak reference count] : 2 [Type: core::sync::atomic::AtomicUsize]
60 // cdb-command:dx w2,d
61 // cdb-check:w2,d : 42 [Type: alloc::sync::Weak<i32>]
62 // cdb-check: [<Raw View>] [Type: alloc::sync::Weak<i32>]
63 // cdb-check: [Reference count] : 2 [Type: core::sync::atomic::AtomicUsize]
64 // cdb-check: [Weak reference count] : 2 [Type: core::sync::atomic::AtomicUsize]
71 let r1 = Rc::clone(&r);
72 let w1 = Rc::downgrade(&r);
75 let a1 = Arc::clone(&a);
76 let w2 = Arc::downgrade(&a);