summaryrefslogtreecommitdiffstats
path: root/compiler/rustc_target/src/spec/apple/tests.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:18:25 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:18:25 +0000
commit5363f350887b1e5b5dd21a86f88c8af9d7fea6da (patch)
tree35ca005eb6e0e9a1ba3bb5dbc033209ad445dc17 /compiler/rustc_target/src/spec/apple/tests.rs
parentAdding debian version 1.66.0+dfsg1-1. (diff)
downloadrustc-5363f350887b1e5b5dd21a86f88c8af9d7fea6da.tar.xz
rustc-5363f350887b1e5b5dd21a86f88c8af9d7fea6da.zip
Merging upstream version 1.67.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'compiler/rustc_target/src/spec/apple/tests.rs')
-rw-r--r--compiler/rustc_target/src/spec/apple/tests.rs35
1 files changed, 35 insertions, 0 deletions
diff --git a/compiler/rustc_target/src/spec/apple/tests.rs b/compiler/rustc_target/src/spec/apple/tests.rs
new file mode 100644
index 000000000..3c90a5e7e
--- /dev/null
+++ b/compiler/rustc_target/src/spec/apple/tests.rs
@@ -0,0 +1,35 @@
+use crate::spec::{
+ aarch64_apple_darwin, aarch64_apple_ios_sim, aarch64_apple_watchos_sim, i686_apple_darwin,
+ x86_64_apple_darwin, x86_64_apple_ios, x86_64_apple_tvos, x86_64_apple_watchos_sim,
+};
+
+#[test]
+fn simulator_targets_set_abi() {
+ let all_sim_targets = [
+ x86_64_apple_ios::target(),
+ x86_64_apple_tvos::target(),
+ x86_64_apple_watchos_sim::target(),
+ aarch64_apple_ios_sim::target(),
+ // Note: There is currently no ARM64 tvOS simulator target
+ aarch64_apple_watchos_sim::target(),
+ ];
+
+ for target in all_sim_targets {
+ assert_eq!(target.abi, "sim")
+ }
+}
+
+#[test]
+fn macos_link_environment_unmodified() {
+ let all_macos_targets = [
+ aarch64_apple_darwin::target(),
+ i686_apple_darwin::target(),
+ x86_64_apple_darwin::target(),
+ ];
+
+ for target in all_macos_targets {
+ // macOS targets should only remove information for cross-compiling, but never
+ // for the host.
+ assert_eq!(target.link_env_remove, crate::spec::cvs!["IPHONEOS_DEPLOYMENT_TARGET"]);
+ }
+}