llvm/libc/test/src/math/CMakeLists.txt

add_custom_target(libc-math-unittests)

add_fp_unittest(
  cosf_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    cosf_test.cpp
  HDRS
    sdcomp26094.h
  DEPENDS
    libc.src.errno.errno
    libc.src.math.cosf
    libc.src.__support.CPP.array
    libc.src.__support.FPUtil.fp_bits
)

add_fp_unittest(
  cos_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    cos_test.cpp
  DEPENDS
    libc.src.math.cos
    libc.src.__support.FPUtil.fp_bits
)

add_fp_unittest(
  cospif_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    cospif_test.cpp
  HDRS
    sdcomp26094.h
  DEPENDS
    libc.src.errno.errno
    libc.src.math.cospif
    libc.src.__support.CPP.array
    libc.src.__support.FPUtil.fp_bits
)


add_fp_unittest(
  daddl_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    daddl_test.cpp
  HDRS
    AddTest.h
  DEPENDS
    libc.src.math.daddl
)

add_fp_unittest(
  sinf_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    sinf_test.cpp
  HDRS
    sdcomp26094.h
  DEPENDS
    libc.src.errno.errno
    libc.src.math.sinf
    libc.src.__support.CPP.array
    libc.src.__support.FPUtil.fp_bits
)

add_fp_unittest(
  sinpif_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    sinpif_test.cpp
  HDRS
    sdcomp26094.h
  DEPENDS
    libc.src.errno.errno
    libc.src.math.sinpif
    libc.src.__support.CPP.array
    libc.src.__support.FPUtil.fp_bits
)

add_fp_unittest(
  sin_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    sin_test.cpp
  DEPENDS
    libc.src.math.sin
    libc.src.__support.FPUtil.fp_bits
)

add_fp_unittest(
  sincosf_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    sincosf_test.cpp
  HDRS
    sdcomp26094.h
  DEPENDS
    libc.src.errno.errno
    libc.src.math.sincosf
    libc.src.__support.CPP.array
    libc.src.__support.FPUtil.fp_bits
)

add_fp_unittest(
  sincos_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    sincos_test.cpp
  DEPENDS
    libc.src.math.sincos
    libc.src.__support.FPUtil.fp_bits
)

add_fp_unittest(
  tanf_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    tanf_test.cpp
  HDRS
    sdcomp26094.h
  DEPENDS
    libc.src.errno.errno
    libc.src.math.tanf
    libc.src.__support.CPP.array
    libc.src.__support.FPUtil.fp_bits
)

add_fp_unittest(
  fabs_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    fabs_test.cpp
  HDRS
    FAbsTest.h
  DEPENDS
    libc.src.math.fabs
    libc.src.__support.FPUtil.fp_bits
)

add_fp_unittest(
  fabsf_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    fabsf_test.cpp
  HDRS
    FAbsTest.h
  DEPENDS
    libc.src.math.fabsf
    libc.src.__support.FPUtil.fp_bits
)

add_fp_unittest(
  fabsl_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    fabsl_test.cpp
  HDRS
    FAbsTest.h
  DEPENDS
    libc.src.math.fabsl
    libc.src.__support.FPUtil.fp_bits
)

add_fp_unittest(
  fadd_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    fadd_test.cpp
  HDRS
    AddTest.h
  DEPENDS
    libc.src.math.fadd
    libc.src.__support.FPUtil.basic_operations
)

add_fp_unittest(
  faddl_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    faddl_test.cpp
  HDRS
    AddTest.h
  DEPENDS
    libc.src.math.faddl
)

add_fp_unittest(
  trunc_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    trunc_test.cpp
  HDRS
    TruncTest.h
  DEPENDS
    libc.src.math.trunc
    libc.src.__support.CPP.algorithm
    libc.src.__support.FPUtil.fp_bits
)

add_fp_unittest(
  truncf_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    truncf_test.cpp
  HDRS
    TruncTest.h
  DEPENDS
    libc.src.math.truncf
    libc.src.__support.CPP.algorithm
    libc.src.__support.FPUtil.fp_bits
)

add_fp_unittest(
  truncl_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    truncl_test.cpp
  HDRS
    TruncTest.h
  DEPENDS
    libc.src.math.truncl
    libc.src.__support.CPP.algorithm
    libc.src.__support.FPUtil.fp_bits
)

add_fp_unittest(
  truncf16_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    truncf16_test.cpp
  HDRS
    TruncTest.h
  DEPENDS
    libc.src.math.truncf16
    libc.src.__support.CPP.algorithm
    libc.src.__support.FPUtil.fp_bits
)

add_fp_unittest(
  ceil_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    ceil_test.cpp
  HDRS
    CeilTest.h
  DEPENDS
    libc.src.math.ceil
    libc.src.__support.CPP.algorithm
    libc.src.__support.FPUtil.fp_bits
)

add_fp_unittest(
  ceilf_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    ceilf_test.cpp
  HDRS
    CeilTest.h
  DEPENDS
    libc.src.math.ceilf
    libc.src.__support.CPP.algorithm
    libc.src.__support.FPUtil.fp_bits
)

add_fp_unittest(
  ceill_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    ceill_test.cpp
  HDRS
    CeilTest.h
  DEPENDS
    libc.src.math.ceill
    libc.src.__support.CPP.algorithm
    libc.src.__support.FPUtil.fp_bits
)

add_fp_unittest(
  ceilf16_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    ceilf16_test.cpp
  HDRS
    CeilTest.h
  DEPENDS
    libc.src.math.ceilf16
    libc.src.__support.CPP.algorithm
    libc.src.__support.FPUtil.fp_bits
)

add_fp_unittest(
  floor_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    floor_test.cpp
  HDRS
    FloorTest.h
  DEPENDS
    libc.src.math.floor
    libc.src.__support.CPP.algorithm
    libc.src.__support.FPUtil.fp_bits
)

add_fp_unittest(
  floorf_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    floorf_test.cpp
  HDRS
    FloorTest.h
  DEPENDS
    libc.src.math.floorf
    libc.src.__support.CPP.algorithm
    libc.src.__support.FPUtil.fp_bits
)

add_fp_unittest(
  floorl_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    floorl_test.cpp
  HDRS
    FloorTest.h
  DEPENDS
    libc.src.math.floorl
    libc.src.__support.CPP.algorithm
    libc.src.__support.FPUtil.fp_bits
)

add_fp_unittest(
  floorf16_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    floorf16_test.cpp
  HDRS
    FloorTest.h
  DEPENDS
    libc.src.math.floorf16
    libc.src.__support.CPP.algorithm
    libc.src.__support.FPUtil.fp_bits
)

add_fp_unittest(
  round_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    round_test.cpp
  HDRS
    RoundTest.h
  DEPENDS
    libc.src.math.round
    libc.src.__support.CPP.algorithm
    libc.src.__support.FPUtil.fp_bits
)

add_fp_unittest(
  roundf_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    roundf_test.cpp
  HDRS
    RoundTest.h
  DEPENDS
    libc.src.math.roundf
    libc.src.__support.CPP.algorithm
    libc.src.__support.FPUtil.fp_bits
)

add_fp_unittest(
  roundl_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    roundl_test.cpp
  HDRS
    RoundTest.h
  DEPENDS
    libc.src.math.roundl
    libc.src.__support.CPP.algorithm
    libc.src.__support.FPUtil.fp_bits
)

add_fp_unittest(
  roundf16_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    roundf16_test.cpp
  HDRS
    RoundTest.h
  DEPENDS
    libc.src.math.roundf16
    libc.src.__support.CPP.algorithm
    libc.src.__support.FPUtil.fp_bits
)

add_fp_unittest(
  roundeven_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    roundeven_test.cpp
  HDRS
  RoundEvenTest.h
  DEPENDS
    libc.src.math.roundeven
    libc.src.__support.CPP.algorithm
    libc.src.__support.FPUtil.fp_bits
)

add_fp_unittest(
  roundevenf_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    roundevenf_test.cpp
  HDRS
  RoundEvenTest.h
  DEPENDS
    libc.src.math.roundevenf
    libc.src.__support.CPP.algorithm
    libc.src.__support.FPUtil.fp_bits
)

add_fp_unittest(
  roundevenl_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    roundevenl_test.cpp
  HDRS
  RoundEvenTest.h
  DEPENDS
    libc.src.math.roundevenl
    libc.src.__support.CPP.algorithm
    libc.src.__support.FPUtil.fp_bits
)

add_fp_unittest(
  roundevenf16_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    roundevenf16_test.cpp
  HDRS
  RoundEvenTest.h
  DEPENDS
    libc.src.math.roundevenf16
    libc.src.__support.CPP.algorithm
    libc.src.__support.FPUtil.fp_bits
)

add_fp_unittest(
  lround_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    lround_test.cpp
  HDRS
    RoundToIntegerTest.h
  DEPENDS
    libc.hdr.fenv_macros
    libc.src.errno.errno
    libc.src.math.lround
    libc.src.__support.CPP.algorithm
    libc.src.__support.FPUtil.fenv_impl
    libc.src.__support.FPUtil.fp_bits
)

add_fp_unittest(
  lroundf_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    lroundf_test.cpp
  HDRS
    RoundToIntegerTest.h
  DEPENDS
    libc.hdr.fenv_macros
    libc.src.errno.errno
    libc.src.math.lroundf
    libc.src.__support.CPP.algorithm
    libc.src.__support.FPUtil.fenv_impl
    libc.src.__support.FPUtil.fp_bits
)

add_fp_unittest(
  lroundl_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    lroundl_test.cpp
  HDRS
    RoundToIntegerTest.h
  DEPENDS
    libc.hdr.fenv_macros
    libc.src.errno.errno
    libc.src.math.lroundl
    libc.src.__support.CPP.algorithm
    libc.src.__support.FPUtil.fenv_impl
    libc.src.__support.FPUtil.fp_bits
)

add_fp_unittest(
  lroundf16_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    lroundf16_test.cpp
  HDRS
    RoundToIntegerTest.h
  DEPENDS
    libc.hdr.fenv_macros
    libc.src.errno.errno
    libc.src.math.lroundf16
    libc.src.__support.CPP.algorithm
    libc.src.__support.FPUtil.fenv_impl
    libc.src.__support.FPUtil.fp_bits
)

add_fp_unittest(
  llround_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    llround_test.cpp
  HDRS
    RoundToIntegerTest.h
  DEPENDS
    libc.hdr.fenv_macros
    libc.src.errno.errno
    libc.src.math.llround
    libc.src.__support.CPP.algorithm
    libc.src.__support.FPUtil.fenv_impl
    libc.src.__support.FPUtil.fp_bits
)

add_fp_unittest(
  llroundf_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    llroundf_test.cpp
  HDRS
    RoundToIntegerTest.h
  DEPENDS
    libc.hdr.fenv_macros
    libc.src.errno.errno
    libc.src.math.llroundf
    libc.src.__support.CPP.algorithm
    libc.src.__support.FPUtil.fenv_impl
    libc.src.__support.FPUtil.fp_bits
)

add_fp_unittest(
  llroundl_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    llroundl_test.cpp
  HDRS
    RoundToIntegerTest.h
  DEPENDS
    libc.hdr.fenv_macros
    libc.src.errno.errno
    libc.src.math.llroundl
    libc.src.__support.CPP.algorithm
    libc.src.__support.FPUtil.fenv_impl
    libc.src.__support.FPUtil.fp_bits
)

add_fp_unittest(
  llroundf16_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    llroundf16_test.cpp
  HDRS
    RoundToIntegerTest.h
  DEPENDS
    libc.hdr.fenv_macros
    libc.src.errno.errno
    libc.src.math.llroundf16
    libc.src.__support.CPP.algorithm
    libc.src.__support.FPUtil.fenv_impl
    libc.src.__support.FPUtil.fp_bits
)

add_fp_unittest(
  nearbyint_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    nearbyint_test.cpp
  HDRS
    NearbyIntTest.h
  DEPENDS
    libc.src.math.nearbyint
    libc.src.__support.CPP.algorithm
    libc.src.__support.CPP.array
)

add_fp_unittest(
  nearbyintf_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    nearbyintf_test.cpp
  HDRS
    NearbyIntTest.h
  DEPENDS
    libc.src.math.nearbyintf
    libc.src.__support.CPP.algorithm
    libc.src.__support.CPP.array
)

add_fp_unittest(
  nearbyintl_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    nearbyintl_test.cpp
  HDRS
    NearbyIntTest.h
  DEPENDS
    libc.src.math.nearbyintl
    libc.src.__support.CPP.algorithm
    libc.src.__support.CPP.array
)

add_fp_unittest(
  nearbyintf16_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    nearbyintf16_test.cpp
  HDRS
    NearbyIntTest.h
  DEPENDS
    libc.src.math.nearbyintf16
    libc.src.__support.CPP.algorithm
    libc.src.__support.CPP.array
)

add_fp_unittest(
  rint_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    rint_test.cpp
  HDRS
    RIntTest.h
  DEPENDS
    libc.hdr.fenv_macros
    libc.src.math.rint
    libc.src.__support.CPP.algorithm
    libc.src.__support.FPUtil.fenv_impl
    libc.src.__support.FPUtil.fp_bits
)

add_fp_unittest(
  rintf_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    rintf_test.cpp
  HDRS
    RIntTest.h
  DEPENDS
    libc.hdr.fenv_macros
    libc.src.math.rintf
    libc.src.__support.CPP.algorithm
    libc.src.__support.FPUtil.fenv_impl
    libc.src.__support.FPUtil.fp_bits
)

add_fp_unittest(
  rintl_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    rintl_test.cpp
  HDRS
    RIntTest.h
  DEPENDS
    libc.hdr.fenv_macros
    libc.src.math.rintl
    libc.src.__support.CPP.algorithm
    libc.src.__support.FPUtil.fenv_impl
    libc.src.__support.FPUtil.fp_bits
)

add_fp_unittest(
  rintf16_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    rintf16_test.cpp
  HDRS
    RIntTest.h
  DEPENDS
    libc.hdr.fenv_macros
    libc.src.math.rintf16
    libc.src.__support.CPP.algorithm
    libc.src.__support.FPUtil.fenv_impl
    libc.src.__support.FPUtil.fp_bits
)

add_fp_unittest(
  lrint_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    lrint_test.cpp
  HDRS
    RoundToIntegerTest.h
  DEPENDS
    libc.src.math.lrint
    libc.src.__support.CPP.algorithm
    libc.src.__support.FPUtil.fenv_impl
    libc.src.__support.FPUtil.fp_bits
)

add_fp_unittest(
  lrintf_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    lrintf_test.cpp
  HDRS
    RoundToIntegerTest.h
  DEPENDS
    libc.src.math.lrintf
    libc.src.__support.CPP.algorithm
    libc.src.__support.FPUtil.fenv_impl
    libc.src.__support.FPUtil.fp_bits
)

add_fp_unittest(
  lrintl_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    lrintl_test.cpp
  HDRS
    RoundToIntegerTest.h
  DEPENDS
    libc.src.math.lrintl
    libc.src.__support.CPP.algorithm
    libc.src.__support.FPUtil.fenv_impl
    libc.src.__support.FPUtil.fp_bits
)

add_fp_unittest(
  lrintf16_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    lrintf16_test.cpp
  HDRS
    RoundToIntegerTest.h
  DEPENDS
    libc.src.math.lrintf16
    libc.src.__support.CPP.algorithm
    libc.src.__support.FPUtil.fenv_impl
    libc.src.__support.FPUtil.fp_bits
)

add_fp_unittest(
  llrint_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    llrint_test.cpp
  HDRS
    RoundToIntegerTest.h
  DEPENDS
    libc.src.math.llrint
    libc.src.__support.CPP.algorithm
    libc.src.__support.FPUtil.fenv_impl
    libc.src.__support.FPUtil.fp_bits
)

add_fp_unittest(
  llrintf_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    llrintf_test.cpp
  HDRS
    RoundToIntegerTest.h
  DEPENDS
    libc.src.math.llrintf
    libc.src.__support.CPP.algorithm
    libc.src.__support.FPUtil.fenv_impl
    libc.src.__support.FPUtil.fp_bits
)

add_fp_unittest(
  llrintl_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    llrintl_test.cpp
  HDRS
    RoundToIntegerTest.h
  DEPENDS
    libc.src.math.llrintl
    libc.src.__support.CPP.algorithm
    libc.src.__support.FPUtil.fenv_impl
    libc.src.__support.FPUtil.fp_bits
)

add_fp_unittest(
  llrintf16_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    llrintf16_test.cpp
  HDRS
    RoundToIntegerTest.h
  DEPENDS
    libc.src.math.llrintf16
    libc.src.__support.CPP.algorithm
    libc.src.__support.FPUtil.fenv_impl
    libc.src.__support.FPUtil.fp_bits
)

add_fp_unittest(
  exp_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    exp_test.cpp
  DEPENDS
    libc.src.errno.errno
    libc.src.math.exp
    libc.src.__support.FPUtil.fp_bits
)

add_fp_unittest(
  expf_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    expf_test.cpp
  DEPENDS
    libc.src.errno.errno
    libc.src.math.expf
    libc.src.__support.FPUtil.fp_bits
)

add_fp_unittest(
  expf16_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    expf16_test.cpp
  DEPENDS
    libc.src.math.expf16
)

add_fp_unittest(
  exp2_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    exp2_test.cpp
  DEPENDS
    libc.src.errno.errno
    libc.src.math.exp2
    libc.src.__support.FPUtil.fp_bits
)

add_fp_unittest(
  exp2f_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    exp2f_test.cpp
  DEPENDS
    libc.src.errno.errno
    libc.src.math.exp2f
    libc.src.__support.FPUtil.fp_bits
)

add_fp_unittest(
  exp2f16_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    exp2f16_test.cpp
  DEPENDS
    libc.src.math.exp2f16
)

add_fp_unittest(
  exp2m1f_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    exp2m1f_test.cpp
  DEPENDS
    libc.src.errno.errno
    libc.src.math.exp2m1f
    libc.src.__support.CPP.array
    libc.src.__support.FPUtil.fp_bits
)

add_fp_unittest(
  exp10_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    exp10_test.cpp
  DEPENDS
    libc.src.errno.errno
    libc.src.math.exp10
    libc.src.__support.FPUtil.fp_bits
)

add_fp_unittest(
  exp10f_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    exp10f_test.cpp
  DEPENDS
    libc.src.errno.errno
    libc.src.math.exp10f
    libc.src.__support.FPUtil.fp_bits
)

add_fp_unittest(
  exp10f16_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    exp10f16_test.cpp
  DEPENDS
    libc.src.math.exp10f16
)

add_fp_unittest(
  copysign_test
  SUITE
    libc-math-unittests
  SRCS
    copysign_test.cpp
  HDRS
    CopySignTest.h
  DEPENDS
    libc.src.math.copysign
    libc.src.__support.FPUtil.fp_bits
  # FIXME: Currently fails on the GPU build.
  UNIT_TEST_ONLY
)

add_fp_unittest(
  copysignf_test
  SUITE
    libc-math-unittests
  SRCS
    copysignf_test.cpp
  HDRS
    CopySignTest.h
  DEPENDS
    libc.src.math.copysignf
    libc.src.__support.FPUtil.fp_bits
  # FIXME: Currently fails on the GPU build.
  UNIT_TEST_ONLY
)

add_fp_unittest(
  copysignl_test
  SUITE
    libc-math-unittests
  SRCS
    copysignl_test.cpp
  HDRS
    CopySignTest.h
  DEPENDS
    libc.src.math.copysignl
    libc.src.__support.FPUtil.fp_bits
  # FIXME: Currently fails on the GPU build.
  UNIT_TEST_ONLY
)

add_fp_unittest(
  frexp_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    frexp_test.cpp
  HDRS
    FrexpTest.h
  DEPENDS
    libc.src.math.frexp
    libc.src.__support.FPUtil.basic_operations
)

add_fp_unittest(
  frexpf_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    frexpf_test.cpp
  HDRS
    FrexpTest.h
  DEPENDS
    libc.src.math.frexpf
    libc.src.__support.FPUtil.basic_operations
)

add_fp_unittest(
  frexpl_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    frexpl_test.cpp
  HDRS
    FrexpTest.h
  DEPENDS
    libc.src.math.frexpl
    libc.src.__support.FPUtil.basic_operations
)

add_fp_unittest(
  ilogb_test
  SUITE
    libc-math-unittests
  SRCS
    ilogb_test.cpp
  HDRS
    ILogbTest.h
  DEPENDS
    libc.src.math.ilogb
    libc.src.__support.CPP.limits
    libc.src.__support.FPUtil.fp_bits
    libc.src.__support.FPUtil.manipulation_functions
)

add_fp_unittest(
  ilogbf_test
  SUITE
    libc-math-unittests
  SRCS
    ilogbf_test.cpp
  HDRS
    ILogbTest.h
  DEPENDS
    libc.src.math.ilogbf
    libc.src.__support.CPP.limits
    libc.src.__support.FPUtil.fp_bits
    libc.src.__support.FPUtil.manipulation_functions
)

add_fp_unittest(
  ilogbl_test
  SUITE
    libc-math-unittests
  SRCS
    ilogbl_test.cpp
  HDRS
    ILogbTest.h
  DEPENDS
    libc.src.math.ilogbl
    libc.src.__support.CPP.limits
    libc.src.__support.FPUtil.fp_bits
    libc.src.__support.FPUtil.manipulation_functions
)

add_fp_unittest(
  ldexp_test
  SUITE
    libc-math-unittests
  SRCS
    ldexp_test.cpp
  HDRS
    LdExpTest.h
  DEPENDS
    libc.src.math.ldexp
    libc.src.__support.CPP.limits
    libc.src.__support.FPUtil.fp_bits
    libc.src.__support.FPUtil.normal_float
)

add_fp_unittest(
  ldexpf_test
  SUITE
    libc-math-unittests
  SRCS
    ldexpf_test.cpp
  HDRS
    LdExpTest.h
  DEPENDS
    libc.src.math.ldexpf
    libc.src.__support.CPP.limits
    libc.src.__support.FPUtil.fp_bits
    libc.src.__support.FPUtil.normal_float
)

add_fp_unittest(
  ldexpl_test
  SUITE
    libc-math-unittests
  SRCS
    ldexpl_test.cpp
  HDRS
    LdExpTest.h
  DEPENDS
    libc.src.math.ldexpl
    libc.src.__support.CPP.limits
    libc.src.__support.FPUtil.fp_bits
    libc.src.__support.FPUtil.normal_float
)

add_fp_unittest(
  logb_test
  SUITE
    libc-math-unittests
  SRCS
    logb_test.cpp
  DEPENDS
    libc.src.math.logb
    libc.src.__support.FPUtil.manipulation_functions
)

add_fp_unittest(
  logbf_test
  SUITE
    libc-math-unittests
  SRCS
    logbf_test.cpp
  DEPENDS
    libc.src.math.logbf
    libc.src.__support.FPUtil.manipulation_functions
)

add_fp_unittest(
  logbl_test
  SUITE
    libc-math-unittests
  SRCS
    logbl_test.cpp
  HDRS
    LogbTest.h
  DEPENDS
    libc.src.math.logbl
    libc.src.__support.FPUtil.manipulation_functions
)

add_fp_unittest(
  modf_test
  SUITE
    libc-math-unittests
  SRCS
    modf_test.cpp
  HDRS
    ModfTest.h
  DEPENDS
    libc.src.math.modf
    libc.src.__support.FPUtil.basic_operations
    libc.src.__support.FPUtil.nearest_integer_operations
  # Requires C++ limits.
  UNIT_TEST_ONLY
)

add_fp_unittest(
  modff_test
  SUITE
    libc-math-unittests
  SRCS
    modff_test.cpp
  HDRS
    ModfTest.h
  DEPENDS
    libc.src.math.modff
    libc.src.__support.FPUtil.basic_operations
    libc.src.__support.FPUtil.nearest_integer_operations
  # Requires C++ limits.
  UNIT_TEST_ONLY
)

add_fp_unittest(
  modfl_test
  SUITE
    libc-math-unittests
  SRCS
    modfl_test.cpp
  HDRS
    ModfTest.h
  DEPENDS
    libc.src.math.modfl
    libc.src.__support.FPUtil.basic_operations
    libc.src.__support.FPUtil.nearest_integer_operations
)

add_fp_unittest(
  fdimf_test
  SUITE
    libc-math-unittests
  SRCS
    fdimf_test.cpp
  HDRS
    FDimTest.h
  DEPENDS
    libc.src.math.fdimf
    libc.src.__support.FPUtil.basic_operations
    libc.src.__support.FPUtil.fp_bits
)

add_fp_unittest(
  fdim_test
  SUITE
    libc-math-unittests
  SRCS
    fdim_test.cpp
  HDRS
    FDimTest.h
  DEPENDS
    libc.src.math.fdim
    libc.src.__support.FPUtil.basic_operations
    libc.src.__support.FPUtil.fp_bits
)

add_fp_unittest(
  fdiml_test
  SUITE
    libc-math-unittests
  SRCS
    fdiml_test.cpp
  HDRS
    FDimTest.h
  DEPENDS
    libc.src.math.fdiml
    libc.src.__support.FPUtil.basic_operations
    libc.src.__support.FPUtil.fp_bits
)

add_fp_unittest(
  fminf_test
  SUITE
    libc-math-unittests
  SRCS
    fminf_test.cpp
  HDRS
    FMinTest.h
  DEPENDS
    libc.src.math.fminf
    libc.src.__support.FPUtil.fp_bits
)

add_fp_unittest(
  fmin_test
  SUITE
    libc-math-unittests
  SRCS
    fmin_test.cpp
  HDRS
    FMinTest.h
  DEPENDS
    libc.src.math.fmin
    libc.src.__support.FPUtil.fp_bits
)

add_fp_unittest(
  fminl_test
  SUITE
    libc-math-unittests
  SRCS
    fminl_test.cpp
  HDRS
    FMinTest.h
  DEPENDS
    libc.src.math.fminl
    libc.src.__support.FPUtil.fp_bits
)

add_fp_unittest(
  fmaxf_test
  SUITE
    libc-math-unittests
  SRCS
    fmaxf_test.cpp
  HDRS
    FMaxTest.h
  DEPENDS
    libc.src.math.fmaxf
    libc.src.__support.FPUtil.fp_bits
)

add_fp_unittest(
  fmax_test
  SUITE
    libc-math-unittests
  SRCS
    fmax_test.cpp
  HDRS
    FMaxTest.h
  DEPENDS
    libc.src.math.fmax
    libc.src.__support.FPUtil.fp_bits
)

add_fp_unittest(
  fmaxl_test
  SUITE
    libc-math-unittests
  SRCS
    fmaxl_test.cpp
  HDRS
    FMaxTest.h
  DEPENDS
    libc.src.math.fmaxl
    libc.src.__support.FPUtil.fp_bits
)

add_fp_unittest(
  sqrtf_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    sqrtf_test.cpp
  HDRS
    SqrtTest.h
  DEPENDS
    libc.src.math.sqrtf
)

add_fp_unittest(
  sqrt_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    sqrt_test.cpp
  HDRS
    SqrtTest.h
  DEPENDS
    libc.src.math.sqrt
)

add_fp_unittest(
  sqrtl_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    sqrtl_test.cpp
  HDRS
    SqrtTest.h
  DEPENDS
    libc.src.math.sqrtl
)

add_fp_unittest(
  generic_sqrtf_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    generic_sqrtf_test.cpp
  HDRS
    SqrtTest.h
  DEPENDS
    libc.src.math.sqrtf
    libc.src.__support.FPUtil.generic.sqrt
  COMPILE_OPTIONS
    -O3
)

add_fp_unittest(
  generic_sqrt_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    generic_sqrt_test.cpp
  HDRS
    SqrtTest.h
  DEPENDS
    libc.src.math.sqrt
    libc.src.__support.FPUtil.generic.sqrt
  COMPILE_OPTIONS
    -O3
)

add_fp_unittest(
  generic_sqrtl_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    generic_sqrtl_test.cpp
  HDRS
    SqrtTest.h
  DEPENDS
    libc.src.math.sqrtl
    libc.src.__support.FPUtil.generic.sqrt
  COMPILE_OPTIONS
    -O3
)

add_fp_unittest(
  remquof_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    remquof_test.cpp
  HDRS
    RemQuoTest.h
  DEPENDS
    libc.src.math.remquof
    libc.src.__support.FPUtil.basic_operations
    libc.src.__support.FPUtil.fp_bits
)

add_fp_unittest(
  remquo_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    remquo_test.cpp
  HDRS
    RemQuoTest.h
  DEPENDS
    libc.src.math.remquo
    libc.src.__support.FPUtil.basic_operations
    libc.src.__support.FPUtil.fp_bits
)

add_fp_unittest(
  remquol_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    remquol_test.cpp
  HDRS
    RemQuoTest.h
  DEPENDS
    libc.src.math.remquol
    libc.src.__support.FPUtil.basic_operations
    libc.src.__support.FPUtil.fp_bits
)

add_fp_unittest(
  hypotf_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    hypotf_test.cpp
  DEPENDS
    libc.src.math.hypotf
    libc.src.__support.FPUtil.fp_bits
)

add_fp_unittest(
  hypot_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    hypot_test.cpp
  DEPENDS
    libc.src.math.hypot
    libc.src.__support.FPUtil.fp_bits
)

add_fp_unittest(
  nextafter_test
  SUITE
    libc-math-unittests
  SRCS
    nextafter_test.cpp
  HDRS
    NextAfterTest.h
  DEPENDS
    libc.src.math.nextafter
    libc.src.__support.FPUtil.basic_operations
    libc.src.__support.FPUtil.fp_bits
)

add_fp_unittest(
  nextafterf_test
  SUITE
    libc-math-unittests
  SRCS
    nextafterf_test.cpp
  HDRS
    NextAfterTest.h
  DEPENDS
    libc.src.math.nextafterf
    libc.src.__support.FPUtil.basic_operations
    libc.src.__support.FPUtil.fp_bits
)

add_fp_unittest(
  nextafterl_test
  SUITE
    libc-math-unittests
  SRCS
    nextafterl_test.cpp
  HDRS
    NextAfterTest.h
  DEPENDS
    libc.src.math.nextafterl
    libc.src.__support.FPUtil.basic_operations
    libc.src.__support.FPUtil.fp_bits
)

add_fp_unittest(
  nextafterf128_test
  SUITE
    libc-math-unittests
  SRCS
    nextafterf128_test.cpp
  HDRS
    NextAfterTest.h
  DEPENDS
    libc.src.math.nextafterf128
    libc.src.__support.FPUtil.basic_operations
    libc.src.__support.FPUtil.fp_bits
)

# TODO(lntue): The current implementation of fputil::general::fma<float> is only
# correctly rounded for the default rounding mode round-to-nearest tie-to-even.
add_fp_unittest(
  fmaf_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    fmaf_test.cpp
  HDRS
    FmaTest.h
  DEPENDS
    libc.src.math.fmaf
    libc.src.stdlib.rand
    libc.src.stdlib.srand
  FLAGS
    FMA_OPT__ONLY
)

add_fp_unittest(
  fma_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    fma_test.cpp
  HDRS
    FmaTest.h
  DEPENDS
    libc.src.math.fma
    libc.src.stdlib.rand
    libc.src.stdlib.srand
)

add_fp_unittest(
  tan_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    tan_test.cpp
  DEPENDS
    libc.src.math.tan
    libc.src.__support.FPUtil.fp_bits
)

add_fp_unittest(
  expm1_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    expm1_test.cpp
  DEPENDS
    libc.src.errno.errno
    libc.src.math.expm1
    libc.src.__support.FPUtil.fp_bits
)

add_fp_unittest(
  expm1f_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    expm1f_test.cpp
  DEPENDS
    libc.src.errno.errno
    libc.src.math.expm1f
    libc.src.__support.FPUtil.fp_bits
)

add_fp_unittest(
  expm1f16_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    expm1f16_test.cpp
  DEPENDS
    libc.src.math.expm1f16
)

add_fp_unittest(
 log_test
 NEED_MPFR
 SUITE
   libc-math-unittests
 SRCS
   log_test.cpp
 DEPENDS
   libc.src.errno.errno
   libc.src.math.log
   libc.src.__support.FPUtil.fp_bits
)

add_fp_unittest(
  logf_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    logf_test.cpp
  DEPENDS
    libc.src.errno.errno
    libc.src.math.logf
    libc.src.__support.FPUtil.fp_bits
)

add_fp_unittest(
log2_test
 NEED_MPFR
 SUITE
   libc-math-unittests
 SRCS
   log2_test.cpp
 DEPENDS
   libc.src.errno.errno
   libc.src.math.log2
   libc.src.__support.FPUtil.fp_bits
)

add_fp_unittest(
  log2f_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    log2f_test.cpp
  DEPENDS
    libc.src.errno.errno
    libc.src.math.log2f
    libc.src.__support.FPUtil.fp_bits
)

add_fp_unittest(
 log10_test
 NEED_MPFR
 SUITE
   libc-math-unittests
 SRCS
   log10_test.cpp
 DEPENDS
   libc.src.errno.errno
   libc.src.math.log10
   libc.src.__support.FPUtil.fp_bits
)

add_fp_unittest(
  log10f_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    log10f_test.cpp
  DEPENDS
    libc.src.errno.errno
    libc.src.math.log10f
    libc.src.__support.FPUtil.fp_bits
)

add_fp_unittest(
log1p_test
 NEED_MPFR
 SUITE
   libc-math-unittests
 SRCS
   log1p_test.cpp
 DEPENDS
   libc.src.errno.errno
   libc.src.math.log1p
   libc.src.__support.FPUtil.fp_bits
)

add_fp_unittest(
  log1pf_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    log1pf_test.cpp
  DEPENDS
    libc.src.errno.errno
    libc.src.math.log1pf
    libc.src.__support.FPUtil.fp_bits
)

add_fp_unittest(
  fmodf_test
  SUITE
    libc-math-unittests
  SRCS
    fmodf_test.cpp
  HDRS
    FModTest.h
  DEPENDS
    libc.src.errno.errno
    libc.src.math.fmodf
    libc.src.__support.FPUtil.basic_operations
    libc.src.__support.FPUtil.nearest_integer_operations
  # FIXME: Currently fails on the GPU build.
  UNIT_TEST_ONLY
)

add_fp_unittest(
  fmod_test
  SUITE
    libc-math-unittests
  SRCS
    fmod_test.cpp
  HDRS
    FModTest.h
  DEPENDS
    libc.src.errno.errno
    libc.src.math.fmod
    libc.src.__support.FPUtil.basic_operations
    libc.src.__support.FPUtil.nearest_integer_operations
  # FIXME: Currently fails on the GPU build.
  UNIT_TEST_ONLY
)

add_fp_unittest(
  explogxf_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  HDRS
    in_float_range_test_helper.h
  SRCS
    explogxf_test.cpp
  DEPENDS
    libc.src.math.generic.explogxf
    libc.src.math.fabs
    libc.src.math.fabsf
    libc.src.__support.FPUtil.fp_bits
)

add_fp_unittest(
  coshf_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    coshf_test.cpp
  HDRS
    sdcomp26094.h
  DEPENDS
    libc.src.errno.errno
    libc.src.math.coshf
    libc.src.__support.CPP.array
    libc.src.__support.FPUtil.fp_bits
)

add_fp_unittest(
  sinhf_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    sinhf_test.cpp
  HDRS
    sdcomp26094.h
  DEPENDS
    libc.src.errno.errno
    libc.src.math.sinhf
    libc.src.__support.CPP.array
    libc.src.__support.FPUtil.fp_bits
)

add_fp_unittest(
  tanhf_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    tanhf_test.cpp
  DEPENDS
    libc.src.math.tanhf
    libc.src.__support.FPUtil.fp_bits
)

add_fp_unittest(
  atanhf_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    atanhf_test.cpp
  DEPENDS
    libc.src.errno.errno
    libc.src.math.atanhf
    libc.src.__support.FPUtil.fp_bits
)

add_fp_unittest(
  fmul_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    fmul_test.cpp
  HDRS
    MulTest.h
  DEPENDS
    libc.src.math.fmul
    libc.src.stdlib.rand
    libc.src.stdlib.srand
)

add_fp_unittest(
  fmull_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    fmull_test.cpp
  HDRS
    MulTest.h
  DEPENDS
    libc.src.math.fmull
    libc.src.stdlib.rand
    libc.src.stdlib.srand
)

add_fp_unittest(
  asinhf_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    asinhf_test.cpp
  DEPENDS
    libc.src.errno.errno
    libc.src.math.asinhf
    libc.src.__support.FPUtil.fp_bits
)

add_fp_unittest(
  acoshf_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    acoshf_test.cpp
  DEPENDS
    libc.src.errno.errno
    libc.src.math.acoshf
    libc.src.__support.FPUtil.fp_bits
)

add_fp_unittest(
  asinf_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    asinf_test.cpp
  DEPENDS
    libc.src.errno.errno
    libc.src.math.asinf
    libc.src.__support.FPUtil.fp_bits
)

add_fp_unittest(
  acosf_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    acosf_test.cpp
  DEPENDS
    libc.src.errno.errno
    libc.src.math.acosf
    libc.src.__support.FPUtil.fp_bits
)

add_fp_unittest(
  atanf_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    atanf_test.cpp
  DEPENDS
    libc.src.errno.errno
    libc.src.math.atanf
    libc.src.__support.FPUtil.fp_bits
)

add_fp_unittest(
  scalbn_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    scalbn_test.cpp
  HDRS
    ScalbnTest.h
  DEPENDS
    libc.src.math.scalbn
    libc.src.__support.FPUtil.fp_bits
    libc.src.__support.FPUtil.normal_float
)

add_fp_unittest(
  scalbnf_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    scalbnf_test.cpp
  HDRS
    ScalbnTest.h
  DEPENDS
    libc.src.math.scalbnf
    libc.src.__support.FPUtil.fp_bits
    libc.src.__support.FPUtil.normal_float
)

add_fp_unittest(
  scalbnl_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    scalbnl_test.cpp
  HDRS
    ScalbnTest.h
  DEPENDS
    libc.src.math.scalbnl
    libc.src.__support.FPUtil.fp_bits
    libc.src.__support.FPUtil.normal_float
)

add_fp_unittest(
  scalbnf128_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    scalbnf128_test.cpp
  HDRS
    ScalbnTest.h
  DEPENDS
    libc.src.math.scalbnf128
    libc.src.__support.FPUtil.fp_bits
    libc.src.__support.FPUtil.normal_float
)

add_fp_unittest(
  erff_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    erff_test.cpp
  DEPENDS
    libc.src.math.erff
    libc.src.__support.FPUtil.fp_bits
)

add_fp_unittest(
  pow_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    pow_test.cpp
  DEPENDS
    libc.src.math.pow
)

add_fp_unittest(
  powf_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    powf_test.cpp
  DEPENDS
    libc.src.math.powf
    libc.src.__support.FPUtil.fp_bits
)

add_fp_unittest(
  atan2f_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    atan2f_test.cpp
  DEPENDS
    libc.src.math.atan2f
    libc.src.__support.FPUtil.fp_bits
)

add_fp_unittest(
  atan2_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    atan2_test.cpp
  DEPENDS
    libc.src.math.atan2
    libc.src.__support.FPUtil.fp_bits
)

add_fp_unittest(
  f16add_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    f16add_test.cpp
  HDRS
    AddTest.h
  DEPENDS
    libc.src.math.f16add
)

add_fp_unittest(
  f16addf_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    f16addf_test.cpp
  HDRS
    AddTest.h
  DEPENDS
    libc.src.math.f16addf
)

add_fp_unittest(
  f16addl_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    f16addl_test.cpp
  HDRS
    AddTest.h
  DEPENDS
    libc.src.math.f16addl
)

add_fp_unittest(
  f16sub_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    f16sub_test.cpp
  HDRS
    SubTest.h
  DEPENDS
    libc.src.math.f16sub
)

add_fp_unittest(
  f16subf_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    f16subf_test.cpp
  HDRS
    SubTest.h
  DEPENDS
    libc.src.math.f16subf
)

add_fp_unittest(
  f16subl_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    f16subl_test.cpp
  HDRS
    SubTest.h
  DEPENDS
    libc.src.math.f16subl
)

add_fp_unittest(
  f16div_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    f16div_test.cpp
  HDRS
    DivTest.h
  DEPENDS
    libc.src.math.f16div
)

add_fp_unittest(
  f16divf_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    f16divf_test.cpp
  HDRS
    DivTest.h
  DEPENDS
    libc.src.math.f16divf
)

add_fp_unittest(
  f16divl_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    f16divl_test.cpp
  HDRS
    DivTest.h
  DEPENDS
    libc.src.math.f16divl
)

add_fp_unittest(
  f16fma_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    f16fma_test.cpp
  HDRS
    FmaTest.h
  DEPENDS
    libc.src.math.f16fma
    libc.src.stdlib.rand
    libc.src.stdlib.srand
)

add_fp_unittest(
  f16fmaf_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    f16fmaf_test.cpp
  HDRS
    FmaTest.h
  DEPENDS
    libc.src.math.f16fmaf
    libc.src.stdlib.rand
    libc.src.stdlib.srand
)

add_fp_unittest(
  f16fmal_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    f16fmal_test.cpp
  HDRS
    FmaTest.h
  DEPENDS
    libc.src.math.f16fmal
    libc.src.stdlib.rand
    libc.src.stdlib.srand
)

add_fp_unittest(
  f16sqrt_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    f16sqrt_test.cpp
  HDRS
    SqrtTest.h
  DEPENDS
    libc.src.math.f16sqrt
)

add_fp_unittest(
  f16sqrtf_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    f16sqrtf_test.cpp
  HDRS
    SqrtTest.h
  DEPENDS
    libc.src.math.f16sqrtf
)

add_fp_unittest(
  f16sqrtl_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    f16sqrtl_test.cpp
  HDRS
    SqrtTest.h
  DEPENDS
    libc.src.math.f16sqrtl
)

add_fp_unittest(
  fsqrt_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    fsqrt_test.cpp
  HDRS
    SqrtTest.h
  DEPENDS
    libc.src.math.fsqrt
)

add_fp_unittest(
  fsqrtl_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    fsqrtl_test.cpp
  HDRS
    SqrtTest.h
  DEPENDS
    libc.src.math.fsqrtl
)

add_fp_unittest(
  fsub_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    fsub_test.cpp
  HDRS
    SubTest.h
  DEPENDS
    libc.src.math.fsub
)

add_fp_unittest(
  fsubl_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    fsubl_test.cpp
  HDRS
    SubTest.h
  DEPENDS
    libc.src.math.fsubl
)

add_fp_unittest(
  dsqrtl_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    dsqrtl_test.cpp
  HDRS
    SqrtTest.h
  DEPENDS
    libc.src.math.dsqrtl
)

add_fp_unittest(
  cbrtf_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    cbrtf_test.cpp
  DEPENDS
    libc.src.math.cbrtf
    libc.src.__support.FPUtil.fp_bits
)

add_fp_unittest(
  cbrt_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    cbrt_test.cpp
  DEPENDS
    libc.src.math.cbrt
    libc.src.__support.FPUtil.fp_bits
)

add_fp_unittest(
  dmull_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    dmull_test.cpp
  HDRS
    MulTest.h
  DEPENDS
    libc.src.math.dmull
    libc.src.stdlib.rand
    libc.src.stdlib.srand
)

add_fp_unittest(
  f16mul_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    f16mul_test.cpp
  HDRS
    MulTest.h
  DEPENDS
    libc.src.math.f16mul
    libc.src.stdlib.rand
    libc.src.stdlib.srand
)

add_fp_unittest(
  f16mulf_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    f16mulf_test.cpp
  HDRS
    MulTest.h
  DEPENDS
    libc.src.math.f16mulf
    libc.src.stdlib.rand
    libc.src.stdlib.srand
)

add_fp_unittest(
  f16mull_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    f16mull_test.cpp
  HDRS
    MulTest.h
  DEPENDS
    libc.src.math.f16mull
    libc.src.stdlib.rand
    libc.src.stdlib.srand
)

add_fp_unittest(
  ddivl_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    ddivl_test.cpp
  HDRS
    DivTest.h
  DEPENDS
    libc.src.math.ddivl
)

add_fp_unittest(
  dfmal_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    dfmal_test.cpp
  HDRS
    FmaTest.h
  DEPENDS
    libc.src.math.dfmal
    libc.src.stdlib.rand
    libc.src.stdlib.srand
)

add_fp_unittest(
  dsubl_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    dsubl_test.cpp
  HDRS
    SubTest.h
  DEPENDS
    libc.src.math.dsubl
)

add_fp_unittest(
  fdiv_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    fdiv_test.cpp
  HDRS
    DivTest.h
  DEPENDS
    libc.src.math.fdiv
)

add_fp_unittest(
  fdivl_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    fdivl_test.cpp
  HDRS
    DivTest.h
  DEPENDS
    libc.src.math.fdivl
)

add_fp_unittest(
  ffma_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    ffma_test.cpp
  HDRS
    FmaTest.h
  DEPENDS
    libc.src.math.ffma
    libc.src.stdlib.rand
    libc.src.stdlib.srand
)

add_fp_unittest(
  ffmal_test
  NEED_MPFR
  SUITE
    libc-math-unittests
  SRCS
    ffmal_test.cpp
  HDRS
    FmaTest.h
  DEPENDS
    libc.src.math.ffmal
    libc.src.stdlib.rand
    libc.src.stdlib.srand
)


add_subdirectory(generic)
add_subdirectory(smoke)

if(NOT LLVM_LIBC_FULL_BUILD)
  add_subdirectory(exhaustive)
  add_subdirectory(performance_testing)
endif()