Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite lto-smoke, simple-rlib and mixing-deps run-make tests in rmake.rs format #125638

Merged
merged 3 commits into from
May 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -145,7 +145,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 @@ -157,7 +156,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 @@ -239,7 +237,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();
}
Loading