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

21 lines
688 B
Rust
Raw Normal View History

2024-07-18 12:42:15 -05:00
// LLVM's link-time-optimization (LTO) is a useful feature added to Rust in response
// to #10741. This test uses this feature with `-C lto` alongside a native C library,
// and checks that compilation and execution is successful.
// See https://github.com/rust-lang/rust/issues/10741
//@ ignore-cross-compile
// Reason: the compiled binary is executed
use run_make_support::{cc, extra_c_flags, extra_cxx_flags, run, rustc, static_lib_name};
fn main() {
rustc().input("foo.rs").arg("-Clto").run();
cc().input("bar.c")
.arg(static_lib_name("foo"))
.out_exe("bar")
2024-07-18 13:10:01 -05:00
.args(extra_c_flags())
.args(extra_cxx_flags())
2024-07-18 12:42:15 -05:00
.run();
run("bar");
}