Skip to content

Commit 0e5ec43

Browse files
authored
Unrolled build for rust-lang#125638
Rollup merge of rust-lang#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 rust-lang#121876 and the associated [Google Summer of Code project](https://blog.rust-lang.org/2024/05/01/gsoc-2024-selected-projects.html).
2 parents da159eb + cc97376 commit 0e5ec43

File tree

10 files changed

+43
-54
lines changed

10 files changed

+43
-54
lines changed

src/tools/tidy/src/allowed_run_make_makefiles.txt

-3
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,6 @@ run-make/lto-linkage-used-attr/Makefile
144144
run-make/lto-no-link-whole-rlib/Makefile
145145
run-make/lto-readonly-lib/Makefile
146146
run-make/lto-smoke-c/Makefile
147-
run-make/lto-smoke/Makefile
148147
run-make/macos-deployment-target/Makefile
149148
run-make/macos-fat-archive/Makefile
150149
run-make/manual-crate-name/Makefile
@@ -156,7 +155,6 @@ run-make/min-global-align/Makefile
156155
run-make/mingw-export-call-convention/Makefile
157156
run-make/mismatching-target-triples/Makefile
158157
run-make/missing-crate-dependency/Makefile
159-
run-make/mixing-deps/Makefile
160158
run-make/mixing-formats/Makefile
161159
run-make/mixing-libs/Makefile
162160
run-make/msvc-opt-minsize/Makefile
@@ -238,7 +236,6 @@ run-make/short-ice/Makefile
238236
run-make/silly-file-names/Makefile
239237
run-make/simd-ffi/Makefile
240238
run-make/simple-dylib/Makefile
241-
run-make/simple-rlib/Makefile
242239
run-make/split-debuginfo/Makefile
243240
run-make/stable-symbol-names/Makefile
244241
run-make/static-dylib-by-default/Makefile

tests/run-make/lto-smoke/Makefile

-31
This file was deleted.

tests/run-make/lto-smoke/rmake.rs

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// A simple smoke test to check that link time optimization
2+
// (LTO) is accepted by the compiler, and that
3+
// passing its various flags still results in successful compilation.
4+
// See https://github.com/rust-lang/rust/issues/10741
5+
6+
//@ ignore-cross-compile
7+
8+
use run_make_support::rustc;
9+
10+
fn main() {
11+
let lto_flags = ["-Clto", "-Clto=yes", "-Clto=off", "-Clto=thin", "-Clto=fat"];
12+
for flag in lto_flags {
13+
rustc().input("lib.rs").run();
14+
rustc().input("main.rs").arg(flag).run();
15+
}
16+
}

tests/run-make/mixing-deps/Makefile

-8
This file was deleted.

tests/run-make/mixing-deps/rmake.rs

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// This test invokes the main function in prog.rs, which has dependencies
2+
// in both an rlib and a dylib. This test checks that these different library
3+
// types can be successfully mixed.
4+
//@ ignore-cross-compile
5+
6+
use run_make_support::{run, rustc};
7+
8+
fn main() {
9+
rustc().input("both.rs").arg("-Cprefer-dynamic").run();
10+
rustc().input("dylib.rs").arg("-Cprefer-dynamic").run();
11+
rustc().input("prog.rs").run();
12+
run("prog");
13+
}

tests/run-make/simple-rlib/Makefile

-6
This file was deleted.

tests/run-make/simple-rlib/bar.rs

-1
This file was deleted.

tests/run-make/simple-rlib/foo.rs

-5
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#![crate_type = "rlib"]
2+
pub fn bar() {}
+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// A simple test, where foo.rs has a dependency
2+
// on the rlib (a static Rust-specific library format) bar.rs. If the test passes,
3+
// rlibs can be built and linked into another file successfully..
4+
5+
//@ aux-crate:bar=simple-rlib.rs
6+
//@ run-pass
7+
8+
extern crate bar;
9+
10+
fn main() {
11+
bar::bar();
12+
}

0 commit comments

Comments
 (0)