Skip to content

Commit

Permalink
rewrite panic-abort-eh_frame to rmake
Browse files Browse the repository at this point in the history
  • Loading branch information
Oneirical committed Jul 9, 2024
1 parent 4fa2a9b commit 7b37e2b
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 11 deletions.
1 change: 0 additions & 1 deletion src/tools/tidy/src/allowed_run_make_makefiles.txt
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ run-make/no-alloc-shim/Makefile
run-make/no-builtins-attribute/Makefile
run-make/no-duplicate-libs/Makefile
run-make/obey-crate-type-flag/Makefile
run-make/panic-abort-eh_frame/Makefile
run-make/pass-non-c-like-enum-to-c/Makefile
run-make/pdb-buildinfo-cl-cmd/Makefile
run-make/pgo-gen-lto/Makefile
Expand Down
10 changes: 0 additions & 10 deletions tests/run-make/panic-abort-eh_frame/Makefile

This file was deleted.

22 changes: 22 additions & 0 deletions tests/run-make/panic-abort-eh_frame/rmake.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// An `.eh_frame` section in an object file is a symptom of an UnwindAction::Terminate
// being inserted, useful for determining whether or not unwinding is necessary.
// This is useless when panics would NEVER unwind due to -C panic=abort. This section should
// therefore never appear in the emit file of a -C panic=abort compilation, and this test
// checks that this is respected.
// See https://github.com/rust-lang/rust/pull/112403

// FIXME(Oneirical): try it on more than only-linux!

use run_make_support::{llvm_objdump, rustc};

fn main() {
rustc()
.input("foo.rs")
.crate_type("lib")
.emit("obj=foo.o")
.panic("abort")
.edition("2021")
.arg("-Zvalidate-mir")
.run();
llvm_objdump().arg("--dwarf=frames").input("foo.o").run().assert_stdout_not_contains("DW_CFA");
}

0 comments on commit 7b37e2b

Please sign in to comment.