diff --git a/src/math/all_test.go b/src/math/all_test.go index e9621e6dc97..1ac9d71a251 100644 --- a/src/math/all_test.go +++ b/src/math/all_test.go @@ -3053,12 +3053,18 @@ func TestYn(t *testing.T) { } } +var PortableFMA = FMA // hide call from compiler intrinsic; falls back to portable code + func TestFMA(t *testing.T) { for _, c := range fmaC { got := FMA(c.x, c.y, c.z) if !alike(got, c.want) { t.Errorf("FMA(%g,%g,%g) == %g; want %g", c.x, c.y, c.z, got, c.want) } + got = PortableFMA(c.x, c.y, c.z) + if !alike(got, c.want) { + t.Errorf("PortableFMA(%g,%g,%g) == %g; want %g", c.x, c.y, c.z, got, c.want) + } } }