]> git.lizzy.rs Git - rust.git/blob - src/test/debuginfo/drop-locations.rs
Auto merge of #54720 - davidtwco:issue-51191, r=nikomatsakis
[rust.git] / src / test / debuginfo / drop-locations.rs
1 // Copyright 2013-2016 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
12 // ignore-android
13 // ignore-test // Test temporarily ignored due to debuginfo tests being disabled, see PR 47155
14 // min-lldb-version: 310
15
16 #![allow(unused)]
17
18 // compile-flags:-g -O -C no-prepopulate-passes
19 // -O -C no-prepopulate-passes added to work around https://bugs.llvm.org/show_bug.cgi?id=32123
20
21 // This test checks that drop glue code gets attributed to scope's closing brace,
22 // and function epilogues - to function's closing brace.
23
24 // === GDB TESTS ===================================================================================
25
26 // gdb-command:run
27 // gdb-command:next
28 // gdb-command:frame
29 // gdb-check:[...]#loc1[...]
30 // gdb-command:next
31 // gdb-command:frame
32 // gdb-check:[...]#loc2[...]
33 // gdb-command:next
34 // gdb-command:frame
35 // gdb-check:[...]#loc3[...]
36 // gdb-command:next
37 // gdb-command:frame
38 // gdb-check:[...]#loc4[...]
39 // gdb-command:next
40 // gdb-command:frame
41 // gdb-check:[...]#loc5[...]
42 // gdb-command:next
43 // gdb-command:frame
44 // gdb-check:[...]#loc6[...]
45
46 // === LLDB TESTS ==================================================================================
47
48 // lldb-command:set set stop-line-count-before 0
49 // lldb-command:set set stop-line-count-after 1
50 // Can't set both to zero or lldb will stop printing source at all.  So it will output the current
51 // line and the next.  We deal with this by having at least 2 lines between the #loc's
52
53 // lldb-command:run
54 // lldb-command:next
55 // lldb-command:frame select
56 // lldb-check:[...]#loc1[...]
57 // lldb-command:next
58 // lldb-command:frame select
59 // lldb-check:[...]#loc2[...]
60 // lldb-command:next
61 // lldb-command:frame select
62 // lldb-check:[...]#loc3[...]
63 // lldb-command:next
64 // lldb-command:frame select
65 // lldb-check:[...]#loc4[...]
66 // lldb-command:next
67 // lldb-command:frame select
68 // lldb-check:[...]#loc5[...]
69 // lldb-command:next
70 // lldb-command:frame select
71 // lldb-check:[...]#loc6[...]
72
73 fn main() {
74
75     foo();
76
77     zzz(); // #loc5
78
79 } // #loc6
80
81 fn foo() {
82     {
83         let s = String::from("s"); // #break
84
85         zzz(); // #loc1
86
87     } // #loc2
88
89     zzz(); // #loc3
90
91 } // #loc4
92
93 fn zzz() {()}