Folkert de Vries efaf3eb8a0
ignore run-make tests that need std on no_std targets
In particular, anything that includes `none` in the target tripple, and `nvptx64-nvidia-cuda`
2025-06-12 15:10:12 +02:00

29 lines
560 B
Rust

//@ needs-target-std
#[cfg(unix)]
use std::os::unix::fs::PermissionsExt;
use std::path::Path;
#[cfg(unix)]
use run_make_support::libc;
use run_make_support::{rfs, rustc};
fn main() {
#[cfg(unix)]
unsafe {
libc::umask(0o002);
}
rustc().crate_type("lib").arg("foo.rs").run();
verify(Path::new("libfoo.rlib"));
}
fn verify(path: &Path) {
let perm = rfs::metadata(path).permissions();
assert!(!perm.readonly());
// Check that the file is readable for everyone
#[cfg(unix)]
assert_eq!(perm.mode(), 0o100664);
}