about summary refs log tree commit diff
path: root/tests/codegen/macos/x86_64-macosx-deployment-target.rs
diff options
context:
space:
mode:
authorJubilee Young <workingjubilee@gmail.com>2023-07-29 17:09:31 -0700
committerJubilee Young <workingjubilee@gmail.com>2023-07-29 18:34:41 -0700
commitdf2264a2845089fee6897e17123d2b78a3a189c1 (patch)
treeecf090cc027470edda4cf3548db83bdc7151b324 /tests/codegen/macos/x86_64-macosx-deployment-target.rs
parent06711615aa5b3d45e77c1aa20df7de14ed16edf2 (diff)
downloadrust-df2264a2845089fee6897e17123d2b78a3a189c1.tar.gz
rust-df2264a2845089fee6897e17123d2b78a3a189c1.zip
tests/codegen/*-macos-* -> macos/*
Diffstat (limited to 'tests/codegen/macos/x86_64-macosx-deployment-target.rs')
-rw-r--r--tests/codegen/macos/x86_64-macosx-deployment-target.rs27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/codegen/macos/x86_64-macosx-deployment-target.rs b/tests/codegen/macos/x86_64-macosx-deployment-target.rs
new file mode 100644
index 00000000000..8e673d11d98
--- /dev/null
+++ b/tests/codegen/macos/x86_64-macosx-deployment-target.rs
@@ -0,0 +1,27 @@
+//
+// Checks that we correctly modify the target when MACOSX_DEPLOYMENT_TARGET is set.
+// See issue #60235.
+
+// compile-flags: -O --target=x86_64-apple-darwin --crate-type=rlib
+// needs-llvm-components: x86
+// rustc-env:MACOSX_DEPLOYMENT_TARGET=10.9
+#![feature(no_core, lang_items)]
+#![no_core]
+
+#[lang="sized"]
+trait Sized { }
+#[lang="freeze"]
+trait Freeze { }
+#[lang="copy"]
+trait Copy { }
+
+#[repr(C)]
+pub struct Bool {
+    b: bool,
+}
+
+// CHECK: target triple = "x86_64-apple-macosx10.9.0"
+#[no_mangle]
+pub extern "C" fn structbool() -> Bool {
+    Bool { b: true }
+}