diff options
Diffstat (limited to 'tests/run-make/panic-abort-eh_frame')
-rw-r--r-- | tests/run-make/panic-abort-eh_frame/Makefile | 10 | ||||
-rw-r--r-- | tests/run-make/panic-abort-eh_frame/foo.rs | 10 |
2 files changed, 20 insertions, 0 deletions
diff --git a/tests/run-make/panic-abort-eh_frame/Makefile b/tests/run-make/panic-abort-eh_frame/Makefile new file mode 100644 index 000000000..1cb7bf575 --- /dev/null +++ b/tests/run-make/panic-abort-eh_frame/Makefile @@ -0,0 +1,10 @@ +# only-linux +# +# This test ensures that `panic=abort` code (without `C-unwind`, that is) should not have any +# unwinding related `.eh_frame` sections emitted. + +include ../tools.mk + +all: + $(RUSTC) foo.rs --crate-type=lib --emit=obj=$(TMPDIR)/foo.o -Cpanic=abort + 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 new file mode 100644 index 000000000..e18535294 --- /dev/null +++ b/tests/run-make/panic-abort-eh_frame/foo.rs @@ -0,0 +1,10 @@ +#![no_std] + +#[panic_handler] +fn handler(_: &core::panic::PanicInfo<'_>) -> ! { + loop {} +} + +pub unsafe fn oops(x: *const u32) -> u32 { + *x +} |