From: Than McIntosh Date: Wed, 9 Aug 2017 13:16:38 +0000 (-0400) Subject: math: additional tests for Ldexp X-Git-Tag: go1.10beta1~1684 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=ff560ee9507cb6b3da1405faf41d6ade637118b7;p=gostls13.git math: additional tests for Ldexp Add test cases to verify behavior for Ldexp with exponents outside the range of Minint32/Maxint32, for a gccgo bug. Test for issue #21323. Change-Id: Iea67bc6fcfafdfddf515cf7075bdac59360c277a Reviewed-on: https://go-review.googlesource.com/54230 Run-TryBot: Than McIntosh TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- diff --git a/src/math/all_test.go b/src/math/all_test.go index 39a3a4986b..4449228c1e 100644 --- a/src/math/all_test.go +++ b/src/math/all_test.go @@ -8,6 +8,7 @@ import ( "fmt" . "math" "testing" + "unsafe" ) var vf = []float64{ @@ -1368,6 +1369,8 @@ var vfldexpSC = []fi{ {Inf(-1), 0}, {Inf(-1), -1024}, {NaN(), -1024}, + {10, int(1) << (uint64(unsafe.Sizeof(0)-1) * 8)}, + {10, -(int(1) << (uint64(unsafe.Sizeof(0)-1) * 8))}, } var ldexpSC = []float64{ 0, @@ -1381,6 +1384,8 @@ var ldexpSC = []float64{ Inf(-1), Inf(-1), NaN(), + Inf(1), + 0, } var vflgammaSC = []float64{