HomePhabricator

[test-suite] Fix FreeBSD and OpenBSD builds

Authored by dim on Thu, Mar 16, 11:34 AM.

Description

[test-suite] Fix FreeBSD and OpenBSD builds

With clang 16, SingleSource/Benchmarks/Misc/mandel.c fails to compile on
FreeBSD, complaining that hypot() is not declared:

SingleSource/Benchmarks/Misc/mandel.c:38:13: error: call to undeclared library function 'hypot' with type 'double (double, double)'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
        if (hypot(__real__ z, __imag__ z) >= ESCAPE)
            ^

The hypot() function is declared in <math.h>, not <complex.h>, so
use the former. This also applies to at least OpenBSD.

Reviewed By: brad, emaste

Differential Revision: https://reviews.llvm.org/D146251

Details

Committed
dimSun, Mar 19, 3:32 AM
Reviewer
brad
Differential Revision
D146251: [test-suite] Fix FreeBSD and OpenBSD builds
Parents
rT099d3c1617e0: [gcc-c-torture] Note undefined behaviour in frame-address.c
Branches
Unknown
Tags
Unknown