-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of #125638 - Oneirical:lets-find-some-tests, r=jieyouxu
Rewrite `lto-smoke`, `simple-rlib` and `mixing-deps` `run-make` tests in `rmake.rs` format Part of #121876 and the associated [Google Summer of Code project](https://blog.rust-lang.org/2024/05/01/gsoc-2024-selected-projects.html).
- Loading branch information
Showing
10 changed files
with
43 additions
and
54 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.
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 @@ | ||
// A simple smoke test to check that link time optimization | ||
// (LTO) is accepted by the compiler, and that | ||
// passing its various flags still results in successful compilation. | ||
// See https://github.com/rust-lang/rust/issues/10741 | ||
|
||
//@ ignore-cross-compile | ||
|
||
use run_make_support::rustc; | ||
|
||
fn main() { | ||
let lto_flags = ["-Clto", "-Clto=yes", "-Clto=off", "-Clto=thin", "-Clto=fat"]; | ||
for flag in lto_flags { | ||
rustc().input("lib.rs").run(); | ||
rustc().input("main.rs").arg(flag).run(); | ||
} | ||
} |
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,13 @@ | ||
// This test invokes the main function in prog.rs, which has dependencies | ||
// in both an rlib and a dylib. This test checks that these different library | ||
// types can be successfully mixed. | ||
//@ ignore-cross-compile | ||
|
||
use run_make_support::{run, rustc}; | ||
|
||
fn main() { | ||
rustc().input("both.rs").arg("-Cprefer-dynamic").run(); | ||
rustc().input("dylib.rs").arg("-Cprefer-dynamic").run(); | ||
rustc().input("prog.rs").run(); | ||
run("prog"); | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,2 @@ | ||
#![crate_type = "rlib"] | ||
pub fn bar() {} |
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,12 @@ | ||
// A simple test, where foo.rs has a dependency | ||
// on the rlib (a static Rust-specific library format) bar.rs. If the test passes, | ||
// rlibs can be built and linked into another file successfully.. | ||
|
||
//@ aux-crate:bar=simple-rlib.rs | ||
//@ run-pass | ||
|
||
extern crate bar; | ||
|
||
fn main() { | ||
bar::bar(); | ||
} |