diff options
| author | Gary Guo <gary@garyguo.net> | 2023-06-28 16:05:17 +0100 |
|---|---|---|
| committer | Gary Guo <gary@garyguo.net> | 2023-08-18 13:51:42 +0100 |
| commit | cec8e09edf55fbf474c4414e3fec26d85c7869ff (patch) | |
| tree | 03ae5bf2935304ece093ef5f5498cf183b877e23 /tests/run-make/panic-abort-eh_frame | |
| parent | cfbf1bf7cd300ddbfd2826488469c0921738685a (diff) | |
Run `AbortUnwindingCalls` after generator transform
Diffstat (limited to 'tests/run-make/panic-abort-eh_frame')
| -rw-r--r-- | tests/run-make/panic-abort-eh_frame/Makefile | 2 | ||||
| -rw-r--r-- | tests/run-make/panic-abort-eh_frame/foo.rs | 24 |
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 1cb7bf575cb..7020455b742 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 e1853529455..e2274d469e7 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)); +} |
