summaryrefslogtreecommitdiffstats
path: root/tests/debuginfo/drop-locations.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:18:58 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:18:58 +0000
commita4b7ed7a42c716ab9f05e351f003d589124fd55d (patch)
treeb620cd3f223850b28716e474e80c58059dca5dd4 /tests/debuginfo/drop-locations.rs
parentAdding upstream version 1.67.1+dfsg1. (diff)
downloadrustc-a4b7ed7a42c716ab9f05e351f003d589124fd55d.tar.xz
rustc-a4b7ed7a42c716ab9f05e351f003d589124fd55d.zip
Adding upstream version 1.68.2+dfsg1.upstream/1.68.2+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/debuginfo/drop-locations.rs')
-rw-r--r--tests/debuginfo/drop-locations.rs83
1 files changed, 83 insertions, 0 deletions
diff --git a/tests/debuginfo/drop-locations.rs b/tests/debuginfo/drop-locations.rs
new file mode 100644
index 000000000..c195f4620
--- /dev/null
+++ b/tests/debuginfo/drop-locations.rs
@@ -0,0 +1,83 @@
+// ignore-windows
+// ignore-android
+// ignore-test // Test temporarily ignored due to debuginfo tests being disabled, see PR 47155
+// min-lldb-version: 310
+
+#![allow(unused)]
+
+// compile-flags:-g -O -C no-prepopulate-passes
+// -O -C no-prepopulate-passes added to work around https://bugs.llvm.org/show_bug.cgi?id=32123
+
+// This test checks that drop glue code gets attributed to scope's closing brace,
+// and function epilogues - to function's closing brace.
+
+// === GDB TESTS ===================================================================================
+
+// gdb-command:run
+// gdb-command:next
+// gdb-command:frame
+// gdb-check:[...]#loc1[...]
+// gdb-command:next
+// gdb-command:frame
+// gdb-check:[...]#loc2[...]
+// gdb-command:next
+// gdb-command:frame
+// gdb-check:[...]#loc3[...]
+// gdb-command:next
+// gdb-command:frame
+// gdb-check:[...]#loc4[...]
+// gdb-command:next
+// gdb-command:frame
+// gdb-check:[...]#loc5[...]
+// gdb-command:next
+// gdb-command:frame
+// gdb-check:[...]#loc6[...]
+
+// === LLDB TESTS ==================================================================================
+
+// lldb-command:set set stop-line-count-before 0
+// lldb-command:set set stop-line-count-after 1
+// Can't set both to zero or lldb will stop printing source at all. So it will output the current
+// line and the next. We deal with this by having at least 2 lines between the #loc's
+
+// lldb-command:run
+// lldb-command:next
+// lldb-command:frame select
+// lldb-check:[...]#loc1[...]
+// lldb-command:next
+// lldb-command:frame select
+// lldb-check:[...]#loc2[...]
+// lldb-command:next
+// lldb-command:frame select
+// lldb-check:[...]#loc3[...]
+// lldb-command:next
+// lldb-command:frame select
+// lldb-check:[...]#loc4[...]
+// lldb-command:next
+// lldb-command:frame select
+// lldb-check:[...]#loc5[...]
+// lldb-command:next
+// lldb-command:frame select
+// lldb-check:[...]#loc6[...]
+
+fn main() {
+
+ foo();
+
+ zzz(); // #loc5
+
+} // #loc6
+
+fn foo() {
+ {
+ let s = String::from("s"); // #break
+
+ zzz(); // #loc1
+
+ } // #loc2
+
+ zzz(); // #loc3
+
+} // #loc4
+
+fn zzz() {()}