diff --git a/compiler-rt/test/builtins/Unit/muldc3_test.c b/compiler-rt/test/builtins/Unit/muldc3_test.c --- a/compiler-rt/test/builtins/Unit/muldc3_test.c +++ b/compiler-rt/test/builtins/Unit/muldc3_test.c @@ -86,12 +86,16 @@ if (classify(r) != zero) return 1; break; - case non_zero: + case non_zero: { + if (classify(r) != non_zero) return 1; - if (r != a * c - b * d + _Complex_I*(a * d + b * c)) + double _Complex z = a * c - b * d + _Complex_I*(a * d + b * c); + // relaxed tolerance to arbitrary (1.e-6) amount. + if (cabs((r-z)/r) > 1.e-6) return 1; break; + } case inf: if (classify(r) != inf) return 1;