diff --git a/tests/ui/linkage-attr/uikit-framework.rs b/tests/ui/linkage-attr/uikit-framework.rs new file mode 100644 index 0000000000000..cb4e621f9b0b3 --- /dev/null +++ b/tests/ui/linkage-attr/uikit-framework.rs @@ -0,0 +1,24 @@ +//! Check that linking to UIKit on platforms where that is available works. +//@ revisions: ios tvos watchos +//@ [ios]only-ios +//@ [tvos]only-tvos +//@ [watchos]only-watchos +//@ build-pass + +use std::ffi::{c_char, c_int, c_void}; + +#[link(name = "UIKit", kind = "framework")] +extern "C" { + pub fn UIApplicationMain( + argc: c_int, + argv: *const c_char, + principalClassName: *const c_void, + delegateClassName: *const c_void, + ) -> c_int; +} + +pub fn main() { + unsafe { + UIApplicationMain(0, core::ptr::null(), core::ptr::null(), core::ptr::null()); + } +}