Files
llvm-project/libc/test/shared/CMakeLists.txt
Anonmiraj 20ae894770 [libc][math] Refactor fmaximum_num-fminimum_num family to header-only (#194562)
Refactors the fmaximum_num-fminimum_num math family to be header-only.

part of: #147386

Target Functions:
  - fmaximum_num
  - fmaximum_numbf16
  - fmaximum_numf
  - fmaximum_numf128
  - fmaximum_numf16
  - fmaximum_numl
  - fminimum_num
  - fminimum_numbf16
  - fminimum_numf
  - fminimum_numf128
  - fminimum_numf16
  - fminimum_numl
2026-04-28 11:11:09 +03:00

440 lines
15 KiB
CMake

add_custom_target(libc-shared-tests)
add_fp_unittest(
shared_math_test
SUITE
libc-shared-tests
SRCS
shared_math_test.cpp
DEPENDS
libc.src.__support.FPUtil.fp_bits
libc.src.__support.math.acos
libc.src.__support.math.acosf
libc.src.__support.math.acosf16
libc.src.__support.math.acoshf
libc.src.__support.math.acoshf16
libc.src.__support.math.acospif
libc.src.__support.math.acospif16
libc.src.__support.math.asin
libc.src.__support.math.asinbf16
libc.src.__support.math.asinf
libc.src.__support.math.asinf16
libc.src.__support.math.asinhf
libc.src.__support.math.asinhf16
libc.src.__support.math.asinpi
libc.src.__support.math.asinpif
libc.src.__support.math.asinpif16
libc.src.__support.math.atan
libc.src.__support.math.atan2
libc.src.__support.math.atan2f
libc.src.__support.math.atan2f128
libc.src.__support.math.atan2f16
libc.src.__support.math.atanbf16
libc.src.__support.math.atanf
libc.src.__support.math.atanf16
libc.src.__support.math.atanhf
libc.src.__support.math.atanhf16
libc.src.__support.math.atanpif16
libc.src.__support.math.bf16add
libc.src.__support.math.bf16addf
libc.src.__support.math.bf16addl
libc.src.__support.math.bf16addf128
libc.src.__support.math.bf16div
libc.src.__support.math.bf16divf
libc.src.__support.math.bf16divf128
libc.src.__support.math.bf16divl
libc.src.__support.math.bf16fma
libc.src.__support.math.bf16fmaf
libc.src.__support.math.bf16fmaf128
libc.src.__support.math.bf16fmal
libc.src.__support.math.bf16mul
libc.src.__support.math.bf16mulf
libc.src.__support.math.bf16mulf128
libc.src.__support.math.bf16mull
libc.src.__support.math.bf16sub
libc.src.__support.math.bf16subf
libc.src.__support.math.bf16subf128
libc.src.__support.math.bf16subl
libc.src.__support.math.canonicalize
libc.src.__support.math.canonicalizebf16
libc.src.__support.math.canonicalizef
libc.src.__support.math.canonicalizef128
libc.src.__support.math.canonicalizef16
libc.src.__support.math.canonicalizel
libc.src.__support.math.cbrt
libc.src.__support.math.cbrtbf16
libc.src.__support.math.cbrtf
libc.src.__support.math.ceil
libc.src.__support.math.ceilbf16
libc.src.__support.math.ceilf
libc.src.__support.math.ceilf128
libc.src.__support.math.ceilf16
libc.src.__support.math.ceill
libc.src.__support.math.copysign
libc.src.__support.math.copysignbf16
libc.src.__support.math.copysignf
libc.src.__support.math.copysignf128
libc.src.__support.math.copysignf16
libc.src.__support.math.copysignl
libc.src.__support.math.cos
libc.src.__support.math.cosf
libc.src.__support.math.cosf16
libc.src.__support.math.coshf
libc.src.__support.math.coshf16
libc.src.__support.math.cospif
libc.src.__support.math.cospif16
libc.src.__support.math.daddf128
libc.src.__support.math.daddl
libc.src.__support.math.ddivf128
libc.src.__support.math.ddivl
libc.src.__support.math.dfmaf128
libc.src.__support.math.dfmal
libc.src.__support.math.dmulf128
libc.src.__support.math.dmull
libc.src.__support.math.dsqrtf128
libc.src.__support.math.dsqrtl
libc.src.__support.math.dsubf128
libc.src.__support.math.dsubl
libc.src.__support.math.exp10m1f
libc.src.__support.math.exp10m1f16
libc.src.__support.math.erfcf16
libc.src.__support.math.erff
libc.src.__support.math.erff16
libc.src.__support.math.exp
libc.src.__support.math.exp2
libc.src.__support.math.exp2f
libc.src.__support.math.exp2f16
libc.src.__support.math.exp2m1f
libc.src.__support.math.exp2m1f16
libc.src.__support.math.expm1
libc.src.__support.math.expm1f
libc.src.__support.math.expm1f16
libc.src.__support.math.exp10
libc.src.__support.math.exp10f
libc.src.__support.math.exp10f16
libc.src.__support.math.expf
libc.src.__support.math.expf16
libc.src.__support.math.f16add
libc.src.__support.math.f16addf
libc.src.__support.math.f16addf128
libc.src.__support.math.f16addl
libc.src.__support.math.f16div
libc.src.__support.math.f16divf
libc.src.__support.math.f16divf128
libc.src.__support.math.f16divl
libc.src.__support.math.f16fma
libc.src.__support.math.f16fmaf
libc.src.__support.math.f16fmaf128
libc.src.__support.math.f16fmal
libc.src.__support.math.f16mul
libc.src.__support.math.f16mulf
libc.src.__support.math.f16mulf128
libc.src.__support.math.f16mull
libc.src.__support.math.f16sqrt
libc.src.__support.math.f16sqrtf
libc.src.__support.math.f16sqrtf128
libc.src.__support.math.f16sqrtl
libc.src.__support.math.f16sub
libc.src.__support.math.f16subf
libc.src.__support.math.f16subf128
libc.src.__support.math.f16subl
libc.src.__support.math.fabs
libc.src.__support.math.fabsbf16
libc.src.__support.math.fabsf
libc.src.__support.math.fabsf128
libc.src.__support.math.fabsf16
libc.src.__support.math.fabsl
libc.src.__support.math.fadd
libc.src.__support.math.faddf128
libc.src.__support.math.faddl
libc.src.__support.math.fdim
libc.src.__support.math.fdimbf16
libc.src.__support.math.fdimf
libc.src.__support.math.fdimf128
libc.src.__support.math.fdimf16
libc.src.__support.math.fdiml
libc.src.__support.math.fdiv
libc.src.__support.math.fdivf128
libc.src.__support.math.fdivl
libc.src.__support.math.ffma
libc.src.__support.math.ffmaf128
libc.src.__support.math.ffmal
libc.src.__support.math.floor
libc.src.__support.math.floorbf16
libc.src.__support.math.floorf
libc.src.__support.math.floorf128
libc.src.__support.math.floorf16
libc.src.__support.math.floorl
libc.src.__support.math.fma
libc.src.__support.math.fmaf
libc.src.__support.math.fmaf16
libc.src.__support.math.fmabf16
libc.src.__support.math.fmax
libc.src.__support.math.fmaxbf16
libc.src.__support.math.fmaxf
libc.src.__support.math.fmaxf128
libc.src.__support.math.fmaxf16
libc.src.__support.math.fmaximum
libc.src.__support.math.fmaximum_mag_num
libc.src.__support.math.fmaximum_mag_numbf16
libc.src.__support.math.fmaximum_mag_numf
libc.src.__support.math.fmaximum_num
libc.src.__support.math.fmaximum_numbf16
libc.src.__support.math.fmaximum_numf
libc.src.__support.math.fmaximum_numf128
libc.src.__support.math.fmaximum_numf16
libc.src.__support.math.fmaximum_numl
libc.src.__support.math.fmaximumbf16
libc.src.__support.math.fmaximumf
libc.src.__support.math.fmaximumf128
libc.src.__support.math.fmaximumf16
libc.src.__support.math.fmaximuml
libc.src.__support.math.fmaxl
libc.src.__support.math.fmin
libc.src.__support.math.fminbf16
libc.src.__support.math.fminf
libc.src.__support.math.fminf128
libc.src.__support.math.fminf16
libc.src.__support.math.fminimum
libc.src.__support.math.fminimum_num
libc.src.__support.math.fminimum_numbf16
libc.src.__support.math.fminimum_numf
libc.src.__support.math.fminimum_numf128
libc.src.__support.math.fminimum_numf16
libc.src.__support.math.fminimum_numl
libc.src.__support.math.fminimumbf16
libc.src.__support.math.fminimumf
libc.src.__support.math.fminimumf128
libc.src.__support.math.fminimumf16
libc.src.__support.math.fminimuml
libc.src.__support.math.fminl
libc.src.__support.math.frexpf
libc.src.__support.math.frexpf128
libc.src.__support.math.frexpf16
libc.src.__support.math.fsqrt
libc.src.__support.math.fsqrtf128
libc.src.__support.math.fsqrtl
libc.src.__support.math.getpayload
libc.src.__support.math.getpayloadbf16
libc.src.__support.math.getpayloadf
libc.src.__support.math.getpayloadf128
libc.src.__support.math.getpayloadf16
libc.src.__support.math.getpayloadl
libc.src.__support.math.hypot
libc.src.__support.math.hypotf
libc.src.__support.math.hypotbf16
libc.src.__support.math.hypotf16
libc.src.__support.math.ilogb
libc.src.__support.math.ilogbbf16
libc.src.__support.math.ilogbf
libc.src.__support.math.ilogbf16
libc.src.__support.math.ilogbf128
libc.src.__support.math.ilogbl
libc.src.__support.math.ldexpf
libc.src.__support.math.llogb
libc.src.__support.math.llogbbf16
libc.src.__support.math.log
libc.src.__support.math.log10
libc.src.__support.math.log10f16
libc.src.__support.math.log10p1f16
libc.src.__support.math.log10f
libc.src.__support.math.log1p
libc.src.__support.math.log1pf
libc.src.__support.math.log2
libc.src.__support.math.logb
libc.src.__support.math.log2f
libc.src.__support.math.log2f16
libc.src.__support.math.log2p1f16
libc.src.__support.math.logbf
libc.src.__support.math.logbbf16
libc.src.__support.math.logbf128
libc.src.__support.math.logbf16
libc.src.__support.math.logf
libc.src.__support.math.log_bf16
libc.src.__support.math.ldexpf
libc.src.__support.math.ldexpf128
libc.src.__support.math.ldexpf16
libc.src.__support.math.llogbf
libc.src.__support.math.llogbf128
libc.src.__support.math.llogbf16
libc.src.__support.math.logbl
libc.src.__support.math.logf16
libc.src.__support.math.llogbl
libc.src.__support.math.nextdown
libc.src.__support.math.nextdownbf16
libc.src.__support.math.nextdownf
libc.src.__support.math.nextdownf128
libc.src.__support.math.nextdownf16
libc.src.__support.math.nextdownl
libc.src.__support.math.nextup
libc.src.__support.math.nextupbf16
libc.src.__support.math.nextupf
libc.src.__support.math.nextupf128
libc.src.__support.math.nextupf16
libc.src.__support.math.nextupl
libc.src.__support.math.nexttoward
libc.src.__support.math.nexttowardbf16
libc.src.__support.math.nexttowardf
libc.src.__support.math.nexttowardf16
libc.src.__support.math.nexttowardl
libc.src.__support.math.nextafter
libc.src.__support.math.nextafterbf16
libc.src.__support.math.nextafterf
libc.src.__support.math.nextafterf16
libc.src.__support.math.nextafterl
libc.src.__support.math.nextafterf128
libc.src.__support.math.pow
libc.src.__support.math.powf
libc.src.__support.math.rsqrtf
libc.src.__support.math.rsqrtf16
libc.src.__support.math.setpayload
libc.src.__support.math.setpayloadbf16
libc.src.__support.math.setpayloadf
libc.src.__support.math.setpayloadf128
libc.src.__support.math.setpayloadf16
libc.src.__support.math.setpayloadl
libc.src.__support.math.setpayloadsig
libc.src.__support.math.setpayloadsigbf16
libc.src.__support.math.setpayloadsigf
libc.src.__support.math.setpayloadsigf128
libc.src.__support.math.setpayloadsigf16
libc.src.__support.math.setpayloadsigl
libc.src.__support.math.sqrtf16
libc.src.__support.math.sin
libc.src.__support.math.sincos
libc.src.__support.math.sincosf
libc.src.__support.math.sinf
libc.src.__support.math.sinf16
libc.src.__support.math.sinhf
libc.src.__support.math.sinhf16
libc.src.__support.math.sqrtf128
libc.src.__support.math.sinpif
libc.src.__support.math.sinpif16
libc.src.__support.math.sqrt
libc.src.__support.math.sqrtbf16
libc.src.__support.math.sqrtf
libc.src.__support.math.sqrtl
libc.src.__support.math.tan
libc.src.__support.math.tanf
libc.src.__support.math.tanf16
libc.src.__support.math.tanhf
libc.src.__support.math.tanhf16
libc.src.__support.math.tanpif
libc.src.__support.math.tanpif16
)
add_fp_unittest(
shared_math_constexpr_test
SUITE
libc-shared-tests
SRCS
shared_math_constexpr_test.cpp
DEPENDS
libc.src.__support.math.asinbf16
libc.src.__support.math.bf16subl
libc.src.__support.math.ceil
libc.src.__support.math.ceilbf16
libc.src.__support.math.ceilf
libc.src.__support.math.ceilf128
libc.src.__support.math.ceilf16
libc.src.__support.math.ceill
libc.src.__support.math.copysign
libc.src.__support.math.copysignbf16
libc.src.__support.math.copysignf
libc.src.__support.math.copysignf128
libc.src.__support.math.copysignf16
libc.src.__support.math.copysignl
libc.src.__support.math.ddivf128
libc.src.__support.math.ddivl
libc.src.__support.math.dmulf128
libc.src.__support.math.dmull
libc.src.__support.math.dsqrtf128
libc.src.__support.math.fdim
libc.src.__support.math.fdimbf16
libc.src.__support.math.fdimf
libc.src.__support.math.fdimf128
libc.src.__support.math.fdimf16
libc.src.__support.math.fdiml
libc.src.__support.math.fdiv
libc.src.__support.math.fdivf128
libc.src.__support.math.fdivl
libc.src.__support.math.floor
libc.src.__support.math.floorbf16
libc.src.__support.math.floorf
libc.src.__support.math.floorf128
libc.src.__support.math.floorf16
libc.src.__support.math.floorl
libc.src.__support.math.fabs
libc.src.__support.math.fabsbf16
libc.src.__support.math.fabsf
libc.src.__support.math.fabsf128
libc.src.__support.math.fabsf16
libc.src.__support.math.fabsl
libc.src.__support.math.fmaximum
libc.src.__support.math.fmaximum_mag_num
libc.src.__support.math.fmaximum_mag_numbf16
libc.src.__support.math.fmaximum_mag_numf
libc.src.__support.math.fmaximum_num
libc.src.__support.math.fmaximum_numbf16
libc.src.__support.math.fmaximum_numf
libc.src.__support.math.fmaximum_numf128
libc.src.__support.math.fmaximum_numf16
libc.src.__support.math.fmaximum_numl
libc.src.__support.math.fmaximumbf16
libc.src.__support.math.fmaximumf
libc.src.__support.math.fmaximumf128
libc.src.__support.math.fmaximumf16
libc.src.__support.math.fmaximuml
libc.src.__support.math.fmin
libc.src.__support.math.fminbf16
libc.src.__support.math.fminf
libc.src.__support.math.fminf128
libc.src.__support.math.fminf16
libc.src.__support.math.fminimum
libc.src.__support.math.fminimum_num
libc.src.__support.math.fminimum_numbf16
libc.src.__support.math.fminimum_numf
libc.src.__support.math.fminimum_numf128
libc.src.__support.math.fminimum_numf16
libc.src.__support.math.fminimum_numl
libc.src.__support.math.fminimumbf16
libc.src.__support.math.fminimumf
libc.src.__support.math.fminimumf128
libc.src.__support.math.fminimumf16
libc.src.__support.math.fminimuml
libc.src.__support.math.fminl
libc.src.__support.math.llogbbf16
libc.src.__support.math.log
libc.src.__support.math.logbbf16
libc.src.__support.math.ilogbbf16
libc.src.__support.math.sqrtl
)
add_fp_unittest(
shared_str_to_num_test
SUITE
libc-shared-tests
SRCS
shared_str_to_num_test.cpp
DEPENDS
libc.src.__support.str_to_float
libc.src.__support.str_to_integer
)
# FIXME: The LLVM libc full build does not support 'system' yet.
if(NOT LLVM_LIBC_FULL_BUILD)
add_libc_test(
shared_rpc_test
UNIT_TEST_ONLY
SUITE
libc-shared-tests
SRCS
shared_rpc_test.cpp
DEPENDS
libc.src.stdio.printf_core.converter
libc.src.stdio.printf_core.parser
libc.src.stdio.printf_core.writer
libc.src.__support.arg_list
)
endif()