Skip to content

Commit 6add45f

Browse files
committed
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.
1 parent bf54029 commit 6add45f

File tree

36 files changed

+95
-89
lines changed

36 files changed

+95
-89
lines changed

library/std/src/fs/tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1431,7 +1431,7 @@ fn metadata_access_times() {
14311431
assert_eq!(check!(a.modified()), check!(a.modified()));
14321432
assert_eq!(check!(b.accessed()), check!(b.modified()));
14331433

1434-
if cfg!(target_os = "macos") || cfg!(target_os = "windows") {
1434+
if cfg!(target_vendor = "apple") || cfg!(target_os = "windows") {
14351435
check!(a.created());
14361436
check!(b.created());
14371437
}

src/bootstrap/src/utils/dylib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
pub fn dylib_path_var() -> &'static str {
66
if cfg!(target_os = "windows") {
77
"PATH"
8-
} else if cfg!(target_os = "macos") {
8+
} else if cfg!(target_vendor = "apple") {
99
"DYLD_LIBRARY_PATH"
1010
} else if cfg!(target_os = "haiku") {
1111
"LIBRARY_PATH"

src/tools/compiletest/src/header.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -747,6 +747,7 @@ const KNOWN_DIRECTIVE_NAMES: &[&str] = &[
747747
"ignore-aarch64",
748748
"ignore-aarch64-unknown-linux-gnu",
749749
"ignore-android",
750+
"ignore-apple",
750751
"ignore-arm",
751752
"ignore-avr",
752753
"ignore-beta",
@@ -829,7 +830,6 @@ const KNOWN_DIRECTIVE_NAMES: &[&str] = &[
829830
"ignore-x32",
830831
"ignore-x86",
831832
"ignore-x86_64",
832-
"ignore-x86_64-apple-darwin",
833833
"ignore-x86_64-unknown-linux-gnu",
834834
"incremental",
835835
"known-bug",
@@ -876,6 +876,7 @@ const KNOWN_DIRECTIVE_NAMES: &[&str] = &[
876876
"only-32bit",
877877
"only-64bit",
878878
"only-aarch64",
879+
"only-apple",
879880
"only-arm",
880881
"only-avr",
881882
"only-beta",

src/tools/compiletest/src/header/cfg.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,12 @@ pub(super) fn parse_cfg_name_directive<'a>(
159159
message: "when the architecture is part of the Thumb family"
160160
}
161161

162+
condition! {
163+
name: "apple",
164+
condition: config.target.contains("apple"),
165+
message: "when the target vendor is Apple"
166+
}
167+
162168
// Technically the locally built compiler uses the "dev" channel rather than the "nightly"
163169
// channel, even though most people don't know or won't care about it. To avoid confusion, we
164170
// treat the "dev" channel as the "nightly" channel when processing the directive.

src/tools/compiletest/src/runtest.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ fn get_lib_name(lib: &str, aux_type: AuxType) -> Option<String> {
9898
AuxType::Lib => Some(format!("lib{}.rlib", lib)),
9999
AuxType::Dylib => Some(if cfg!(windows) {
100100
format!("{}.dll", lib)
101-
} else if cfg!(target_os = "macos") {
101+
} else if cfg!(target_vendor = "apple") {
102102
format!("lib{}.dylib", lib)
103103
} else {
104104
format!("lib{}.so", lib)

src/tools/compiletest/src/util.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ impl PathBufExt for PathBuf {
5757
pub fn dylib_env_var() -> &'static str {
5858
if cfg!(windows) {
5959
"PATH"
60-
} else if cfg!(target_os = "macos") {
60+
} else if cfg!(target_vendor = "apple") {
6161
"DYLD_LIBRARY_PATH"
6262
} else if cfg!(target_os = "haiku") {
6363
"LIBRARY_PATH"

tests/assembly/stack-protector/stack-protector-heuristics-effect.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//@ revisions: all strong basic none missing
22
//@ assembly-output: emit-asm
3-
//@ ignore-macos slightly different policy on stack protection of arrays
3+
//@ ignore-apple slightly different policy on stack protection of arrays
44
//@ ignore-msvc stack check code uses different function names
55
//@ ignore-nvptx64 stack protector is not supported
66
//@ ignore-wasm32-bare
@@ -17,12 +17,9 @@
1717
// See comments on https://github.com/rust-lang/rust/issues/114903.
1818

1919
#![crate_type = "lib"]
20-
2120
#![allow(incomplete_features)]
22-
2321
#![feature(unsized_locals, unsized_fn_params)]
2422

25-
2623
// CHECK-LABEL: emptyfn:
2724
#[no_mangle]
2825
pub fn emptyfn() {

tests/assembly/x86_64-array-pair-load-store-merge.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//@ compile-flags: --crate-type=lib -O -C llvm-args=-x86-asm-syntax=intel
33
//@ only-x86_64
44
//@ ignore-sgx
5-
//@ ignore-macos (manipulates rsp too)
5+
//@ ignore-apple (manipulates rsp too)
66

77
// Depending on various codegen choices, this might end up copying
88
// a `<2 x i8>`, an `i16`, or two `i8`s.

tests/assembly/x86_64-function-return.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
//@ [keep-thunk-extern] compile-flags: -Zfunction-return=keep -Zfunction-return=thunk-extern
1010
//@ [thunk-extern-keep] compile-flags: -Zfunction-return=thunk-extern -Zfunction-return=keep
1111
//@ only-x86_64
12-
//@ ignore-x86_64-apple-darwin Symbol is called `___x86_return_thunk` (Darwin's extra underscore)
12+
//@ ignore-apple Symbol is called `___x86_return_thunk` (Darwin's extra underscore)
1313
//@ ignore-sgx Tests incompatible with LVI mitigations
1414

1515
#![crate_type = "lib"]

tests/codegen/gdb_debug_script_load.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//
22
//@ ignore-windows
3-
//@ ignore-macos
3+
//@ ignore-apple
44
//@ ignore-wasm
55
//@ ignore-emscripten
66

0 commit comments

Comments
 (0)