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 eb20836
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 20 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
9 changes: 0 additions & 9 deletions tests/run-make/dump-ice-to-disk/rmake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,13 @@
// - Check that the ICE files contain some of the expected strings.
// See https://github.com/rust-lang/rust/pull/108714

// FIXME(Oneirical): try it on Windows!

use run_make_support::{cwd, fs_wrapper, has_extension, has_prefix, rustc, shallow_find_files};

fn main() {
rustc().input("lib.rs").arg("-Ztreat-err-as-bug=1").run_fail();
let ice_text = get_text_from_ice();
let default_set = ice_text.lines().count();
let content = ice_text;
// Ensure that the ICE files don't contain `:` in their filename because
// this causes problems on Windows.
for file in shallow_find_files(cwd(), |path| {
has_prefix(path, "rustc-ice") && has_extension(path, "txt")
}) {
assert!(!file.display().to_string().contains(":"));
}

clear_ice_files();
rustc().input("lib.rs").env("RUST_BACKTRACE", "short").arg("-Ztreat-err-as-bug=1").run_fail();
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 eb20836

Please sign in to comment.