-
Notifications
You must be signed in to change notification settings - Fork 13k
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-97463-abi-param-passing to rmake
- Loading branch information
Showing
7 changed files
with
41 additions
and
25 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
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
File renamed without changes.
File renamed without changes.
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,25 @@ | ||
// This test was created in response to an obscure miscompilation bug, only | ||
// visible with the -O3 flag passed to the cc compiler when trying to obtain | ||
// a native static library for the sake of foreign function interface. This | ||
// flag could cause certain integer types to fail to be zero-extended, resulting | ||
// in type casting errors. After the fix in #97800, this test attempts integer casting | ||
// while simultaneously interfacing with a C library and using the -O3 flag. | ||
// See https://github.com/rust-lang/rust/issues/97463 | ||
|
||
//@ ignore-msvc | ||
// Reason: the rustc compilation fails due to an unresolved external symbol | ||
|
||
//@ ignore-cross-compile | ||
// Reason: The compiled binary is executed. | ||
|
||
use run_make_support::{cc, is_msvc, llvm_ar, run, rustc, static_lib_name}; | ||
|
||
fn main() { | ||
// The issue exercised by this test specifically needs needs `-O` | ||
// flags (like `-O3`) to reproduce. Thus, we call `cc()` instead of | ||
// the nicer `build_native_static_lib`. | ||
cc().arg("-c").arg("-O3").out_exe("bar").input("bad.c").run(); | ||
llvm_ar().obj_to_ar().output_input(static_lib_name("bad"), "bad.o").run(); | ||
rustc().input("param_passing.rs").arg("-lbad").opt_level("3").run(); | ||
run("param_passing"); | ||
} |