Debian Codegraph @

utils/bazel/llvm-project-overlay/libc/test/src/math/BUILD.bazel

raw
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-exception
4
5 # Tests for LLVM libc math.h functions.
6
7 load("//libc:libc_build_rules.bzl", "libc_support_library")
8 load("//libc/test/src/math:libc_math_test_rules.bzl", "math_test")
9
10 package(default_visibility = ["//visibility:public"])
11
12 exports_files(["libc_math_test_rules.bzl"])
13
14 licenses(["notice"])
15
16 math_test(
17 name = "fabs",
18 hdrs = ["FAbsTest.h"],
19 deps = ["//libc/utils/MPFRWrapper:mpfr_wrapper"],
20 )
21
22 math_test(
23 name = "fabsf",
24 hdrs = ["FAbsTest.h"],
25 deps = ["//libc/utils/MPFRWrapper:mpfr_wrapper"],
26 )
27
28 math_test(
29 name = "fabsl",
30 hdrs = ["FAbsTest.h"],
31 deps = ["//libc/utils/MPFRWrapper:mpfr_wrapper"],
32 )
33
34 math_test(
35 name = "ceil",
36 hdrs = ["CeilTest.h"],
37 deps = ["//libc/utils/MPFRWrapper:mpfr_wrapper"],
38 )
39
40 math_test(
41 name = "ceilf",
42 hdrs = ["CeilTest.h"],
43 deps = ["//libc/utils/MPFRWrapper:mpfr_wrapper"],
44 )
45
46 math_test(
47 name = "ceill",
48 hdrs = ["CeilTest.h"],
49 deps = ["//libc/utils/MPFRWrapper:mpfr_wrapper"],
50 )
51
52 math_test(
53 name = "floor",
54 hdrs = ["FloorTest.h"],
55 deps = ["//libc/utils/MPFRWrapper:mpfr_wrapper"],
56 )
57
58 math_test(
59 name = "floorf",
60 hdrs = ["FloorTest.h"],
61 deps = ["//libc/utils/MPFRWrapper:mpfr_wrapper"],
62 )
63
64 math_test(
65 name = "floorl",
66 hdrs = ["FloorTest.h"],
67 deps = ["//libc/utils/MPFRWrapper:mpfr_wrapper"],
68 )
69
70 math_test(
71 name = "trunc",
72 hdrs = ["TruncTest.h"],
73 deps = ["//libc/utils/MPFRWrapper:mpfr_wrapper"],
74 )
75
76 math_test(
77 name = "truncf",
78 hdrs = ["TruncTest.h"],
79 deps = ["//libc/utils/MPFRWrapper:mpfr_wrapper"],
80 )
81
82 math_test(
83 name = "truncl",
84 hdrs = ["TruncTest.h"],
85 deps = ["//libc/utils/MPFRWrapper:mpfr_wrapper"],
86 )
87
88 math_test(
89 name = "round",
90 hdrs = ["RoundTest.h"],
91 deps = ["//libc/utils/MPFRWrapper:mpfr_wrapper"],
92 )
93
94 math_test(
95 name = "roundf",
96 hdrs = ["RoundTest.h"],
97 deps = ["//libc/utils/MPFRWrapper:mpfr_wrapper"],
98 )
99
100 math_test(
101 name = "roundl",
102 hdrs = ["RoundTest.h"],
103 deps = ["//libc/utils/MPFRWrapper:mpfr_wrapper"],
104 )
105
106 math_test(
107 name = "frexp",
108 hdrs = ["FrexpTest.h"],
109 deps = ["//libc/utils/MPFRWrapper:mpfr_wrapper"],
110 )
111
112 math_test(
113 name = "frexpf",
114 hdrs = ["FrexpTest.h"],
115 deps = ["//libc/utils/MPFRWrapper:mpfr_wrapper"],
116 )
117
118 math_test(
119 name = "frexpl",
120 hdrs = ["FrexpTest.h"],
121 deps = ["//libc/utils/MPFRWrapper:mpfr_wrapper"],
122 )
123
124 math_test(
125 name = "hypot",
126 hdrs = ["HypotTest.h"],
127 deps = ["//libc/utils/MPFRWrapper:mpfr_wrapper"],
128 )
129
130 math_test(
131 name = "hypotf",
132 hdrs = [
133 "HypotTest.h",
134 "hypotf_hard_to_round.h",
135 ],
136 deps = ["//libc/utils/MPFRWrapper:mpfr_wrapper"],
137 )
138
139 math_test(
140 name = "logb",
141 hdrs = ["LogbTest.h"],
142 deps = ["//libc/utils/MPFRWrapper:mpfr_wrapper"],
143 )
144
145 math_test(
146 name = "logbf",
147 hdrs = ["LogbTest.h"],
148 deps = ["//libc/utils/MPFRWrapper:mpfr_wrapper"],
149 )
150
151 math_test(
152 name = "logbl",
153 hdrs = ["LogbTest.h"],
154 deps = ["//libc/utils/MPFRWrapper:mpfr_wrapper"],
155 )
156
157 math_test(
158 name = "modf",
159 hdrs = ["ModfTest.h"],
160 deps = ["//libc/utils/MPFRWrapper:mpfr_wrapper"],
161 )
162
163 math_test(
164 name = "modff",
165 hdrs = ["ModfTest.h"],
166 deps = ["//libc/utils/MPFRWrapper:mpfr_wrapper"],
167 )
168
169 math_test(
170 name = "modfl",
171 hdrs = ["ModfTest.h"],
172 deps = ["//libc/utils/MPFRWrapper:mpfr_wrapper"],
173 )
174
175 libc_support_library(
176 name = "remquo_test_template",
177 hdrs = ["RemQuoTest.h"],
178 deps = [
179 "//libc:__support_fputil_basic_operations",
180 "//libc:__support_fputil_fp_bits",
181 "//libc:hdr_math_macros",
182 "//libc/test/UnitTest:LibcUnitTest",
183 "//libc/test/UnitTest:fp_test_helpers",
184 "//libc/utils/MPFRWrapper:mpfr_wrapper",
185 ],
186 )
187
188 math_test(
189 name = "remquo",
190 deps = [
191 ":remquo_test_template",
192 "//libc/utils/MPFRWrapper:mpfr_wrapper",
193 ],
194 )
195
196 math_test(
197 name = "remquof",
198 deps = [
199 ":remquo_test_template",
200 "//libc/utils/MPFRWrapper:mpfr_wrapper",
201 ],
202 )
203
204 math_test(
205 name = "remquol",
206 deps = [
207 ":remquo_test_template",
208 "//libc/utils/MPFRWrapper:mpfr_wrapper",
209 ],
210 )
211
212 math_test(
213 name = "fmin",
214 hdrs = ["FMinTest.h"],
215 deps = ["//libc/utils/MPFRWrapper:mpfr_wrapper"],
216 )
217
218 math_test(
219 name = "fminf",
220 hdrs = ["FMinTest.h"],
221 deps = ["//libc/utils/MPFRWrapper:mpfr_wrapper"],
222 )
223
224 math_test(
225 name = "fminl",
226 hdrs = ["FMinTest.h"],
227 deps = ["//libc/utils/MPFRWrapper:mpfr_wrapper"],
228 )
229
230 math_test(
231 name = "fmax",
232 hdrs = ["FMaxTest.h"],
233 deps = ["//libc/utils/MPFRWrapper:mpfr_wrapper"],
234 )
235
236 math_test(
237 name = "fmaxf",
238 hdrs = ["FMaxTest.h"],
239 deps = ["//libc/utils/MPFRWrapper:mpfr_wrapper"],
240 )
241
242 math_test(
243 name = "fmaxl",
244 hdrs = ["FMaxTest.h"],
245 deps = ["//libc/utils/MPFRWrapper:mpfr_wrapper"],
246 )
247
248 math_test(
249 name = "sqrt",
250 hdrs = ["SqrtTest.h"],
251 deps = [
252 "//libc:__support_cpp_bit",
253 "//libc/utils/MPFRWrapper:mpfr_wrapper",
254 ],
255 )
256
257 math_test(
258 name = "sqrtf",
259 hdrs = ["SqrtTest.h"],
260 deps = [
261 "//libc:__support_cpp_bit",
262 "//libc/utils/MPFRWrapper:mpfr_wrapper",
263 ],
264 )
265
266 math_test(
267 name = "sqrtl",
268 hdrs = ["SqrtTest.h"],
269 deps = [
270 "//libc:__support_cpp_bit",
271 "//libc/utils/MPFRWrapper:mpfr_wrapper",
272 ],
273 )
274
275 math_test(
276 name = "copysign",
277 hdrs = ["CopySignTest.h"],
278 deps = ["//libc/utils/MPFRWrapper:mpfr_wrapper"],
279 )
280
281 math_test(
282 name = "copysignf",
283 hdrs = ["CopySignTest.h"],
284 deps = ["//libc/utils/MPFRWrapper:mpfr_wrapper"],
285 )
286
287 math_test(
288 name = "copysignl",
289 hdrs = ["CopySignTest.h"],
290 deps = ["//libc/utils/MPFRWrapper:mpfr_wrapper"],
291 )
292
293 libc_support_library(
294 name = "ilogb_test_template",
295 hdrs = ["ILogbTest.h"],
296 deps = [
297 "//libc:__support_cpp_limits",
298 "//libc:__support_fputil_fp_bits",
299 "//libc:__support_fputil_manipulation_functions",
300 "//libc:hdr_math_macros",
301 "//libc/test/UnitTest:LibcUnitTest",
302 "//libc/test/UnitTest:fp_test_helpers",
303 ],
304 )
305
306 math_test(
307 name = "ilogb",
308 deps = [":ilogb_test_template"],
309 )
310
311 math_test(
312 name = "ilogbf",
313 deps = [":ilogb_test_template"],
314 )
315
316 math_test(
317 name = "ilogbl",
318 deps = [":ilogb_test_template"],
319 )
320
321 libc_support_library(
322 name = "fdim_test_template",
323 hdrs = ["FDimTest.h"],
324 deps = [
325 "//libc:__support_fputil_basic_operations",
326 "//libc:__support_fputil_fenv_impl",
327 "//libc:__support_fputil_fp_bits",
328 "//libc:hdr_math_macros",
329 "//libc/test/UnitTest:LibcUnitTest",
330 "//libc/test/UnitTest:fp_test_helpers",
331 ],
332 )
333
334 math_test(
335 name = "fdim",
336 deps = [":fdim_test_template"],
337 )
338
339 math_test(
340 name = "fdimf",
341 deps = [":fdim_test_template"],
342 )
343
344 math_test(
345 name = "fdiml",
346 deps = [":fdim_test_template"],
347 )
348
349 libc_support_library(
350 name = "ldexp_test_template",
351 hdrs = ["LdExpTest.h"],
352 deps = [
353 "//libc:__support_cpp_limits",
354 "//libc:__support_fputil_fp_bits",
355 "//libc:__support_fputil_normal_float",
356 "//libc:hdr_math_macros",
357 "//libc/test/UnitTest:LibcUnitTest",
358 "//libc/test/UnitTest:fp_test_helpers",
359 ],
360 )
361
362 math_test(
363 name = "ldexp",
364 deps = [":ldexp_test_template"],
365 )
366
367 math_test(
368 name = "ldexpf",
369 deps = [":ldexp_test_template"],
370 )
371
372 math_test(
373 name = "ldexpl",
374 deps = [":ldexp_test_template"],
375 )
376
377 libc_support_library(
378 name = "rint_test_template",
379 hdrs = ["RIntTest.h"],
380 deps = [
381 "//libc:__support_cpp_algorithm",
382 "//libc:__support_fputil_fenv_impl",
383 "//libc:__support_fputil_fp_bits",
384 "//libc:hdr_fenv_macros",
385 "//libc:hdr_math_macros",
386 "//libc/test/UnitTest:LibcUnitTest",
387 "//libc/test/UnitTest:fp_test_helpers",
388 "//libc/utils/MPFRWrapper:mpfr_wrapper",
389 ],
390 )
391
392 math_test(
393 name = "rint",
394 deps = [
395 ":rint_test_template",
396 "//libc/utils/MPFRWrapper:mpfr_wrapper",
397 ],
398 )
399
400 math_test(
401 name = "rintf",
402 deps = [
403 ":rint_test_template",
404 "//libc/utils/MPFRWrapper:mpfr_wrapper",
405 ],
406 )
407
408 math_test(
409 name = "rintl",
410 deps = [
411 ":rint_test_template",
412 "//libc/utils/MPFRWrapper:mpfr_wrapper",
413 ],
414 )
415
416 libc_support_library(
417 name = "round_to_integer_test_template",
418 hdrs = ["RoundToIntegerTest.h"],
419 deps = [
420 "//libc:__support_cpp_algorithm",
421 "//libc:__support_fputil_fenv_impl",
422 "//libc:__support_fputil_fp_bits",
423 "//libc:__support_macros_properties_architectures",
424 "//libc:hdr_math_macros",
425 "//libc/test/UnitTest:LibcUnitTest",
426 "//libc/test/UnitTest:fp_test_helpers",
427 "//libc/utils/MPFRWrapper:mpfr_wrapper",
428 ],
429 )
430
431 math_test(
432 name = "lrint",
433 deps = [
434 ":round_to_integer_test_template",
435 "//libc/utils/MPFRWrapper:mpfr_wrapper",
436 ],
437 )
438
439 math_test(
440 name = "lrintf",
441 deps = [
442 ":round_to_integer_test_template",
443 "//libc/utils/MPFRWrapper:mpfr_wrapper",
444 ],
445 )
446
447 math_test(
448 name = "lrintl",
449 deps = [
450 ":round_to_integer_test_template",
451 "//libc/utils/MPFRWrapper:mpfr_wrapper",
452 ],
453 )
454
455 math_test(
456 name = "llrint",
457 deps = [
458 ":round_to_integer_test_template",
459 "//libc/utils/MPFRWrapper:mpfr_wrapper",
460 ],
461 )
462
463 math_test(
464 name = "llrintf",
465 deps = [
466 ":round_to_integer_test_template",
467 "//libc/utils/MPFRWrapper:mpfr_wrapper",
468 ],
469 )
470
471 math_test(
472 name = "llrintl",
473 deps = [
474 ":round_to_integer_test_template",
475 "//libc/utils/MPFRWrapper:mpfr_wrapper",
476 ],
477 )
478
479 math_test(
480 name = "lround",
481 deps = [
482 ":round_to_integer_test_template",
483 "//libc/utils/MPFRWrapper:mpfr_wrapper",
484 ],
485 )
486
487 math_test(
488 name = "lroundf",
489 deps = [
490 ":round_to_integer_test_template",
491 "//libc/utils/MPFRWrapper:mpfr_wrapper",
492 ],
493 )
494
495 math_test(
496 name = "lroundl",
497 deps = [
498 ":round_to_integer_test_template",
499 "//libc/utils/MPFRWrapper:mpfr_wrapper",
500 ],
501 )
502
503 math_test(
504 name = "llround",
505 deps = [
506 ":round_to_integer_test_template",
507 "//libc/utils/MPFRWrapper:mpfr_wrapper",
508 ],
509 )
510
511 math_test(
512 name = "llroundf",
513 deps = [
514 ":round_to_integer_test_template",
515 "//libc/utils/MPFRWrapper:mpfr_wrapper",
516 ],
517 )
518
519 math_test(
520 name = "llroundl",
521 deps = [
522 ":round_to_integer_test_template",
523 "//libc/utils/MPFRWrapper:mpfr_wrapper",
524 ],
525 )
526
527 libc_support_library(
528 name = "nextafter_test_template",
529 hdrs = ["NextAfterTest.h"],
530 deps = [
531 "//libc:__support_cpp_array",
532 "//libc:__support_cpp_bit",
533 "//libc:__support_cpp_type_traits",
534 "//libc:__support_fputil_basic_operations",
535 "//libc:__support_fputil_fenv_impl",
536 "//libc:__support_fputil_fp_bits",
537 "//libc:hdr_fenv_macros",
538 "//libc:hdr_math_macros",
539 "//libc/test/UnitTest:LibcUnitTest",
540 "//libc/test/UnitTest:fp_test_helpers",
541 ],
542 )
543
544 math_test(
545 name = "nextafter",
546 deps = [":nextafter_test_template"],
547 )
548
549 math_test(
550 name = "nextafterf",
551 deps = [":nextafter_test_template"],
552 )
553
554 math_test(
555 name = "nextafterl",
556 deps = [":nextafter_test_template"],
557 )
558
559 libc_support_library(
560 name = "sdcomp26094",
561 hdrs = ["sdcomp26094.h"],
562 deps = [
563 "//libc:__support_cpp_array",
564 "//libc:__support_macros_config",
565 ],
566 )
567
568 math_test(
569 name = "cosf",
570 deps = [
571 ":sdcomp26094",
572 "//libc:__support_cpp_array",
573 "//libc/utils/MPFRWrapper:mpfr_wrapper",
574 ],
575 )
576
577 math_test(
578 name = "sincosf",
579 deps = [
580 ":sdcomp26094",
581 "//libc:__support_cpp_array",
582 "//libc/utils/MPFRWrapper:mpfr_wrapper",
583 ],
584 )
585
586 math_test(
587 name = "sinf",
588 deps = [
589 ":sdcomp26094",
590 "//libc:__support_cpp_array",
591 "//libc/utils/MPFRWrapper:mpfr_wrapper",
592 ],
593 )
594
595 math_test(
596 name = "tanf",
597 deps = [
598 ":sdcomp26094",
599 "//libc:__support_cpp_array",
600 "//libc/utils/MPFRWrapper:mpfr_wrapper",
601 ],
602 )
603
604 math_test(
605 name = "expf",
606 deps = [
607 "//libc/utils/MPFRWrapper:mpfr_wrapper",
608 ],
609 )
610
611 math_test(
612 name = "exp2f",
613 deps = [
614 "//libc:__support_macros_properties_cpu_features",
615 "//libc/utils/MPFRWrapper:mpfr_wrapper",
616 ],
617 )
618
619 math_test(
620 name = "exp10f",
621 deps = [
622 "//libc/utils/MPFRWrapper:mpfr_wrapper",
623 ],
624 )
625
626 math_test(
627 name = "expm1f",
628 deps = [
629 "//libc/utils/MPFRWrapper:mpfr_wrapper",
630 ],
631 )
632
633 math_test(
634 name = "logf",
635 deps = [
636 "//libc/utils/MPFRWrapper:mpfr_wrapper",
637 ],
638 )
639
640 math_test(
641 name = "log2f",
642 deps = [
643 "//libc/utils/MPFRWrapper:mpfr_wrapper",
644 ],
645 )
646
647 math_test(
648 name = "log10f",
649 deps = [
650 "//libc/utils/MPFRWrapper:mpfr_wrapper",
651 ],
652 )
653
654 math_test(
655 name = "log1pf",
656 deps = [
657 "//libc/utils/MPFRWrapper:mpfr_wrapper",
658 ],
659 )
660
661 math_test(
662 name = "log",
663 deps = [
664 "//libc/utils/MPFRWrapper:mpfr_wrapper",
665 ],
666 )
667
668 math_test(
669 name = "log2",
670 deps = [
671 "//libc/utils/MPFRWrapper:mpfr_wrapper",
672 ],
673 )
674
675 math_test(
676 name = "log10",
677 deps = [
678 "//libc/utils/MPFRWrapper:mpfr_wrapper",
679 ],
680 )
681
682 math_test(
683 name = "log1p",
684 deps = [
685 "//libc/utils/MPFRWrapper:mpfr_wrapper",
686 ],
687 )
688
689 math_test(
690 name = "sinhf",
691 deps = [
692 "//libc:__support_cpp_array",
693 "//libc/utils/MPFRWrapper:mpfr_wrapper",
694 ],
695 )
696
697 math_test(
698 name = "coshf",
699 deps = [
700 "//libc:__support_cpp_array",
701 "//libc/utils/MPFRWrapper:mpfr_wrapper",
702 ],
703 )
704
705 math_test(
706 name = "cospif",
707 deps = [
708 ":sdcomp26094",
709 "//libc:__support_cpp_array",
710 "//libc/utils/MPFRWrapper:mpfr_wrapper",
711 ],
712 )
713
714 math_test(
715 name = "tanhf",
716 deps = [
717 "//libc/utils/MPFRWrapper:mpfr_wrapper",
718 ],
719 )
720
721 math_test(
722 name = "asinhf",
723 deps = [
724 "//libc/utils/MPFRWrapper:mpfr_wrapper",
725 ],
726 )
727
728 math_test(
729 name = "acoshf",
730 deps = [
731 "//libc/utils/MPFRWrapper:mpfr_wrapper",
732 ],
733 )
734
735 math_test(
736 name = "atanhf",
737 deps = [
738 "//libc/utils/MPFRWrapper:mpfr_wrapper",
739 ],
740 )
741
742 math_test(
743 name = "asinf",
744 deps = [
745 "//libc/utils/MPFRWrapper:mpfr_wrapper",
746 ],
747 )
748
749 math_test(
750 name = "acosf",
751 deps = [
752 "//libc/utils/MPFRWrapper:mpfr_wrapper",
753 ],
754 )
755
756 math_test(
757 name = "atanf",
758 deps = [
759 "//libc/utils/MPFRWrapper:mpfr_wrapper",
760 ],
761 )
762
763 math_test(
764 name = "erff",
765 deps = [
766 "//libc/utils/MPFRWrapper:mpfr_wrapper",
767 ],
768 )
769
770 math_test(
771 name = "exp",
772 deps = [
773 "//libc/utils/MPFRWrapper:mpfr_wrapper",
774 ],
775 )
776
777 math_test(
778 name = "exp2",
779 deps = [
780 "//libc/utils/MPFRWrapper:mpfr_wrapper",
781 ],
782 )
783
784 math_test(
785 name = "exp10",
786 deps = [
787 "//libc/utils/MPFRWrapper:mpfr_wrapper",
788 ],
789 )
790
791 math_test(
792 name = "powf",
793 deps = [
794 "//libc/utils/MPFRWrapper:mpfr_wrapper",
795 ],
796 )
797
798 math_test(
799 name = "fmod",
800 hdrs = ["FModTest.h"],
801 )
802
803 math_test(
804 name = "fmodf",
805 hdrs = ["FModTest.h"],
806 )
807
808 math_test(
809 name = "scalbn",
810 hdrs = [
811 "LdExpTest.h",
812 "ScalbnTest.h",
813 ],
814 deps = ["//libc:__support_cpp_limits"],
815 )
816
817 math_test(
818 name = "scalbnf",
819 hdrs = [
820 "LdExpTest.h",
821 "ScalbnTest.h",
822 ],
823 deps = ["//libc:__support_cpp_limits"],
824 )
825
826 math_test(
827 name = "scalbnl",
828 hdrs = [
829 "LdExpTest.h",
830 "ScalbnTest.h",
831 ],
832 deps = ["//libc:__support_cpp_limits"],
833 )