mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Even though Float16 is unavailable on macOS, the type metadata can still be referenced, for example from another unavailable declaration. Make sure it has the correct OS version annotation so that it can be weak linked. Part of <rdar://problem/72151067>.
16 lines
569 B
Swift
16 lines
569 B
Swift
// RUN: %target-swift-frontend -emit-ir %s -target x86_64-apple-macos10.15 | %FileCheck %s --check-prefix=CHECK10
|
|
// RUN: %target-swift-frontend -emit-ir %s -target x86_64-apple-macos11 | %FileCheck %s --check-prefix=CHECK11
|
|
|
|
// REQUIRES: OS=macosx
|
|
// REQUIRES: CPU=x86_64
|
|
// UNSUPPORTED: use_os_stdlib
|
|
|
|
@available(macOS 11, *)
|
|
public struct Float16Wrapper {
|
|
@available(macOS, unavailable)
|
|
var x: Float16
|
|
}
|
|
|
|
// CHECK10-LABEL: @"$ss7Float16VMn" = extern_weak global %swift.type_descriptor
|
|
// CHECK11-LABEL: @"$ss7Float16VMn" = external global %swift.type_descriptor
|