2024-03-18 17:27:34 -05:00
|
|
|
// Check that linking frameworks on Apple platforms works.
|
2024-05-27 08:17:18 -05:00
|
|
|
//@ only-apple
|
2024-03-18 17:27:34 -05:00
|
|
|
//@ revisions: omit link weak both
|
|
|
|
//@ [omit]build-fail
|
|
|
|
//@ [link]run-pass
|
|
|
|
//@ [weak]run-pass
|
|
|
|
//@ [both]run-pass
|
|
|
|
|
2024-04-03 08:07:53 -05:00
|
|
|
// The linker's exact error output changes between Xcode versions, depends on
|
|
|
|
// linker invocation details, and the linker sometimes outputs more warnings.
|
2024-03-18 17:27:34 -05:00
|
|
|
//@ compare-output-lines-by-subset
|
2024-04-03 08:07:53 -05:00
|
|
|
//@ normalize-stderr-test: "linking with `.*` failed" -> "linking with `LINKER` failed"
|
2024-03-18 17:27:34 -05:00
|
|
|
//@ normalize-stderr-test: "Undefined symbols for architecture .*" -> "ld: Undefined symbols:"
|
|
|
|
//@ normalize-stderr-test: "._CFRunLoopGetTypeID.," -> "_CFRunLoopGetTypeID,"
|
|
|
|
|
|
|
|
#![cfg_attr(any(weak, both), feature(link_arg_attribute))]
|
|
|
|
|
|
|
|
#[cfg_attr(any(link, both), link(name = "CoreFoundation", kind = "framework"))]
|
|
|
|
#[cfg_attr(
|
|
|
|
any(weak, both),
|
|
|
|
link(name = "-weak_framework", kind = "link-arg", modifiers = "+verbatim"),
|
|
|
|
link(name = "CoreFoundation", kind = "link-arg", modifiers = "+verbatim")
|
|
|
|
)]
|
|
|
|
extern "C" {
|
|
|
|
fn CFRunLoopGetTypeID() -> core::ffi::c_ulong;
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn main() {
|
|
|
|
unsafe {
|
|
|
|
CFRunLoopGetTypeID();
|
|
|
|
}
|
|
|
|
}
|