summaryrefslogtreecommitdiffstats
path: root/tests/run-make/panic-abort-eh_frame
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 03:59:24 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 03:59:24 +0000
commit023939b627b7dc93b01471f7d41fb8553ddb4ffa (patch)
tree60fc59477c605c72b0a1051409062ddecc43f877 /tests/run-make/panic-abort-eh_frame
parentAdding debian version 1.72.1+dfsg1-1. (diff)
downloadrustc-023939b627b7dc93b01471f7d41fb8553ddb4ffa.tar.xz
rustc-023939b627b7dc93b01471f7d41fb8553ddb4ffa.zip
Merging upstream version 1.73.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/run-make/panic-abort-eh_frame')
-rw-r--r--tests/run-make/panic-abort-eh_frame/Makefile2
-rw-r--r--tests/run-make/panic-abort-eh_frame/foo.rs24
2 files changed, 25 insertions, 1 deletions
diff --git a/tests/run-make/panic-abort-eh_frame/Makefile b/tests/run-make/panic-abort-eh_frame/Makefile
index 1cb7bf575..7020455b7 100644
--- a/tests/run-make/panic-abort-eh_frame/Makefile
+++ b/tests/run-make/panic-abort-eh_frame/Makefile
@@ -6,5 +6,5 @@
include ../tools.mk
all:
- $(RUSTC) foo.rs --crate-type=lib --emit=obj=$(TMPDIR)/foo.o -Cpanic=abort
+ $(RUSTC) foo.rs --crate-type=lib --emit=obj=$(TMPDIR)/foo.o -Cpanic=abort --edition 2021 -Z validate-mir
objdump --dwarf=frames $(TMPDIR)/foo.o | $(CGREP) -v 'DW_CFA'
diff --git a/tests/run-make/panic-abort-eh_frame/foo.rs b/tests/run-make/panic-abort-eh_frame/foo.rs
index e18535294..e2274d469 100644
--- a/tests/run-make/panic-abort-eh_frame/foo.rs
+++ b/tests/run-make/panic-abort-eh_frame/foo.rs
@@ -1,5 +1,13 @@
#![no_std]
+use core::future::Future;
+
+pub struct NeedsDrop;
+
+impl Drop for NeedsDrop {
+ fn drop(&mut self) {}
+}
+
#[panic_handler]
fn handler(_: &core::panic::PanicInfo<'_>) -> ! {
loop {}
@@ -8,3 +16,19 @@ fn handler(_: &core::panic::PanicInfo<'_>) -> ! {
pub unsafe fn oops(x: *const u32) -> u32 {
*x
}
+
+pub async fn foo(_: NeedsDrop) {
+ async fn bar() {}
+ bar().await;
+}
+
+pub fn poll_foo(x: &mut core::task::Context<'_>) {
+ let _g = NeedsDrop;
+ let mut p = core::pin::pin!(foo(NeedsDrop));
+ let _ = p.as_mut().poll(x);
+ let _ = p.as_mut().poll(x);
+}
+
+pub fn drop_foo() {
+ drop(foo(NeedsDrop));
+}