2024-05-27 19:57:01 -05:00
|
|
|
// A simple smoke test to check that link time optimization
|
2024-05-27 20:19:58 -05:00
|
|
|
// (LTO) is accepted by the compiler, and that
|
|
|
|
// passing its various flags still results in successful compilation.
|
2024-05-27 19:57:01 -05:00
|
|
|
// See https://github.com/rust-lang/rust/issues/10741
|
|
|
|
|
|
|
|
//@ ignore-cross-compile
|
|
|
|
|
2024-05-27 20:10:57 -05:00
|
|
|
use run_make_support::rustc;
|
|
|
|
|
2024-05-27 19:57:01 -05:00
|
|
|
fn main() {
|
|
|
|
let lto_flags = ["-Clto", "-Clto=yes", "-Clto=off", "-Clto=thin", "-Clto=fat"];
|
|
|
|
for flag in lto_flags {
|
2024-05-27 20:19:58 -05:00
|
|
|
rustc().input("lib.rs").run();
|
|
|
|
rustc().input("main.rs").arg(flag).run();
|
2024-05-27 19:57:01 -05:00
|
|
|
}
|
|
|
|
}
|