]> git.proxmox.com Git - rustc.git/blame - tests/debuginfo/drop-locations.rs
New upstream version 1.68.2+dfsg1
[rustc.git] / tests / debuginfo / drop-locations.rs
CommitLineData
c30ab7b3
SL
1// ignore-windows
2// ignore-android
2c00a5a8 3// ignore-test // Test temporarily ignored due to debuginfo tests being disabled, see PR 47155
c30ab7b3
SL
4// min-lldb-version: 310
5
6#![allow(unused)]
7
8bb4bdeb
XL
8// compile-flags:-g -O -C no-prepopulate-passes
9// -O -C no-prepopulate-passes added to work around https://bugs.llvm.org/show_bug.cgi?id=32123
c30ab7b3
SL
10
11// This test checks that drop glue code gets attributed to scope's closing brace,
12// and function epilogues - to function's closing brace.
13
14// === GDB TESTS ===================================================================================
15
16// gdb-command:run
17// gdb-command:next
18// gdb-command:frame
19// gdb-check:[...]#loc1[...]
20// gdb-command:next
21// gdb-command:frame
22// gdb-check:[...]#loc2[...]
23// gdb-command:next
24// gdb-command:frame
25// gdb-check:[...]#loc3[...]
26// gdb-command:next
27// gdb-command:frame
28// gdb-check:[...]#loc4[...]
29// gdb-command:next
30// gdb-command:frame
31// gdb-check:[...]#loc5[...]
32// gdb-command:next
33// gdb-command:frame
34// gdb-check:[...]#loc6[...]
35
36// === LLDB TESTS ==================================================================================
37
38// lldb-command:set set stop-line-count-before 0
39// lldb-command:set set stop-line-count-after 1
40// Can't set both to zero or lldb will stop printing source at all. So it will output the current
41// line and the next. We deal with this by having at least 2 lines between the #loc's
42
43// lldb-command:run
44// lldb-command:next
45// lldb-command:frame select
46// lldb-check:[...]#loc1[...]
47// lldb-command:next
48// lldb-command:frame select
49// lldb-check:[...]#loc2[...]
50// lldb-command:next
51// lldb-command:frame select
52// lldb-check:[...]#loc3[...]
53// lldb-command:next
54// lldb-command:frame select
55// lldb-check:[...]#loc4[...]
56// lldb-command:next
57// lldb-command:frame select
58// lldb-check:[...]#loc5[...]
59// lldb-command:next
60// lldb-command:frame select
61// lldb-check:[...]#loc6[...]
62
63fn main() {
64
65 foo();
66
67 zzz(); // #loc5
68
69} // #loc6
70
71fn foo() {
72 {
73 let s = String::from("s"); // #break
74
75 zzz(); // #loc1
76
77 } // #loc2
78
79 zzz(); // #loc3
80
81} // #loc4
82
83fn zzz() {()}