forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rewrite and rename issue-20626 to rmake
- Loading branch information
Showing
4 changed files
with
16 additions
and
10 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 was deleted.
Oops, something went wrong.
File renamed without changes.
16 changes: 16 additions & 0 deletions
16
tests/run-make/raw-fn-pointer-opt-undefined-behavior/rmake.rs
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,16 @@ | ||
// Despite the absence of any unsafe Rust code, foo.rs in this test would, | ||
// because of the raw function pointer, | ||
// cause undefined behavior and fail to print the expected result, "4" - | ||
// only when activating optimizations (opt-level 2). This test checks | ||
// that this bug does not make a resurgence. | ||
// Note that the bug cannot be observed in an assert_eq!, only in the stdout. | ||
// See https://github.com/rust-lang/rust/issues/20626 | ||
|
||
//@ ignore-cross-compile | ||
|
||
use run_make_support::{run, rustc}; | ||
|
||
fn main() { | ||
rustc().input("foo.rs").opt().run(); | ||
run("foo").assert_stdout_equals("4"); | ||
} |