Skip to content

Commit

Permalink
Rollup merge of #125638 - Oneirical:lets-find-some-tests, r=jieyouxu
Browse files Browse the repository at this point in the history
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
jieyouxu authored May 29, 2024
2 parents 305137d + cc97376 commit 7e93a63
Show file tree
Hide file tree
Showing 10 changed files with 43 additions and 54 deletions.
3 changes: 0 additions & 3 deletions src/tools/tidy/src/allowed_run_make_makefiles.txt
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ run-make/lto-linkage-used-attr/Makefile
run-make/lto-no-link-whole-rlib/Makefile
run-make/lto-readonly-lib/Makefile
run-make/lto-smoke-c/Makefile
run-make/lto-smoke/Makefile
run-make/macos-deployment-target/Makefile
run-make/macos-fat-archive/Makefile
run-make/manual-crate-name/Makefile
Expand All @@ -156,7 +155,6 @@ run-make/min-global-align/Makefile
run-make/mingw-export-call-convention/Makefile
run-make/mismatching-target-triples/Makefile
run-make/missing-crate-dependency/Makefile
run-make/mixing-deps/Makefile
run-make/mixing-formats/Makefile
run-make/mixing-libs/Makefile
run-make/msvc-opt-minsize/Makefile
Expand Down Expand Up @@ -238,7 +236,6 @@ run-make/short-ice/Makefile
run-make/silly-file-names/Makefile
run-make/simd-ffi/Makefile
run-make/simple-dylib/Makefile
run-make/simple-rlib/Makefile
run-make/split-debuginfo/Makefile
run-make/stable-symbol-names/Makefile
run-make/static-dylib-by-default/Makefile
Expand Down
31 changes: 0 additions & 31 deletions tests/run-make/lto-smoke/Makefile

This file was deleted.

16 changes: 16 additions & 0 deletions tests/run-make/lto-smoke/rmake.rs
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();
}
}
8 changes: 0 additions & 8 deletions tests/run-make/mixing-deps/Makefile

This file was deleted.

13 changes: 13 additions & 0 deletions tests/run-make/mixing-deps/rmake.rs
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");
}
6 changes: 0 additions & 6 deletions tests/run-make/simple-rlib/Makefile

This file was deleted.

1 change: 0 additions & 1 deletion tests/run-make/simple-rlib/bar.rs

This file was deleted.

5 changes: 0 additions & 5 deletions tests/run-make/simple-rlib/foo.rs

This file was deleted.

2 changes: 2 additions & 0 deletions tests/ui/imports/auxiliary/simple-rlib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#![crate_type = "rlib"]
pub fn bar() {}
12 changes: 12 additions & 0 deletions tests/ui/imports/simple-rlib-import.rs
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();
}

0 comments on commit 7e93a63

Please sign in to comment.