Files
swift-mirror/test/IRGen/float16_macos.swift
Slava Pestov 7a500a1307 stdlib: Float16 needs an @available annotation for macOS
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>.
2021-02-16 13:54:27 -05:00

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