647 lines · plain
1# This file is licensed under the Apache License v2.0 with LLVM Exceptions.2# See https://llvm.org/LICENSE.txt for license information.3# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception4 5# Tests for LLVM libc math.h functions.6 7load("//libc/test/src/math:libc_math_test_rules.bzl", "math_mpfr_test")8 9package(default_visibility = ["//visibility:public"])10 11exports_files(["libc_math_test_rules.bzl"])12 13licenses(["notice"])14 15math_mpfr_test(name = "acosf")16 17math_mpfr_test(name = "acoshf")18 19math_mpfr_test(name = "asinf")20 21math_mpfr_test(name = "asinhf")22 23math_mpfr_test(name = "atan2")24 25math_mpfr_test(name = "atan2f")26 27math_mpfr_test(name = "atan")28 29math_mpfr_test(name = "atanf")30 31math_mpfr_test(name = "atanhf")32 33math_mpfr_test(name = "cbrt")34 35math_mpfr_test(name = "cbrtf")36 37math_mpfr_test(38 name = "ceil",39 hdrs = ["CeilTest.h"],40)41 42math_mpfr_test(43 name = "ceilf",44 hdrs = ["CeilTest.h"],45)46 47math_mpfr_test(48 name = "ceill",49 hdrs = ["CeilTest.h"],50)51 52math_mpfr_test(53 name = "ceilf16",54 hdrs = ["CeilTest.h"],55)56 57math_mpfr_test(name = "cos")58 59math_mpfr_test(60 name = "cosf",61 hdrs = ["sdcomp26094.h"],62 deps = [63 "//libc:__support_cpp_array",64 ],65)66 67math_mpfr_test(68 name = "coshf",69 deps = [70 "//libc:__support_cpp_array",71 ],72)73 74math_mpfr_test(75 name = "cospif",76 hdrs = ["sdcomp26094.h"],77 deps = [78 "//libc:__support_cpp_array",79 ],80)81 82math_mpfr_test(83 name = "daddl",84 hdrs = ["AddTest.h"],85)86 87math_mpfr_test(88 name = "ddivl",89 hdrs = ["DivTest.h"],90)91 92# TODO: Add dfmal, dmull test. Missing stdlib/rand dependency.93 94math_mpfr_test(95 name = "dsqrtl",96 hdrs = ["SqrtTest.h"],97)98 99math_mpfr_test(100 name = "dsubl",101 hdrs = ["SubTest.h"],102)103 104math_mpfr_test(name = "erff")105 106math_mpfr_test(name = "exp")107 108math_mpfr_test(name = "expf")109 110math_mpfr_test(name = "exp10")111 112math_mpfr_test(name = "exp10f")113 114math_mpfr_test(name = "exp2")115 116math_mpfr_test(name = "exp2f")117 118math_mpfr_test(119 name = "exp2m1f",120 deps = [121 "//libc:__support_cpp_array",122 ],123)124 125math_mpfr_test(name = "expm1")126 127math_mpfr_test(name = "expm1f")128 129math_mpfr_test(130 name = "fabs",131 hdrs = ["FAbsTest.h"],132)133 134math_mpfr_test(135 name = "fabsf",136 hdrs = ["FAbsTest.h"],137)138 139math_mpfr_test(140 name = "fabsl",141 hdrs = ["FAbsTest.h"],142)143 144math_mpfr_test(145 name = "fadd",146 hdrs = ["AddTest.h"],147)148 149math_mpfr_test(150 name = "faddl",151 hdrs = ["AddTest.h"],152)153 154math_mpfr_test(155 name = "f16add",156 hdrs = ["AddTest.h"],157)158 159math_mpfr_test(160 name = "f16addf",161 hdrs = ["AddTest.h"],162)163 164math_mpfr_test(165 name = "f16addl",166 hdrs = ["AddTest.h"],167)168 169math_mpfr_test(170 name = "fdiv",171 hdrs = ["DivTest.h"],172)173 174math_mpfr_test(175 name = "fdivl",176 hdrs = ["DivTest.h"],177)178 179math_mpfr_test(180 name = "f16div",181 hdrs = ["DivTest.h"],182)183 184math_mpfr_test(185 name = "f16divf",186 hdrs = ["DivTest.h"],187)188 189math_mpfr_test(190 name = "f16divl",191 hdrs = ["DivTest.h"],192)193 194# TODO: Add ffma, ffmal test. Missing stdlib/rand dependency.195 196math_mpfr_test(197 name = "floor",198 hdrs = ["FloorTest.h"],199)200 201math_mpfr_test(202 name = "floorf",203 hdrs = ["FloorTest.h"],204)205 206math_mpfr_test(207 name = "floorl",208 hdrs = ["FloorTest.h"],209)210 211math_mpfr_test(212 name = "floorf16",213 hdrs = ["FloorTest.h"],214)215 216# TODO: Add fma, fmaf, fmal, fmul, fmull tests. Missing stdlib/rand dependency.217 218# math_mpfr_test(name = "f16mul")219# math_mpfr_test(name = "f16mulf")220# math_mpfr_test(name = "f16mull")221 222# math_mpfr_test(name = "f16fma")223# math_mpfr_test(name = "f16fmaf")224# math_mpfr_test(name = "f16fmal")225 226math_mpfr_test(227 name = "frexp",228 hdrs = ["FrexpTest.h"],229)230 231math_mpfr_test(232 name = "frexpf",233 hdrs = ["FrexpTest.h"],234)235 236math_mpfr_test(237 name = "frexpl",238 hdrs = ["FrexpTest.h"],239)240 241math_mpfr_test(242 name = "fsqrt",243 hdrs = ["SqrtTest.h"],244)245 246math_mpfr_test(247 name = "fsqrtl",248 hdrs = ["SqrtTest.h"],249)250 251math_mpfr_test(252 name = "fsub",253 hdrs = ["SubTest.h"],254)255 256math_mpfr_test(257 name = "fsubl",258 hdrs = ["SubTest.h"],259)260 261math_mpfr_test(262 name = "f16sub",263 hdrs = ["SubTest.h"],264)265 266math_mpfr_test(267 name = "f16subf",268 hdrs = ["SubTest.h"],269)270 271math_mpfr_test(272 name = "f16subl",273 hdrs = ["SubTest.h"],274)275 276math_mpfr_test(277 name = "hypot",278 hdrs = ["HypotTest.h"],279)280 281math_mpfr_test(282 name = "hypotf",283 hdrs = [284 "HypotTest.h",285 "hypotf_hard_to_round.h",286 ],287)288 289math_mpfr_test(290 name = "hypotf16",291 hdrs = [292 "HypotTest.h",293 ],294)295 296math_mpfr_test(297 name = "llrint",298 hdrs = ["RoundToIntegerTest.h"],299)300 301math_mpfr_test(302 name = "llrintf",303 hdrs = ["RoundToIntegerTest.h"],304)305 306math_mpfr_test(307 name = "llrintl",308 hdrs = ["RoundToIntegerTest.h"],309)310 311math_mpfr_test(312 name = "llrintf16",313 hdrs = ["RoundToIntegerTest.h"],314)315 316math_mpfr_test(317 name = "llround",318 hdrs = ["RoundToIntegerTest.h"],319)320 321math_mpfr_test(322 name = "llroundf",323 hdrs = ["RoundToIntegerTest.h"],324)325 326math_mpfr_test(327 name = "llroundl",328 hdrs = ["RoundToIntegerTest.h"],329)330 331math_mpfr_test(332 name = "lroundf16",333 hdrs = ["RoundToIntegerTest.h"],334)335 336math_mpfr_test(337 name = "llroundf16",338 hdrs = ["RoundToIntegerTest.h"],339)340 341math_mpfr_test(name = "log")342 343math_mpfr_test(name = "logf")344 345math_mpfr_test(name = "log10")346 347math_mpfr_test(name = "log10f")348 349math_mpfr_test(name = "log1p")350 351math_mpfr_test(name = "log1pf")352 353math_mpfr_test(name = "log2")354 355math_mpfr_test(name = "log2f")356 357math_mpfr_test(358 name = "lrint",359 hdrs = ["RoundToIntegerTest.h"],360)361 362math_mpfr_test(363 name = "lrintf",364 hdrs = ["RoundToIntegerTest.h"],365)366 367math_mpfr_test(368 name = "lrintl",369 hdrs = ["RoundToIntegerTest.h"],370)371 372math_mpfr_test(373 name = "lrintf16",374 hdrs = ["RoundToIntegerTest.h"],375)376 377math_mpfr_test(378 name = "lround",379 hdrs = ["RoundToIntegerTest.h"],380)381 382math_mpfr_test(383 name = "lroundf",384 hdrs = ["RoundToIntegerTest.h"],385)386 387math_mpfr_test(388 name = "lroundl",389 hdrs = ["RoundToIntegerTest.h"],390)391 392# TODO: add nan tests.393 394math_mpfr_test(395 name = "nearbyint",396 hdrs = ["NearbyIntTest.h"],397 deps = [398 "//libc:__support_cpp_array",399 ],400)401 402math_mpfr_test(403 name = "nearbyintf",404 hdrs = ["NearbyIntTest.h"],405 deps = [406 "//libc:__support_cpp_array",407 ],408)409 410math_mpfr_test(411 name = "nearbyintl",412 hdrs = ["NearbyIntTest.h"],413 deps = [414 "//libc:__support_cpp_array",415 ],416)417 418math_mpfr_test(419 name = "nearbyintf16",420 hdrs = ["NearbyIntTest.h"],421 deps = [422 "//libc:__support_cpp_array",423 ],424)425 426math_mpfr_test(name = "pow")427 428math_mpfr_test(name = "powf")429 430math_mpfr_test(431 name = "remquo",432 hdrs = ["RemQuoTest.h"],433)434 435math_mpfr_test(436 name = "remquof",437 hdrs = ["RemQuoTest.h"],438)439 440math_mpfr_test(441 name = "remquol",442 hdrs = ["RemQuoTest.h"],443)444 445math_mpfr_test(446 name = "rint",447 hdrs = ["RIntTest.h"],448)449 450math_mpfr_test(451 name = "rintf",452 hdrs = ["RIntTest.h"],453)454 455math_mpfr_test(456 name = "rintl",457 hdrs = ["RIntTest.h"],458)459 460math_mpfr_test(461 name = "rintf16",462 hdrs = ["RIntTest.h"],463)464 465math_mpfr_test(466 name = "roundeven",467 hdrs = ["RoundEvenTest.h"],468)469 470math_mpfr_test(471 name = "roundevenf",472 hdrs = ["RoundEvenTest.h"],473)474 475math_mpfr_test(476 name = "roundevenl",477 hdrs = ["RoundEvenTest.h"],478)479 480math_mpfr_test(481 name = "roundevenf16",482 hdrs = ["RoundEvenTest.h"],483)484 485math_mpfr_test(486 name = "round",487 hdrs = ["RoundTest.h"],488)489 490math_mpfr_test(491 name = "roundf",492 hdrs = ["RoundTest.h"],493)494 495math_mpfr_test(496 name = "roundl",497 hdrs = ["RoundTest.h"],498)499 500math_mpfr_test(501 name = "roundf16",502 hdrs = ["RoundTest.h"],503)504 505math_mpfr_test(name = "sin")506 507math_mpfr_test(508 name = "sinf",509 hdrs = ["sdcomp26094.h"],510 deps = [511 "//libc:__support_cpp_array",512 ],513)514 515math_mpfr_test(name = "sincos")516 517math_mpfr_test(518 name = "sincosf",519 hdrs = ["sdcomp26094.h"],520 deps = [521 "//libc:__support_cpp_array",522 ],523)524 525math_mpfr_test(526 name = "sinhf",527 deps = [528 "//libc:__support_cpp_array",529 ],530)531 532math_mpfr_test(533 name = "sinpif",534 hdrs = ["sdcomp26094.h"],535 deps = [536 "//libc:__support_cpp_array",537 ],538)539 540math_mpfr_test(541 name = "tanpif",542 hdrs = ["sdcomp26094.h"],543 deps = [544 "//libc:__support_cpp_array",545 ],546)547 548math_mpfr_test(549 name = "sqrt",550 hdrs = ["SqrtTest.h"],551)552 553math_mpfr_test(554 name = "sqrtf",555 hdrs = ["SqrtTest.h"],556)557 558math_mpfr_test(559 name = "sqrtl",560 hdrs = ["SqrtTest.h"],561)562 563math_mpfr_test(564 name = "f16sqrt",565 hdrs = ["SqrtTest.h"],566)567 568math_mpfr_test(569 name = "f16sqrtf",570 hdrs = ["SqrtTest.h"],571)572 573math_mpfr_test(574 name = "f16sqrtl",575 hdrs = ["SqrtTest.h"],576)577 578math_mpfr_test(name = "tan")579 580math_mpfr_test(581 name = "tanf",582 hdrs = ["sdcomp26094.h"],583 deps = [584 "//libc:__support_cpp_array",585 ],586)587 588math_mpfr_test(name = "tanhf")589 590math_mpfr_test(591 name = "trunc",592 hdrs = ["TruncTest.h"],593)594 595math_mpfr_test(596 name = "truncf",597 hdrs = ["TruncTest.h"],598)599 600math_mpfr_test(601 name = "truncl",602 hdrs = ["TruncTest.h"],603)604 605math_mpfr_test(606 name = "truncf16",607 hdrs = ["TruncTest.h"],608)609 610math_mpfr_test(name = "cosf16")611 612math_mpfr_test(name = "cospif16")613 614math_mpfr_test(name = "sinf16")615 616math_mpfr_test(name = "sinpif16")617 618math_mpfr_test(name = "tanf16")619 620math_mpfr_test(name = "tanpif16")621 622math_mpfr_test(name = "expf16")623 624math_mpfr_test(name = "exp2f16")625 626math_mpfr_test(name = "exp2m1f16")627 628math_mpfr_test(name = "exp10f16")629 630math_mpfr_test(name = "exp10m1f16")631 632math_mpfr_test(name = "asinf16")633 634math_mpfr_test(name = "acosf16")635 636math_mpfr_test(name = "coshf16")637 638math_mpfr_test(name = "sinhf16")639 640math_mpfr_test(name = "tanhf16")641 642math_mpfr_test(name = "logf16")643 644math_mpfr_test(name = "log2f16")645 646math_mpfr_test(name = "log10f16")647