about summary refs log tree commit diff
path: root/tests/run-make/apple-c-available-links/rmake.rs
blob: 44a5ee94d577e7ec3920ee9de013060abefae9c7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
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();
}