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 28, 2024
1 parent cb1281b commit 133b47a
Show file tree
Hide file tree
Showing 4 changed files with 24 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 @@ -26,7 +26,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/export-executable-symbols/Makefile
Expand Down Expand Up @@ -147,7 +146,6 @@ run-make/raw-dylib-link-ordinal/Makefile
run-make/raw-dylib-stdcall-ordinal/Makefile
run-make/redundant-libs/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
1 change: 1 addition & 0 deletions tests/run-make/debug-assertions/debug.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(internal_features)]
#![feature(rustc_attrs)]
#![deny(warnings)]

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

//@ ignore-windows
//@ ignore-apple
// Reason: this feature only works when the output object format is ELF.
// This won't be the case on Windows/OSX - for example, OSX produces a Mach-O binary.

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 133b47a

Please sign in to comment.