-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Make tgmath tests generic over TGMath protocol, extend to Float80 #15289
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make tgmath tests generic over TGMath protocol, extend to Float80 #15289
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
#endif | ||
|
||
#if (arch(i386) || arch(x86_64)) && !os(Windows) | ||
typealias TestLiteralType = Float80 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be simply _MaxBuiltinFloatType
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Guess not =)
@swift-ci Please smoke test. |
…t80. Define most of the test machinery in terms of a internal TGMath protocol that refines BinaryFloatingPoint. Add a little bit of gyb support to automate adding additional types, as it is likely these tests will need to support Float16 and Float128 in the future. Make all the input values exactly representable in all of the types in question, to avoid representation errors, loosen default tolerance to 3 to make porting to new platforms less noisy.
Merge #if conditions where possible so that they're not all over the file. Get rid of placeholder CGFloat on non-Darwin, which is no longer needed and doesn't work with the new approach anyway.
This reverts commit 714c9ca4bc0269d49d198bfd396118410c8ba178.
55ddaf0
to
fee4f0c
Compare
Rebased so that we make sure this works with the new tgmath implementations before merging. |
@swift-ci Please smoke test. |
Sure enough, we should remove the ldexp test, since we've deprecated it and scalbn is the thing now. |
@swift-ci Please smoke test. |
This no longer checks that |
That’s not what this test is for; ~everything will fail to build if that’s ever violated anyway, so it probably doesn’t need a test, but it’s fairly well covered already. Edit: ah, I misinterpreted your question. No, I don’t think that’s something we need to enforce. It’s nice-to-have, but not part of the semantics of these operations. I’d be OK with specializing for CGFloat such that it just checks for an exact match with Float/Double, however. |
Define most of the test machinery in terms of a internal TGMath protocol that refines BinaryFloatingPoint. Add a little bit of gyb support to automate adding additional types, as it is likely these tests will need to support Float16 and Float128 in the future. Make all the input values exactly representable in all of the types in question, to avoid representation errors, loosen default tolerance to 3 to make porting to new platforms less noisy.