about summary refs log tree commit diff
diff options
context:
space:
mode:
author许杰友 Jieyou Xu (Joe) <39484203+jieyouxu@users.noreply.github.com>2024-05-29 03:25:08 +0100
committerGitHub <noreply@github.com>2024-05-29 03:25:08 +0100
commit3cc59aeaaeddb6fa6c2723e4664f46a395d25e30 (patch)
tree3587fc3686974f86f3119a1a7fec8d7edaf955d5
parent7e441a11a151098a0ff928fdeb52492798678ede (diff)
parente6b9bb7b7200c69b82fd69572a7c0a03ead3d60f (diff)
downloadrust-3cc59aeaaeddb6fa6c2723e4664f46a395d25e30.tar.gz
rust-3cc59aeaaeddb6fa6c2723e4664f46a395d25e30.zip
Rollup merge of #125226 - madsmtm:fix-mac-catalyst-tests, r=workingjubilee
Make more of the test suite run on Mac Catalyst

Combined with https://github.com/rust-lang/rust/pull/125225, the only failing parts of the test suite are in `tests/rustdoc-js`, `tests/rustdoc-js-std` and `tests/debuginfo`. Tested with:
```console
./x test --target=aarch64-apple-ios-macabi library/std
./x test --target=aarch64-apple-ios-macabi --skip=tests/rustdoc-js --skip=tests/rustdoc-js-std --skip=tests/debuginfo tests
```

Will probably put up a PR later to enable _running_ on (not just compiling for) Mac Catalyst in CI, though not sure where exactly I should do so? `src/ci/github-actions/jobs.yml`?

Note that I've deliberately _not_ enabled stack overflow handlers on iOS/tvOS/watchOS/visionOS (see https://github.com/rust-lang/rust/issues/25872), but rather just skipped those tests, as it uses quite a few APIs that I'd be weary about getting rejected by the App Store (note that Swift doesn't do it on those platforms either).

r? ``@workingjubilee``

CC ``@thomcc``

``@rustbot`` label O-ios O-apple
-rw-r--r--library/std/src/fs/tests.rs2
-rw-r--r--library/std/src/sys/pal/unix/stack_overflow.rs8
-rw-r--r--src/bootstrap/src/utils/dylib.rs2
-rw-r--r--src/tools/compiletest/src/header.rs3
-rw-r--r--src/tools/compiletest/src/header/cfg.rs6
-rw-r--r--src/tools/compiletest/src/runtest.rs2
-rw-r--r--src/tools/compiletest/src/util.rs2
-rw-r--r--src/tools/tidy/src/issues.txt1
-rw-r--r--src/tools/tidy/src/ui_tests.rs2
-rw-r--r--tests/assembly/stack-protector/stack-protector-heuristics-effect.rs5
-rw-r--r--tests/assembly/x86_64-array-pair-load-store-merge.rs2
-rw-r--r--tests/assembly/x86_64-function-return.rs2
-rw-r--r--tests/codegen/gdb_debug_script_load.rs2
-rw-r--r--tests/codegen/instrument-coverage/testprog.rs4
-rw-r--r--tests/codegen/issues/issue-44056-macos-tls-align.rs2
-rw-r--r--tests/codegen/mainsubprogram.rs5
-rw-r--r--tests/codegen/mainsubprogramstart.rs2
-rw-r--r--tests/codegen/pgo-counter-bias.rs2
-rw-r--r--tests/run-make/c-dynamic-dylib/Makefile2
-rw-r--r--tests/run-make/c-dynamic-rlib/Makefile2
-rw-r--r--tests/run-make/emit-stack-sizes/Makefile4
-rw-r--r--tests/run-make/fpic/Makefile2
-rw-r--r--tests/run-make/link-framework/Makefile2
-rw-r--r--tests/run-make/macos-fat-archive/Makefile2
-rw-r--r--tests/run-make/native-link-modifier-verbatim-linker/Makefile2
-rw-r--r--tests/run-make/used-cdylib-macos/Makefile4
-rw-r--r--tests/run-pass-valgrind/exit-flushes.rs5
-rw-r--r--tests/ui/abi/stack-probes-lto.rs4
-rw-r--r--tests/ui/abi/stack-probes.rs4
-rw-r--r--tests/ui/backtrace/apple-no-dsymutil.rs2
-rw-r--r--tests/ui/deployment-target/macos-target.rs2
-rw-r--r--tests/ui/intrinsics/intrinsic-alignment.rs29
-rw-r--r--tests/ui/issues/issue-45731.rs13
-rw-r--r--tests/ui/link-section.rs24
-rw-r--r--tests/ui/linkage-attr/framework.rs2
-rw-r--r--tests/ui/linkage-attr/kind-framework.rs (renamed from tests/ui/osx-frameworks.rs)2
-rw-r--r--tests/ui/linkage-attr/kind-framework.stderr (renamed from tests/ui/osx-frameworks.stderr)2
-rw-r--r--tests/ui/linkage-attr/linkage-attr-does-not-panic-llvm-issue-33992.rs (renamed from tests/ui/issues/issue-33992.rs)2
-rw-r--r--tests/ui/linkage-attr/linkage1.rs2
-rw-r--r--tests/ui/linkage-attr/propagate-generic-issue-18804/auxiliary/lib.rs (renamed from tests/ui/issues/issue-18804/auxiliary/lib.rs)0
-rw-r--r--tests/ui/linkage-attr/propagate-generic-issue-18804/main.rs (renamed from tests/ui/issues/issue-18804/main.rs)2
-rw-r--r--tests/ui/manual/manual-link-framework.rs6
-rw-r--r--tests/ui/panic-runtime/abort-link-to-unwinding-crates.rs4
-rw-r--r--tests/ui/panic-runtime/abort.rs4
-rw-r--r--tests/ui/panic-runtime/link-to-abort.rs1
-rw-r--r--tests/ui/runtime/out-of-stack.rs4
-rw-r--r--tests/ui/structs-enums/enum-rec/issue-17431-6.rs2
-rw-r--r--tests/ui/structs-enums/rec-align-u64.rs30
48 files changed, 120 insertions, 100 deletions
diff --git a/library/std/src/fs/tests.rs b/library/std/src/fs/tests.rs
index dfa05671ab0..62a268facb6 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/library/std/src/sys/pal/unix/stack_overflow.rs b/library/std/src/sys/pal/unix/stack_overflow.rs
index 26c49257ad0..2e5bd85327a 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):
+// <https://github.com/apple/swift/blob/swift-5.10-RELEASE/stdlib/public/runtime/CrashHandlerMacOS.cpp>
 #[cfg(not(any(
     target_os = "linux",
     target_os = "freebsd",
diff --git a/src/bootstrap/src/utils/dylib.rs b/src/bootstrap/src/utils/dylib.rs
index b6e7aec1756..90bcff59a64 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 c7c807d3e68..dc5818201b6 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 df8c8047050..510043e3bfd 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 02c9d384ab7..e8ceff84722 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<String> {
         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 8f9425eb071..09a7f0395cf 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 881b4f84173..398a6fd0fba 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 055d620361f..cce0fb2c1a2 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 8e32d170244..1f15f1a318a 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 9cf54ae14a1..849f34e72e5 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 64eb05062cb..7cfdf5bce0c 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 f15defeaca8..30d518c0bcb 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 b352cbdb755..acc4f35d905 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<F, T>(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 c99f0b73038..972b8490d18 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 c1933b2b390..12b24c90229 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 84d680b9bff..20741791db5 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 1263eaf206f..87d31073d5a 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 0d409640486..39561b28222 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 a64e89cc0dc..7b05e3d91a0 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 f636ebd28f2..b546fcba512 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 c38dd8d6e8c..d3754d17372 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 f33347ac7f8..96d832ad4a8 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 b6582c809e8..0feb39a23cb 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 256dc2d0664..47ed2a14291 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 38a4c31c7b3..bdf914a1ca9 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 fa9196a3eec..c2072cf0bf8 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/abi/stack-probes-lto.rs b/tests/ui/abi/stack-probes-lto.rs
index 5451b72d979..70343b0599a 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 32d4d6cd31e..22304257593 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/backtrace/apple-no-dsymutil.rs b/tests/ui/backtrace/apple-no-dsymutil.rs
index 9924cd13b0a..e5aeced25ca 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 be2c32e2814..197edd02474 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 4856da553a8..138273aadd2 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 8e483d08cb5..49335362dd0 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 9299b4d08b2..1a791b88ef9 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 824adf62206..08f4394db21 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
index b0d7a3a9c07..c2f90809e03 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
index 8582b8123bf..93dacd68e29 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
index 495751436e1..a169997927e 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 2edb80bf1b0..19bf601d9d2 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
index e29d48285d8..e29d48285d8 100644
--- a/tests/ui/issues/issue-18804/auxiliary/lib.rs
+++ b/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
index d83fe697470..56a9358cce3 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 06fd76f68df..43cdda0a4e6 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/panic-runtime/abort-link-to-unwinding-crates.rs b/tests/ui/panic-runtime/abort-link-to-unwinding-crates.rs
index 11e4929f12e..ce6644e6758 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 22bd2ecfb00..caf0243ebdb 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 2a7052616f2..a4013f2a6cf 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)]
 
diff --git a/tests/ui/runtime/out-of-stack.rs b/tests/ui/runtime/out-of-stack.rs
index a62398df8b8..c5300635ad9 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)]
 
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 d8343704f12..0183bdba111 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 72601bb16ff..8ea72fdf45c 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")]