about summary refs log tree commit diff
path: root/tests/run-make/apple-c-available-links/rmake.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/run-make/apple-c-available-links/rmake.rs')
-rw-r--r--tests/run-make/apple-c-available-links/rmake.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/run-make/apple-c-available-links/rmake.rs b/tests/run-make/apple-c-available-links/rmake.rs
new file mode 100644
index 00000000000..44a5ee94d57
--- /dev/null
+++ b/tests/run-make/apple-c-available-links/rmake.rs
@@ -0,0 +1,14 @@
+//! Test that using `__builtin_available` in C (`@available` in Objective-C)
+//! successfully links (because `std` provides the required symbols).
+
+//@ only-apple __builtin_available is (mostly) specific to Apple platforms.
+
+use run_make_support::{cc, rustc, target};
+
+fn main() {
+    // Invoke the C compiler to generate an object file.
+    cc().arg("-c").input("foo.c").output("foo.o").run();
+
+    // Link the object file together with a Rust program.
+    rustc().target(target()).input("main.rs").link_arg("foo.o").run();
+}