-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
24 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
#![allow(internal_features)] | ||
#![feature(rustc_attrs)] | ||
#![deny(warnings)] | ||
|
||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"); | ||
} |