From d82be822a84c6e511cfb586827d0f100290f6581 Mon Sep 17 00:00:00 2001 From: Mads Marquart Date: Mon, 27 May 2024 15:01:04 +0200 Subject: [PATCH 1/3] Enable a few tests on macOS --- tests/ui/panic-runtime/abort-link-to-unwinding-crates.rs | 4 +--- tests/ui/panic-runtime/abort.rs | 4 +--- tests/ui/panic-runtime/link-to-abort.rs | 1 - 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/tests/ui/panic-runtime/abort-link-to-unwinding-crates.rs b/tests/ui/panic-runtime/abort-link-to-unwinding-crates.rs index 11e4929f12e0a..ce6644e675869 100644 --- a/tests/ui/panic-runtime/abort-link-to-unwinding-crates.rs +++ b/tests/ui/panic-runtime/abort-link-to-unwinding-crates.rs @@ -5,12 +5,11 @@ //@ no-prefer-dynamic //@ ignore-wasm32 no processes //@ ignore-sgx no processes -//@ ignore-macos extern crate exit_success_if_unwind; -use std::process::Command; use std::env; +use std::process::Command; fn main() { let mut args = env::args_os(); @@ -25,7 +24,6 @@ fn main() { let mut cmd = Command::new(env::args_os().next().unwrap()); cmd.arg("foo"); - // ARMv6 hanges while printing the backtrace, see #41004 if cfg!(target_arch = "arm") && cfg!(target_env = "gnu") { cmd.env("RUST_BACKTRACE", "0"); diff --git a/tests/ui/panic-runtime/abort.rs b/tests/ui/panic-runtime/abort.rs index 22bd2ecfb00e7..caf0243ebdb26 100644 --- a/tests/ui/panic-runtime/abort.rs +++ b/tests/ui/panic-runtime/abort.rs @@ -4,10 +4,9 @@ //@ no-prefer-dynamic //@ ignore-wasm32 no processes //@ ignore-sgx no processes -//@ ignore-macos -use std::process::Command; use std::env; +use std::process::Command; struct Bomb; @@ -23,7 +22,6 @@ fn main() { if let Some(s) = args.next() { if &*s == "foo" { - let _bomb = Bomb; panic!("try to catch me"); diff --git a/tests/ui/panic-runtime/link-to-abort.rs b/tests/ui/panic-runtime/link-to-abort.rs index 2a7052616f2c7..a4013f2a6cf70 100644 --- a/tests/ui/panic-runtime/link-to-abort.rs +++ b/tests/ui/panic-runtime/link-to-abort.rs @@ -2,7 +2,6 @@ //@ compile-flags:-C panic=abort //@ no-prefer-dynamic -//@ ignore-macos #![feature(panic_abort)] From 37ae2b68b1631a5f2cb7d2b2f6478acba654d651 Mon Sep 17 00:00:00 2001 From: Mads Marquart Date: Thu, 16 May 2024 12:58:09 +0200 Subject: [PATCH 2/3] Disable stack overflow handler tests on iOS-like platforms --- library/std/src/sys/pal/unix/stack_overflow.rs | 8 ++++++++ tests/ui/abi/stack-probes-lto.rs | 4 ++++ tests/ui/abi/stack-probes.rs | 4 ++++ tests/ui/runtime/out-of-stack.rs | 4 ++++ 4 files changed, 20 insertions(+) diff --git a/library/std/src/sys/pal/unix/stack_overflow.rs b/library/std/src/sys/pal/unix/stack_overflow.rs index 26c49257ad00d..2e5bd85327a19 100644 --- a/library/std/src/sys/pal/unix/stack_overflow.rs +++ b/library/std/src/sys/pal/unix/stack_overflow.rs @@ -491,6 +491,14 @@ mod imp { } } +// This is intentionally not enabled on iOS/tvOS/watchOS/visionOS, as it uses +// several symbols that might lead to rejections from the App Store, namely +// `sigaction`, `sigaltstack`, `sysctlbyname`, `mmap`, `munmap` and `mprotect`. +// +// This might be overly cautious, though it is also what Swift does (and they +// usually have fewer qualms about forwards compatibility, since the runtime +// is shipped with the OS): +// #[cfg(not(any( target_os = "linux", target_os = "freebsd", diff --git a/tests/ui/abi/stack-probes-lto.rs b/tests/ui/abi/stack-probes-lto.rs index 5451b72d97925..70343b0599ac3 100644 --- a/tests/ui/abi/stack-probes-lto.rs +++ b/tests/ui/abi/stack-probes-lto.rs @@ -10,5 +10,9 @@ //@ compile-flags: -C lto //@ no-prefer-dynamic //@ ignore-nto Crash analysis impossible at SIGSEGV in QNX Neutrino +//@ ignore-ios Stack probes are enabled, but the SIGSEGV handler isn't +//@ ignore-tvos Stack probes are enabled, but the SIGSEGV handler isn't +//@ ignore-watchos Stack probes are enabled, but the SIGSEGV handler isn't +//@ ignore-visionos Stack probes are enabled, but the SIGSEGV handler isn't include!("stack-probes.rs"); diff --git a/tests/ui/abi/stack-probes.rs b/tests/ui/abi/stack-probes.rs index 32d4d6cd31e68..22304257593fe 100644 --- a/tests/ui/abi/stack-probes.rs +++ b/tests/ui/abi/stack-probes.rs @@ -8,6 +8,10 @@ //@ ignore-sgx no processes //@ ignore-fuchsia no exception handler registered for segfault //@ ignore-nto Crash analysis impossible at SIGSEGV in QNX Neutrino +//@ ignore-ios Stack probes are enabled, but the SIGSEGV handler isn't +//@ ignore-tvos Stack probes are enabled, but the SIGSEGV handler isn't +//@ ignore-watchos Stack probes are enabled, but the SIGSEGV handler isn't +//@ ignore-visionos Stack probes are enabled, but the SIGSEGV handler isn't use std::env; use std::mem::MaybeUninit; diff --git a/tests/ui/runtime/out-of-stack.rs b/tests/ui/runtime/out-of-stack.rs index a62398df8b80b..c5300635ad924 100644 --- a/tests/ui/runtime/out-of-stack.rs +++ b/tests/ui/runtime/out-of-stack.rs @@ -7,6 +7,10 @@ //@ ignore-sgx no processes //@ ignore-fuchsia must translate zircon signal to SIGABRT, FIXME (#58590) //@ ignore-nto no stack overflow handler used (no alternate stack available) +//@ ignore-ios stack overflow handlers aren't enabled +//@ ignore-tvos stack overflow handlers aren't enabled +//@ ignore-watchos stack overflow handlers aren't enabled +//@ ignore-visionos stack overflow handlers aren't enabled #![feature(rustc_private)] From e6b9bb7b7200c69b82fd69572a7c0a03ead3d60f Mon Sep 17 00:00:00 2001 From: Mads Marquart Date: Mon, 27 May 2024 15:17:18 +0200 Subject: [PATCH 3/3] Make more of the test suite run on Mac Catalyst This adds the `only-apple`/`ignore-apple` compiletest directive, and uses that basically everywhere instead of `only-macos`/`ignore-macos`. Some of the updates in `run-make` are a bit redundant, as they use `ignore-cross-compile` and won't run on iOS - but using Apple in these is still more correct, so I've made that change anyhow. --- library/std/src/fs/tests.rs | 2 +- src/bootstrap/src/utils/dylib.rs | 2 +- src/tools/compiletest/src/header.rs | 3 +- src/tools/compiletest/src/header/cfg.rs | 6 ++++ src/tools/compiletest/src/runtest.rs | 2 +- src/tools/compiletest/src/util.rs | 2 +- src/tools/tidy/src/issues.txt | 1 - src/tools/tidy/src/ui_tests.rs | 2 +- .../stack-protector-heuristics-effect.rs | 5 +--- .../x86_64-array-pair-load-store-merge.rs | 2 +- tests/assembly/x86_64-function-return.rs | 2 +- tests/codegen/gdb_debug_script_load.rs | 2 +- tests/codegen/instrument-coverage/testprog.rs | 4 +-- .../issues/issue-44056-macos-tls-align.rs | 2 +- tests/codegen/mainsubprogram.rs | 5 ++-- tests/codegen/mainsubprogramstart.rs | 2 +- tests/codegen/pgo-counter-bias.rs | 2 +- tests/run-make/c-dynamic-dylib/Makefile | 2 +- tests/run-make/c-dynamic-rlib/Makefile | 2 +- tests/run-make/emit-stack-sizes/Makefile | 4 +-- tests/run-make/fpic/Makefile | 2 +- tests/run-make/link-framework/Makefile | 2 +- tests/run-make/macos-fat-archive/Makefile | 2 +- .../Makefile | 2 +- tests/run-make/used-cdylib-macos/Makefile | 4 +-- tests/run-pass-valgrind/exit-flushes.rs | 5 ++-- tests/ui/backtrace/apple-no-dsymutil.rs | 2 +- tests/ui/deployment-target/macos-target.rs | 2 +- tests/ui/intrinsics/intrinsic-alignment.rs | 29 +++++++++--------- tests/ui/issues/issue-45731.rs | 13 +++++--- tests/ui/link-section.rs | 24 +++++++-------- tests/ui/linkage-attr/framework.rs | 2 +- .../kind-framework.rs} | 2 +- .../kind-framework.stderr} | 2 +- ...e-attr-does-not-panic-llvm-issue-33992.rs} | 2 +- tests/ui/linkage-attr/linkage1.rs | 2 +- .../auxiliary/lib.rs | 0 .../propagate-generic-issue-18804}/main.rs | 2 +- tests/ui/manual/manual-link-framework.rs | 6 ++-- .../structs-enums/enum-rec/issue-17431-6.rs | 2 +- tests/ui/structs-enums/rec-align-u64.rs | 30 +++++++++---------- 41 files changed, 98 insertions(+), 93 deletions(-) rename tests/ui/{osx-frameworks.rs => linkage-attr/kind-framework.rs} (58%) rename tests/ui/{osx-frameworks.stderr => linkage-attr/kind-framework.stderr} (89%) rename tests/ui/{issues/issue-33992.rs => linkage-attr/linkage-attr-does-not-panic-llvm-issue-33992.rs} (96%) rename tests/ui/{issues/issue-18804 => linkage-attr/propagate-generic-issue-18804}/auxiliary/lib.rs (100%) rename tests/ui/{issues/issue-18804 => linkage-attr/propagate-generic-issue-18804}/main.rs (91%) diff --git a/library/std/src/fs/tests.rs b/library/std/src/fs/tests.rs index dfa05671ab0f1..62a268facb638 100644 --- a/library/std/src/fs/tests.rs +++ b/library/std/src/fs/tests.rs @@ -1431,7 +1431,7 @@ fn metadata_access_times() { assert_eq!(check!(a.modified()), check!(a.modified())); assert_eq!(check!(b.accessed()), check!(b.modified())); - if cfg!(target_os = "macos") || cfg!(target_os = "windows") { + if cfg!(target_vendor = "apple") || cfg!(target_os = "windows") { check!(a.created()); check!(b.created()); } diff --git a/src/bootstrap/src/utils/dylib.rs b/src/bootstrap/src/utils/dylib.rs index b6e7aec1756b6..90bcff59a647c 100644 --- a/src/bootstrap/src/utils/dylib.rs +++ b/src/bootstrap/src/utils/dylib.rs @@ -5,7 +5,7 @@ pub fn dylib_path_var() -> &'static str { if cfg!(target_os = "windows") { "PATH" - } else if cfg!(target_os = "macos") { + } else if cfg!(target_vendor = "apple") { "DYLD_LIBRARY_PATH" } else if cfg!(target_os = "haiku") { "LIBRARY_PATH" diff --git a/src/tools/compiletest/src/header.rs b/src/tools/compiletest/src/header.rs index c7c807d3e6846..dc5818201b6d2 100644 --- a/src/tools/compiletest/src/header.rs +++ b/src/tools/compiletest/src/header.rs @@ -747,6 +747,7 @@ const KNOWN_DIRECTIVE_NAMES: &[&str] = &[ "ignore-aarch64", "ignore-aarch64-unknown-linux-gnu", "ignore-android", + "ignore-apple", "ignore-arm", "ignore-avr", "ignore-beta", @@ -829,7 +830,6 @@ const KNOWN_DIRECTIVE_NAMES: &[&str] = &[ "ignore-x32", "ignore-x86", "ignore-x86_64", - "ignore-x86_64-apple-darwin", "ignore-x86_64-unknown-linux-gnu", "incremental", "known-bug", @@ -876,6 +876,7 @@ const KNOWN_DIRECTIVE_NAMES: &[&str] = &[ "only-32bit", "only-64bit", "only-aarch64", + "only-apple", "only-arm", "only-avr", "only-beta", diff --git a/src/tools/compiletest/src/header/cfg.rs b/src/tools/compiletest/src/header/cfg.rs index df8c804705029..510043e3bfd8f 100644 --- a/src/tools/compiletest/src/header/cfg.rs +++ b/src/tools/compiletest/src/header/cfg.rs @@ -159,6 +159,12 @@ pub(super) fn parse_cfg_name_directive<'a>( message: "when the architecture is part of the Thumb family" } + condition! { + name: "apple", + condition: config.target.contains("apple"), + message: "when the target vendor is Apple" + } + // Technically the locally built compiler uses the "dev" channel rather than the "nightly" // channel, even though most people don't know or won't care about it. To avoid confusion, we // treat the "dev" channel as the "nightly" channel when processing the directive. diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs index 02c9d384ab7e4..e8ceff847224f 100644 --- a/src/tools/compiletest/src/runtest.rs +++ b/src/tools/compiletest/src/runtest.rs @@ -98,7 +98,7 @@ fn get_lib_name(lib: &str, aux_type: AuxType) -> Option { AuxType::Lib => Some(format!("lib{}.rlib", lib)), AuxType::Dylib => Some(if cfg!(windows) { format!("{}.dll", lib) - } else if cfg!(target_os = "macos") { + } else if cfg!(target_vendor = "apple") { format!("lib{}.dylib", lib) } else { format!("lib{}.so", lib) diff --git a/src/tools/compiletest/src/util.rs b/src/tools/compiletest/src/util.rs index 8f9425eb07167..09a7f0395cfb9 100644 --- a/src/tools/compiletest/src/util.rs +++ b/src/tools/compiletest/src/util.rs @@ -57,7 +57,7 @@ impl PathBufExt for PathBuf { pub fn dylib_env_var() -> &'static str { if cfg!(windows) { "PATH" - } else if cfg!(target_os = "macos") { + } else if cfg!(target_vendor = "apple") { "DYLD_LIBRARY_PATH" } else if cfg!(target_os = "haiku") { "LIBRARY_PATH" diff --git a/src/tools/tidy/src/issues.txt b/src/tools/tidy/src/issues.txt index 881b4f84173ca..398a6fd0fbaaa 100644 --- a/src/tools/tidy/src/issues.txt +++ b/src/tools/tidy/src/issues.txt @@ -2122,7 +2122,6 @@ ui/issues/issue-33687.rs ui/issues/issue-33770.rs ui/issues/issue-3389.rs ui/issues/issue-33941.rs -ui/issues/issue-33992.rs ui/issues/issue-34047.rs ui/issues/issue-34074.rs ui/issues/issue-34209.rs diff --git a/src/tools/tidy/src/ui_tests.rs b/src/tools/tidy/src/ui_tests.rs index 055d620361fb8..cce0fb2c1a25b 100644 --- a/src/tools/tidy/src/ui_tests.rs +++ b/src/tools/tidy/src/ui_tests.rs @@ -15,7 +15,7 @@ use std::path::{Path, PathBuf}; const ENTRY_LIMIT: u32 = 900; // FIXME: The following limits should be reduced eventually. -const ISSUES_ENTRY_LIMIT: u32 = 1676; +const ISSUES_ENTRY_LIMIT: u32 = 1674; const EXPECTED_TEST_FILE_EXTENSIONS: &[&str] = &[ "rs", // test source files diff --git a/tests/assembly/stack-protector/stack-protector-heuristics-effect.rs b/tests/assembly/stack-protector/stack-protector-heuristics-effect.rs index 8e32d170244a7..1f15f1a318a6a 100644 --- a/tests/assembly/stack-protector/stack-protector-heuristics-effect.rs +++ b/tests/assembly/stack-protector/stack-protector-heuristics-effect.rs @@ -1,6 +1,6 @@ //@ revisions: all strong basic none missing //@ assembly-output: emit-asm -//@ ignore-macos slightly different policy on stack protection of arrays +//@ ignore-apple slightly different policy on stack protection of arrays //@ ignore-msvc stack check code uses different function names //@ ignore-nvptx64 stack protector is not supported //@ ignore-wasm32-bare @@ -17,12 +17,9 @@ // See comments on https://github.com/rust-lang/rust/issues/114903. #![crate_type = "lib"] - #![allow(incomplete_features)] - #![feature(unsized_locals, unsized_fn_params)] - // CHECK-LABEL: emptyfn: #[no_mangle] pub fn emptyfn() { diff --git a/tests/assembly/x86_64-array-pair-load-store-merge.rs b/tests/assembly/x86_64-array-pair-load-store-merge.rs index 9cf54ae14a169..849f34e72e51e 100644 --- a/tests/assembly/x86_64-array-pair-load-store-merge.rs +++ b/tests/assembly/x86_64-array-pair-load-store-merge.rs @@ -2,7 +2,7 @@ //@ compile-flags: --crate-type=lib -O -C llvm-args=-x86-asm-syntax=intel //@ only-x86_64 //@ ignore-sgx -//@ ignore-macos (manipulates rsp too) +//@ ignore-apple (manipulates rsp too) // Depending on various codegen choices, this might end up copying // a `<2 x i8>`, an `i16`, or two `i8`s. diff --git a/tests/assembly/x86_64-function-return.rs b/tests/assembly/x86_64-function-return.rs index 64eb05062cbc4..7cfdf5bce0c1e 100644 --- a/tests/assembly/x86_64-function-return.rs +++ b/tests/assembly/x86_64-function-return.rs @@ -9,7 +9,7 @@ //@ [keep-thunk-extern] compile-flags: -Zfunction-return=keep -Zfunction-return=thunk-extern //@ [thunk-extern-keep] compile-flags: -Zfunction-return=thunk-extern -Zfunction-return=keep //@ only-x86_64 -//@ ignore-x86_64-apple-darwin Symbol is called `___x86_return_thunk` (Darwin's extra underscore) +//@ ignore-apple Symbol is called `___x86_return_thunk` (Darwin's extra underscore) //@ ignore-sgx Tests incompatible with LVI mitigations #![crate_type = "lib"] diff --git a/tests/codegen/gdb_debug_script_load.rs b/tests/codegen/gdb_debug_script_load.rs index f15defeaca8b5..30d518c0bcb83 100644 --- a/tests/codegen/gdb_debug_script_load.rs +++ b/tests/codegen/gdb_debug_script_load.rs @@ -1,6 +1,6 @@ // //@ ignore-windows -//@ ignore-macos +//@ ignore-apple //@ ignore-wasm //@ ignore-emscripten diff --git a/tests/codegen/instrument-coverage/testprog.rs b/tests/codegen/instrument-coverage/testprog.rs index b352cbdb75573..acc4f35d90543 100644 --- a/tests/codegen/instrument-coverage/testprog.rs +++ b/tests/codegen/instrument-coverage/testprog.rs @@ -11,7 +11,7 @@ //@ [LINUX] filecheck-flags: -DINSTR_PROF_COVFUN=__llvm_covfun //@ [LINUX] filecheck-flags: '-DCOMDAT_IF_SUPPORTED=, comdat' -//@ [DARWIN] only-macos +//@ [DARWIN] only-apple //@ [DARWIN] filecheck-flags: -DINSTR_PROF_DATA=__DATA,__llvm_prf_data,regular,live_support //@ [DARWIN] filecheck-flags: -DINSTR_PROF_NAME=__DATA,__llvm_prf_names //@ [DARWIN] filecheck-flags: -DINSTR_PROF_CNTS=__DATA,__llvm_prf_cnts @@ -49,7 +49,7 @@ where pub fn wrap_with(inner: T, should_wrap: bool, wrapper: F) where - F: FnOnce(&T) + F: FnOnce(&T), { if should_wrap { wrapper(&inner) diff --git a/tests/codegen/issues/issue-44056-macos-tls-align.rs b/tests/codegen/issues/issue-44056-macos-tls-align.rs index c99f0b73038bd..972b8490d18f9 100644 --- a/tests/codegen/issues/issue-44056-macos-tls-align.rs +++ b/tests/codegen/issues/issue-44056-macos-tls-align.rs @@ -1,5 +1,5 @@ // -//@ only-macos +//@ only-apple //@ compile-flags: -O #![crate_type = "rlib"] diff --git a/tests/codegen/mainsubprogram.rs b/tests/codegen/mainsubprogram.rs index c1933b2b3904e..12b24c90229ec 100644 --- a/tests/codegen/mainsubprogram.rs +++ b/tests/codegen/mainsubprogram.rs @@ -2,7 +2,7 @@ // before 4.0, formerly backported to the Rust LLVM fork. //@ ignore-windows -//@ ignore-macos +//@ ignore-apple //@ ignore-wasi //@ compile-flags: -g -C no-prepopulate-passes @@ -10,5 +10,4 @@ // CHECK-LABEL: @main // CHECK: {{.*}}DISubprogram{{.*}}name: "main",{{.*}}DI{{(SP)?}}FlagMainSubprogram{{.*}} -pub fn main() { -} +pub fn main() {} diff --git a/tests/codegen/mainsubprogramstart.rs b/tests/codegen/mainsubprogramstart.rs index 84d680b9bff91..20741791db5cf 100644 --- a/tests/codegen/mainsubprogramstart.rs +++ b/tests/codegen/mainsubprogramstart.rs @@ -1,5 +1,5 @@ //@ ignore-windows -//@ ignore-macos +//@ ignore-apple //@ ignore-wasi wasi codegens the main symbol differently //@ compile-flags: -g -C no-prepopulate-passes diff --git a/tests/codegen/pgo-counter-bias.rs b/tests/codegen/pgo-counter-bias.rs index 1263eaf206f78..87d31073d5ae1 100644 --- a/tests/codegen/pgo-counter-bias.rs +++ b/tests/codegen/pgo-counter-bias.rs @@ -1,6 +1,6 @@ // Test that __llvm_profile_counter_bias does not get internalized by lto. -//@ ignore-macos -runtime-counter-relocation not honored on Mach-O +//@ ignore-apple -runtime-counter-relocation not honored on Mach-O //@ compile-flags: -Cprofile-generate -Cllvm-args=-runtime-counter-relocation -Clto=fat //@ needs-profiler-support //@ no-prefer-dynamic diff --git a/tests/run-make/c-dynamic-dylib/Makefile b/tests/run-make/c-dynamic-dylib/Makefile index 0d40964048678..39561b28222ca 100644 --- a/tests/run-make/c-dynamic-dylib/Makefile +++ b/tests/run-make/c-dynamic-dylib/Makefile @@ -4,7 +4,7 @@ # ignore-cross-compile include ../tools.mk -# ignore-macos +# ignore-apple # # This hits an assertion in the linker on older versions of osx apparently diff --git a/tests/run-make/c-dynamic-rlib/Makefile b/tests/run-make/c-dynamic-rlib/Makefile index a64e89cc0dc40..7b05e3d91a098 100644 --- a/tests/run-make/c-dynamic-rlib/Makefile +++ b/tests/run-make/c-dynamic-rlib/Makefile @@ -4,7 +4,7 @@ # ignore-cross-compile include ../tools.mk -# ignore-macos +# ignore-apple # # This hits an assertion in the linker on older versions of osx apparently diff --git a/tests/run-make/emit-stack-sizes/Makefile b/tests/run-make/emit-stack-sizes/Makefile index f636ebd28f2ea..b546fcba5121e 100644 --- a/tests/run-make/emit-stack-sizes/Makefile +++ b/tests/run-make/emit-stack-sizes/Makefile @@ -1,10 +1,10 @@ include ../tools.mk # ignore-windows -# ignore-macos +# ignore-apple # # This feature only works when the output object format is ELF so we ignore -# macOS and Windows +# Apple and Windows # check that the .stack_sizes section is generated all: diff --git a/tests/run-make/fpic/Makefile b/tests/run-make/fpic/Makefile index c38dd8d6e8c4b..d3754d17372ff 100644 --- a/tests/run-make/fpic/Makefile +++ b/tests/run-make/fpic/Makefile @@ -2,7 +2,7 @@ include ../tools.mk # ignore-windows -# ignore-macos +# ignore-apple # Test for #39529. # `-z text` causes ld to error if there are any non-PIC sections diff --git a/tests/run-make/link-framework/Makefile b/tests/run-make/link-framework/Makefile index f33347ac7f8f5..96d832ad4a832 100644 --- a/tests/run-make/link-framework/Makefile +++ b/tests/run-make/link-framework/Makefile @@ -1,4 +1,4 @@ -# only-macos +# only-apple # # Check that linking to a framework actually makes it to the linker. diff --git a/tests/run-make/macos-fat-archive/Makefile b/tests/run-make/macos-fat-archive/Makefile index b6582c809e8b4..0feb39a23cb54 100644 --- a/tests/run-make/macos-fat-archive/Makefile +++ b/tests/run-make/macos-fat-archive/Makefile @@ -1,4 +1,4 @@ -# only-macos +# only-apple include ../tools.mk diff --git a/tests/run-make/native-link-modifier-verbatim-linker/Makefile b/tests/run-make/native-link-modifier-verbatim-linker/Makefile index 256dc2d0664ee..47ed2a1429185 100644 --- a/tests/run-make/native-link-modifier-verbatim-linker/Makefile +++ b/tests/run-make/native-link-modifier-verbatim-linker/Makefile @@ -1,5 +1,5 @@ # ignore-cross-compile -# ignore-macos +# ignore-apple include ../tools.mk diff --git a/tests/run-make/used-cdylib-macos/Makefile b/tests/run-make/used-cdylib-macos/Makefile index 38a4c31c7b3af..bdf914a1ca950 100644 --- a/tests/run-make/used-cdylib-macos/Makefile +++ b/tests/run-make/used-cdylib-macos/Makefile @@ -1,9 +1,9 @@ include ../tools.mk -# only-macos +# only-apple # # This checks that `#[used]` passes through to the linker on -# darwin. This is subject to change in the future, see +# Apple targets. This is subject to change in the future, see # https://github.com/rust-lang/rust/pull/93718 for discussion all: diff --git a/tests/run-pass-valgrind/exit-flushes.rs b/tests/run-pass-valgrind/exit-flushes.rs index fa9196a3eecbe..c2072cf0bf834 100644 --- a/tests/run-pass-valgrind/exit-flushes.rs +++ b/tests/run-pass-valgrind/exit-flushes.rs @@ -1,6 +1,6 @@ //@ ignore-wasm32 no subprocess support //@ ignore-sgx no processes -//@ ignore-macos this needs valgrind 3.11 or higher; see +//@ ignore-apple this needs valgrind 3.11 or higher; see // https://github.com/rust-lang/rust/pull/30365#issuecomment-165763679 use std::env; @@ -11,8 +11,7 @@ fn main() { print!("hello!"); exit(0); } else { - let out = Command::new(env::args().next().unwrap()).arg("foo") - .output().unwrap(); + let out = Command::new(env::args().next().unwrap()).arg("foo").output().unwrap(); assert!(out.status.success()); assert_eq!(String::from_utf8(out.stdout).unwrap(), "hello!"); assert_eq!(String::from_utf8(out.stderr).unwrap(), ""); diff --git a/tests/ui/backtrace/apple-no-dsymutil.rs b/tests/ui/backtrace/apple-no-dsymutil.rs index 9924cd13b0a79..e5aeced25ca35 100644 --- a/tests/ui/backtrace/apple-no-dsymutil.rs +++ b/tests/ui/backtrace/apple-no-dsymutil.rs @@ -2,7 +2,7 @@ //@ compile-flags:-Cstrip=none //@ compile-flags:-g -Csplit-debuginfo=unpacked -//@ only-macos +//@ only-apple use std::process::Command; use std::str; diff --git a/tests/ui/deployment-target/macos-target.rs b/tests/ui/deployment-target/macos-target.rs index be2c32e28141b..197edd024746e 100644 --- a/tests/ui/deployment-target/macos-target.rs +++ b/tests/ui/deployment-target/macos-target.rs @@ -1,4 +1,4 @@ -//@ only-macos +//@ only-apple //@ compile-flags: --print deployment-target //@ normalize-stdout-test: "\d+\." -> "$$CURRENT_MAJOR_VERSION." //@ normalize-stdout-test: "\d+" -> "$$CURRENT_MINOR_VERSION" diff --git a/tests/ui/intrinsics/intrinsic-alignment.rs b/tests/ui/intrinsics/intrinsic-alignment.rs index 4856da553a80d..138273aadd2f1 100644 --- a/tests/ui/intrinsics/intrinsic-alignment.rs +++ b/tests/ui/intrinsics/intrinsic-alignment.rs @@ -10,20 +10,21 @@ mod rusti { } } -#[cfg(any(target_os = "android", - target_os = "dragonfly", - target_os = "emscripten", - target_os = "freebsd", - target_os = "fuchsia", - target_os = "hurd", - target_os = "illumos", - target_os = "linux", - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd", - target_os = "solaris", - target_os = "vxworks", - target_os = "nto", +#[cfg(any( + target_os = "android", + target_os = "dragonfly", + target_os = "emscripten", + target_os = "freebsd", + target_os = "fuchsia", + target_os = "hurd", + target_os = "illumos", + target_os = "linux", + target_os = "netbsd", + target_os = "openbsd", + target_os = "solaris", + target_os = "vxworks", + target_os = "nto", + target_vendor = "apple", ))] mod m { #[cfg(target_arch = "x86")] diff --git a/tests/ui/issues/issue-45731.rs b/tests/ui/issues/issue-45731.rs index 8e483d08cb516..49335362dd0f7 100644 --- a/tests/ui/issues/issue-45731.rs +++ b/tests/ui/issues/issue-45731.rs @@ -2,10 +2,10 @@ #![allow(unused_variables)] //@ compile-flags:--test -g -#[cfg(target_os = "macos")] +#[cfg(target_vendor = "apple")] #[test] fn simple_test() { - use std::{env, panic, fs}; + use std::{env, fs, panic}; // Find our dSYM and replace the DWARF binary with an empty file let mut dsym_path = env::current_exe().unwrap(); @@ -13,8 +13,13 @@ fn simple_test() { assert!(dsym_path.pop()); // Pop executable dsym_path.push(format!("{}.dSYM/Contents/Resources/DWARF/{0}", executable_name)); { - let file = fs::OpenOptions::new().read(false).write(true).truncate(true).create(false) - .open(&dsym_path).unwrap(); + let file = fs::OpenOptions::new() + .read(false) + .write(true) + .truncate(true) + .create(false) + .open(&dsym_path) + .unwrap(); } env::set_var("RUST_BACKTRACE", "1"); diff --git a/tests/ui/link-section.rs b/tests/ui/link-section.rs index 9299b4d08b231..1a791b88ef957 100644 --- a/tests/ui/link-section.rs +++ b/tests/ui/link-section.rs @@ -1,32 +1,32 @@ //@ run-pass #![allow(non_upper_case_globals)] -#[cfg(not(target_os = "macos"))] -#[link_section=".moretext"] +#[cfg(not(target_vendor = "apple"))] +#[link_section = ".moretext"] fn i_live_in_more_text() -> &'static str { "knock knock" } -#[cfg(not(target_os = "macos"))] -#[link_section=".imm"] +#[cfg(not(target_vendor = "apple"))] +#[link_section = ".imm"] static magic: usize = 42; -#[cfg(not(target_os = "macos"))] -#[link_section=".mut"] +#[cfg(not(target_vendor = "apple"))] +#[link_section = ".mut"] static mut frobulator: usize = 0xdeadbeef; -#[cfg(target_os = "macos")] -#[link_section="__TEXT,__moretext"] +#[cfg(target_vendor = "apple")] +#[link_section = "__TEXT,__moretext"] fn i_live_in_more_text() -> &'static str { "knock knock" } -#[cfg(target_os = "macos")] -#[link_section="__RODATA,__imm"] +#[cfg(target_vendor = "apple")] +#[link_section = "__RODATA,__imm"] static magic: usize = 42; -#[cfg(target_os = "macos")] -#[link_section="__DATA,__mut"] +#[cfg(target_vendor = "apple")] +#[link_section = "__DATA,__mut"] static mut frobulator: usize = 0xdeadbeef; pub fn main() { diff --git a/tests/ui/linkage-attr/framework.rs b/tests/ui/linkage-attr/framework.rs index 824adf62206da..08f4394db21f3 100644 --- a/tests/ui/linkage-attr/framework.rs +++ b/tests/ui/linkage-attr/framework.rs @@ -1,5 +1,5 @@ // Check that linking frameworks on Apple platforms works. -//@ only-macos +//@ only-apple //@ revisions: omit link weak both //@ [omit]build-fail //@ [link]run-pass diff --git a/tests/ui/osx-frameworks.rs b/tests/ui/linkage-attr/kind-framework.rs similarity index 58% rename from tests/ui/osx-frameworks.rs rename to tests/ui/linkage-attr/kind-framework.rs index b0d7a3a9c07af..c2f90809e03a0 100644 --- a/tests/ui/osx-frameworks.rs +++ b/tests/ui/linkage-attr/kind-framework.rs @@ -1,4 +1,4 @@ -//@ ignore-macos this is supposed to succeed on osx +//@ ignore-apple this is supposed to succeed on Apple platforms (though it won't necessarily link) #[link(name = "foo", kind = "framework")] extern "C" {} diff --git a/tests/ui/osx-frameworks.stderr b/tests/ui/linkage-attr/kind-framework.stderr similarity index 89% rename from tests/ui/osx-frameworks.stderr rename to tests/ui/linkage-attr/kind-framework.stderr index 8582b8123bfe1..93dacd68e294b 100644 --- a/tests/ui/osx-frameworks.stderr +++ b/tests/ui/linkage-attr/kind-framework.stderr @@ -1,5 +1,5 @@ error[E0455]: link kind `framework` is only supported on Apple targets - --> $DIR/osx-frameworks.rs:3:29 + --> $DIR/kind-framework.rs:3:29 | LL | #[link(name = "foo", kind = "framework")] | ^^^^^^^^^^^ diff --git a/tests/ui/issues/issue-33992.rs b/tests/ui/linkage-attr/linkage-attr-does-not-panic-llvm-issue-33992.rs similarity index 96% rename from tests/ui/issues/issue-33992.rs rename to tests/ui/linkage-attr/linkage-attr-does-not-panic-llvm-issue-33992.rs index 495751436e127..a169997927ebf 100644 --- a/tests/ui/issues/issue-33992.rs +++ b/tests/ui/linkage-attr/linkage-attr-does-not-panic-llvm-issue-33992.rs @@ -1,6 +1,6 @@ //@ run-pass //@ ignore-windows -//@ ignore-macos +//@ ignore-apple //@ ignore-wasm32 common linkage not implemented right now #![feature(linkage)] diff --git a/tests/ui/linkage-attr/linkage1.rs b/tests/ui/linkage-attr/linkage1.rs index 2edb80bf1b025..19bf601d9d205 100644 --- a/tests/ui/linkage-attr/linkage1.rs +++ b/tests/ui/linkage-attr/linkage1.rs @@ -1,6 +1,6 @@ //@ run-pass //@ ignore-windows -//@ ignore-macos +//@ ignore-apple //@ ignore-emscripten doesn't support this linkage //@ ignore-sgx weak linkage not permitted //@ aux-build:linkage1.rs diff --git a/tests/ui/issues/issue-18804/auxiliary/lib.rs b/tests/ui/linkage-attr/propagate-generic-issue-18804/auxiliary/lib.rs similarity index 100% rename from tests/ui/issues/issue-18804/auxiliary/lib.rs rename to tests/ui/linkage-attr/propagate-generic-issue-18804/auxiliary/lib.rs diff --git a/tests/ui/issues/issue-18804/main.rs b/tests/ui/linkage-attr/propagate-generic-issue-18804/main.rs similarity index 91% rename from tests/ui/issues/issue-18804/main.rs rename to tests/ui/linkage-attr/propagate-generic-issue-18804/main.rs index d83fe697470b3..56a9358cce3cf 100644 --- a/tests/ui/issues/issue-18804/main.rs +++ b/tests/ui/linkage-attr/propagate-generic-issue-18804/main.rs @@ -4,7 +4,7 @@ //@ ignore-emscripten no weak symbol support //@ ignore-windows no extern_weak linkage -//@ ignore-macos no extern_weak linkage +//@ ignore-apple no extern_weak linkage //@ aux-build:lib.rs diff --git a/tests/ui/manual/manual-link-framework.rs b/tests/ui/manual/manual-link-framework.rs index 06fd76f68df14..43cdda0a4e6ac 100644 --- a/tests/ui/manual/manual-link-framework.rs +++ b/tests/ui/manual/manual-link-framework.rs @@ -1,7 +1,5 @@ -//@ ignore-macos -//@ ignore-ios +//@ ignore-apple //@ compile-flags:-l framework=foo //@ error-pattern: library kind `framework` is only supported on Apple targets -fn main() { -} +fn main() {} diff --git a/tests/ui/structs-enums/enum-rec/issue-17431-6.rs b/tests/ui/structs-enums/enum-rec/issue-17431-6.rs index d8343704f12b9..0183bdba11193 100644 --- a/tests/ui/structs-enums/enum-rec/issue-17431-6.rs +++ b/tests/ui/structs-enums/enum-rec/issue-17431-6.rs @@ -1,4 +1,4 @@ -//@ ignore-macos: cycle error does not appear on apple +//@ ignore-apple: cycle error does not appear on apple use std::sync::Mutex; diff --git a/tests/ui/structs-enums/rec-align-u64.rs b/tests/ui/structs-enums/rec-align-u64.rs index 72601bb16fffa..8ea72fdf45c88 100644 --- a/tests/ui/structs-enums/rec-align-u64.rs +++ b/tests/ui/structs-enums/rec-align-u64.rs @@ -30,21 +30,21 @@ struct Outer { t: Inner } - -#[cfg(any(target_os = "android", - target_os = "dragonfly", - target_os = "emscripten", - target_os = "freebsd", - target_os = "fuchsia", - target_os = "hurd", - target_os = "illumos", - target_os = "linux", - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd", - target_os = "solaris", - target_os = "vxworks", - target_os = "nto", +#[cfg(any( + target_os = "android", + target_os = "dragonfly", + target_os = "emscripten", + target_os = "freebsd", + target_os = "fuchsia", + target_os = "hurd", + target_os = "illumos", + target_os = "linux", + target_os = "netbsd", + target_os = "openbsd", + target_os = "solaris", + target_os = "vxworks", + target_os = "nto", + target_vendor = "apple", ))] mod m { #[cfg(target_arch = "x86")]