Skip to content

Commit

Permalink
rewrite emit-stack-sizes to rmake
Browse files Browse the repository at this point in the history
  • Loading branch information
Oneirical committed Jun 21, 2024
1 parent 2435cd3 commit 88c4431
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 14 deletions.
2 changes: 0 additions & 2 deletions src/tools/tidy/src/allowed_run_make_makefiles.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ run-make/dump-mono-stats/Makefile
run-make/dylib-chain/Makefile
run-make/emit-path-unhashed/Makefile
run-make/emit-shared-files/Makefile
run-make/emit-stack-sizes/Makefile
run-make/emit-to-stdout/Makefile
run-make/env-dep-info/Makefile
run-make/error-writing-dependencies/Makefile
Expand Down Expand Up @@ -156,7 +155,6 @@ run-make/redundant-libs/Makefile
run-make/relocation-model/Makefile
run-make/relro-levels/Makefile
run-make/remap-path-prefix-dwarf/Makefile
run-make/remap-path-prefix/Makefile
run-make/reproducible-build-2/Makefile
run-make/reproducible-build/Makefile
run-make/return-non-c-like-enum-from-c/Makefile
Expand Down
12 changes: 0 additions & 12 deletions tests/run-make/emit-stack-sizes/Makefile

This file was deleted.

23 changes: 23 additions & 0 deletions tests/run-make/emit-stack-sizes/rmake.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Running rustc with the -Z emit-stack-sizes
// flag enables diagnostics to seek stack overflows
// at compile time. This test compiles a rust file
// with this flag, then checks that the output object
// file contains the section "stack_sizes", where
// this diagnostics information should be located.
// See /~https://github.com/rust-lang/rust/pull/51946
// FIXME(Oneirical): temporarily disabled ignore flags for test
// here is ignore-windows
// and ignore-apple
// Supposedly, this feature only works when the output object format is ELF so we ignore
// Apple and Windows

use run_make_support::{llvm_readobj, rustc};

fn main() {
rustc().opt_level("3").arg("-Zemit-stack-sizes").emit("obj").input("foo.rs").run();
llvm_readobj()
.arg("--section-headers")
.input("foo.o")
.run()
.assert_stdout_contains(".stack_sizes");
}

0 comments on commit 88c4431

Please sign in to comment.