Skip to content

[4.2] Disable testing printing of subnormals on 32b ARM. (#16433) #16841

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

Merged
merged 1 commit into from
May 25, 2018
Merged
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
18 changes: 16 additions & 2 deletions test/stdlib/PrintFloat.swift.gyb
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,9 @@ PrintTests.test("Printable_Float") {
expectDescription("-inf", -Float.infinity)
expectDescription("3.1415925", Float.pi)
expectDescription("3.4028235e+38", Float.greatestFiniteMagnitude)
#if !arch(arm)
expectDescription("1e-45", Float.leastNonzeroMagnitude)
#endif
expectDescription("1.1754944e-38", Float.leastNormalMagnitude)

// Special cases for the underlying algorithms:
Expand Down Expand Up @@ -623,7 +625,12 @@ PrintTests.test("Printable_Float") {
expectNaN("snan(0x1fffff)", Float(bitPattern: 0x7fbf_ffff))

// Every power of 10 should print with only a single digit '1'
for power in -45 ... 38 {
#if arch(arm)
let lowerBound = -37
#else
let lowerBound = -45
#endif
for power in lowerBound ... 38 {
let s: String
if power < -4 || power > 7 { // Exponential form
s = exponentialPowerOfTen(power)
Expand Down Expand Up @@ -709,7 +716,9 @@ PrintTests.test("Printable_Double") {
// Special values
expectDescription("3.141592653589793", Double.pi)
expectDescription("1.7976931348623157e+308", Double.greatestFiniteMagnitude)
#if !arch(arm)
expectDescription("5e-324", Double.leastNonzeroMagnitude)
#endif
expectDescription("2.2250738585072014e-308", Double.leastNormalMagnitude)
expectDescription("inf", Double.infinity)
expectDescription("-inf", -Double.infinity)
Expand All @@ -730,7 +739,12 @@ PrintTests.test("Printable_Double") {
expectNaN("snan(0x3ffffffffffff)", Float64(bitPattern: 0x7ff7_ffff_ffff_ffff))

// We know how every power of 10 should print
for power in -323 ... 308 {
#if arch(arm)
let lowerBound = -307
#else
let lowerBound = -323
#endif
for power in lowerBound ... 308 {
let s: String
if power < -4 || power > 15 { // Exponential form
s = exponentialPowerOfTen(power)
Expand Down