Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions stdlib/public/core/Availability.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ public func _stdlib_isOSVersionAtLeast(
_ patch: Builtin.Word
) -> Builtin.Int1 {
#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
if Int(major) == 9999 {
return true._value
}
// The call to _swift_stdlib_operatingSystemVersion is used as an indicator
// that this function was called by a compiler optimization pass. If it is
// replaced that pass needs to be updated.
Expand Down
3 changes: 3 additions & 0 deletions test/stdlib/Runtime.swift.gyb
Original file line number Diff line number Diff line change
Expand Up @@ -766,6 +766,9 @@ AvailabilityVersionsTestSuite.test("_stdlib_isOSVersionAtLeast") {
expectFalse(isAtLeastOS(1066, 0, 0))
expectTrue(isAtLeastOS(0, 1066, 0))
expectTrue(isAtLeastOS(0, 0, 1066))

// 9999 is a special version that's always available
expectTrue(isAtLeastOS(9999, 0, 0))
#endif
}

Expand Down