Skip to content

Commit 741cf91

Browse files
committed
rewrite lto-smoke-c to rmake
1 parent 5753b30 commit 741cf91

File tree

3 files changed

+20
-13
lines changed

3 files changed

+20
-13
lines changed

src/tools/tidy/src/allowed_run_make_makefiles.txt

-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ run-make/long-linker-command-lines-cmd-exe/Makefile
6262
run-make/long-linker-command-lines/Makefile
6363
run-make/lto-linkage-used-attr/Makefile
6464
run-make/lto-no-link-whole-rlib/Makefile
65-
run-make/lto-smoke-c/Makefile
6665
run-make/macos-deployment-target/Makefile
6766
run-make/macos-fat-archive/Makefile
6867
run-make/manual-link/Makefile

tests/run-make/lto-smoke-c/Makefile

-12
This file was deleted.

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

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// LLVM's link-time-optimization (LTO) is a useful feature added to Rust in response
2+
// to #10741. This test uses this feature with `-C lto` alongside a native C library,
3+
// and checks that compilation and execution is successful.
4+
// See https://github.com/rust-lang/rust/issues/10741
5+
6+
//@ ignore-cross-compile
7+
// Reason: the compiled binary is executed
8+
9+
use run_make_support::{cc, extra_c_flags, extra_cxx_flags, run, rustc, static_lib_name};
10+
11+
fn main() {
12+
rustc().input("foo.rs").arg("-Clto").run();
13+
cc().input("bar.c")
14+
.arg(static_lib_name("foo"))
15+
.out_exe("bar")
16+
.args(&extra_c_flags())
17+
.args(&extra_cxx_flags())
18+
.run();
19+
run("bar");
20+
}

0 commit comments

Comments
 (0)