Skip to content

Commit 42a6782

Browse files
committed
[stdlib] Reinstate the FixedPointConversion tests
1 parent 748fe46 commit 42a6782

File tree

4 files changed

+16
-6
lines changed

4 files changed

+16
-6
lines changed

stdlib/private/StdlibUnittest/OpaqueIdentityFunctions.swift

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the Swift.org open source project
44
//
5-
// Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
5+
// Copyright (c) 2014 - 2021 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
88
// See https://swift.org/LICENSE.txt for license information
@@ -65,6 +65,12 @@ public func getUInt64(_ x: UInt64) -> UInt64 { return _opaqueIdentity(x) }
6565
@inline(never)
6666
public func getUInt(_ x: UInt) -> UInt { return _opaqueIdentity(x) }
6767

68+
#if !((os(macOS) || targetEnvironment(macCatalyst)) && arch(x86_64))
69+
@available(macOS 11.0, iOS 14.0, watchOS 7.0, tvOS 14.0, *)
70+
@inline(never)
71+
public func getFloat16(_ x: Float16) -> Float16 { return _opaqueIdentity(x) }
72+
#endif
73+
6874
@inline(never)
6975
public func getFloat32(_ x: Float32) -> Float32 { return _opaqueIdentity(x) }
7076

test/stdlib/Inputs/FixedPointConversion.swift.gyb

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,11 @@ FixedPointConversionFailure.test("${Other}To${Self}Conversion/dest=${testValue}"
106106
% otherMax = int_max(bits=other_type.explicit_significand_bits, signed=False)
107107
% (selfFtoIMin, selfFtoIMax) = getFtoIBounds(other_type.bits, selfBits, selfSigned)
108108

109-
% if Other == 'Float80':
110-
#if !os(Windows) && (arch(i386) || arch(x86_64))
109+
% if Other == 'Float16':
110+
#if !((os(macOS) || targetEnvironment(macCatalyst)) && arch(x86_64))
111+
if #available(macOS 11.0, iOS 14.0, watchOS 7.0, tvOS 14.0, *) {
112+
% elif Other == 'Float80':
113+
#if !(os(Windows) || os(Android)) && (arch(i386) || arch(x86_64))
111114
% end
112115

113116
% testValues = [
@@ -217,7 +220,10 @@ FloatingPointConversionFailures.test("${Self}/${Other}/NaN") {
217220
expectNil(${Self}(exactly: get${Other}(${Other}.nan)))
218221
}
219222

220-
% if Other == 'Float80':
223+
% if Other == 'Float16':
224+
}
225+
#endif
226+
% elif Other == 'Float80':
221227
#endif
222228
% end
223229

validation-test/stdlib/FixedPointConversion_Debug.test-sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,3 @@
66
// RUN: %line-directive %t/FixedPointConversion.swift -- %target-run %t/a.out_Debug
77
// REQUIRES: executable_test
88
// REQUIRES: long_test
9-
// REQUIRES: rdar49177883

validation-test/stdlib/FixedPointConversion_Release.test-sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,3 @@
66
// RUN: %line-directive %t/FixedPointConversion.swift -- %target-run %t/a.out_Release
77
// REQUIRES: executable_test
88
// REQUIRES: long_test
9-
// REQUIRES: rdar49177883

0 commit comments

Comments
 (0)