aboutsummaryrefslogtreecommitdiff
path: root/libgo/go
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2018-02-01 21:05:20 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2018-02-01 21:05:20 +0000
commit28f3c8143b2f7e6178e5baaf81d15c65cbe6f06b (patch)
tree22f2408010d680c87c037ebf561a741ac3f31c12 /libgo/go
parentd15f0fa7f9b7bc2eabb29429a7ca8556a3272625 (diff)
downloadgcc-28f3c8143b2f7e6178e5baaf81d15c65cbe6f06b.zip
gcc-28f3c8143b2f7e6178e5baaf81d15c65cbe6f06b.tar.gz
gcc-28f3c8143b2f7e6178e5baaf81d15c65cbe6f06b.tar.bz2
math: adjust compilation flags, use them when testing
We were using special compilation flags for the math package, but we weren't using them when testing. That meant that our tests were not checking the real code we were providing. Fix that. Fixing that revealed that we were not using a good set of flags, or at least were not using flags that let the tests pass. Adjust the flags to stop using -funsafe-math-optimizations on x86. Instead always use -ffp-contract=off -fno-math-errno -fno-trapping-math for all targets. Fixes golang/go#23647 Reviewed-on: https://go-review.googlesource.com/91355 From-SVN: r257312
Diffstat (limited to 'libgo/go')
-rw-r--r--libgo/go/math/all_test.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/libgo/go/math/all_test.go b/libgo/go/math/all_test.go
index 6682395..98437b0 100644
--- a/libgo/go/math/all_test.go
+++ b/libgo/go/math/all_test.go
@@ -128,7 +128,7 @@ var cbrt = []float64{
var ceil = []float64{
5.0000000000000000e+00,
8.0000000000000000e+00,
- 0.0000000000000000e+00,
+ Copysign(0, -1),
-5.0000000000000000e+00,
1.0000000000000000e+01,
3.0000000000000000e+00,
@@ -644,7 +644,7 @@ var tanh = []float64{
var trunc = []float64{
4.0000000000000000e+00,
7.0000000000000000e+00,
- -0.0000000000000000e+00,
+ Copysign(0, -1),
-5.0000000000000000e+00,
9.0000000000000000e+00,
2.0000000000000000e+00,
@@ -2134,7 +2134,7 @@ func TestCbrt(t *testing.T) {
func TestCeil(t *testing.T) {
for i := 0; i < len(vf); i++ {
- if f := Ceil(vf[i]); ceil[i] != f {
+ if f := Ceil(vf[i]); !alike(ceil[i], f) {
t.Errorf("Ceil(%g) = %g, want %g", vf[i], f, ceil[i])
}
}
@@ -2361,7 +2361,7 @@ func TestDim(t *testing.T) {
func TestFloor(t *testing.T) {
for i := 0; i < len(vf); i++ {
- if f := Floor(vf[i]); floor[i] != f {
+ if f := Floor(vf[i]); !alike(floor[i], f) {
t.Errorf("Floor(%g) = %g, want %g", vf[i], f, floor[i])
}
}
@@ -2884,7 +2884,7 @@ func TestTanh(t *testing.T) {
func TestTrunc(t *testing.T) {
for i := 0; i < len(vf); i++ {
- if f := Trunc(vf[i]); trunc[i] != f {
+ if f := Trunc(vf[i]); !alike(trunc[i], f) {
t.Errorf("Trunc(%g) = %g, want %g", vf[i], f, trunc[i])
}
}