2024-06-06 14:20:42 -05:00
|
|
|
// When the compiler is performing link time optimization, it will
|
|
|
|
// need to copy the original rlib file, set the copy's permissions to read/write,
|
|
|
|
// and modify that copy - even if the original
|
|
|
|
// file is read-only. This test creates a read-only rlib, and checks that
|
|
|
|
// compilation with LTO succeeds.
|
|
|
|
// See https://github.com/rust-lang/rust/pull/17619
|
|
|
|
|
|
|
|
//@ ignore-cross-compile
|
|
|
|
|
2024-08-10 13:06:10 -05:00
|
|
|
use run_make_support::{run, rust_lib_name, rustc, test_while_readonly};
|
2024-06-06 14:20:42 -05:00
|
|
|
|
|
|
|
fn main() {
|
|
|
|
rustc().input("lib.rs").run();
|
2024-06-09 15:43:24 -05:00
|
|
|
test_while_readonly(rust_lib_name("lib"), || {
|
|
|
|
rustc().input("main.rs").arg("-Clto").run();
|
|
|
|
run("main");
|
|
|
|
});
|
2024-06-06 14:20:42 -05:00
|
|
|
}
|