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 7load("//libc/test:libc_test_rules.bzl", "libc_test") 8 9package(default_visibility = ["//visibility:public"]) 10 11licenses(["notice"]) 12 13libc_test( 14 name = "exception_status_test", 15 srcs = [ 16 "exception_status_test.cpp", 17 "excepts.h", 18 ], 19 libc_function_deps = [ 20 "//libc:feclearexcept", 21 "//libc:feraiseexcept", 22 "//libc:fesetexcept", 23 "//libc:fetestexcept", 24 ], 25 deps = [ 26 "//libc:__support_fputil_fenv_impl", 27 "//libc:hdr_fenv_macros", 28 "//libc/test/UnitTest:fp_test_helpers", 29 ], 30) 31 32libc_test( 33 name = "rounding_mode_test", 34 srcs = [ 35 "excepts.h", 36 "rounding_mode_test.cpp", 37 ], 38 libc_function_deps = [ 39 "//libc:fegetround", 40 "//libc:fesetround", 41 ], 42 deps = [ 43 "//libc:hdr_fenv_macros", 44 "//libc/test/UnitTest:fp_test_helpers", 45 ], 46) 47 48libc_test( 49 name = "enabled_exceptions_test", 50 srcs = [ 51 "enabled_exceptions_test.cpp", 52 "excepts.h", 53 ], 54 libc_function_deps = [ 55 "//libc:feclearexcept", 56 "//libc:feraiseexcept", 57 "//libc:fetestexcept", 58 ], 59 tags = ["nosan"], 60 deps = [ 61 "//libc:__support_common", 62 "//libc:__support_fputil_fenv_impl", 63 "//libc:__support_macros_properties_architectures", 64 "//libc:hdr_fenv_macros", 65 "//libc/test/UnitTest:fp_test_helpers", 66 ], 67) 68 69libc_test( 70 name = "feholdexcept_test", 71 srcs = [ 72 "excepts.h", 73 "feholdexcept_test.cpp", 74 ], 75 libc_function_deps = [ 76 "//libc:feholdexcept", 77 ], 78 tags = ["nosan"], 79 deps = [ 80 "//libc:__support_common", 81 "//libc:__support_fputil_fenv_impl", 82 "//libc:__support_macros_properties_architectures", 83 "//libc:hdr_fenv_macros", 84 "//libc:types_fenv_t", 85 "//libc/test/UnitTest:fp_test_helpers", 86 ], 87) 88 89libc_test( 90 name = "exception_flags_test", 91 srcs = [ 92 "exception_flags_test.cpp", 93 "excepts.h", 94 ], 95 libc_function_deps = [ 96 "//libc:fegetexceptflag", 97 "//libc:fesetexceptflag", 98 "//libc:fetestexceptflag", 99 ], 100 deps = [ 101 "//libc:__support_fputil_fenv_impl", 102 "//libc:hdr_fenv_macros", 103 "//libc:types_fexcept_t", 104 "//libc/test/UnitTest:fp_test_helpers", 105 ], 106) 107 108libc_test( 109 name = "feclearexcept_test", 110 srcs = [ 111 "excepts.h", 112 "feclearexcept_test.cpp", 113 ], 114 libc_function_deps = [ 115 "//libc:feclearexcept", 116 ], 117 deps = [ 118 "//libc:__support_fputil_fenv_impl", 119 "//libc:hdr_fenv_macros", 120 "//libc/test/UnitTest:fp_test_helpers", 121 ], 122) 123 124libc_test( 125 name = "feenableexcept_test", 126 srcs = [ 127 "excepts.h", 128 "feenableexcept_test.cpp", 129 ], 130 libc_function_deps = [ 131 "//libc:fedisableexcept", 132 "//libc:feenableexcept", 133 "//libc:fegetexcept", 134 ], 135 deps = [ 136 "//libc:__support_common", 137 "//libc:__support_macros_properties_architectures", 138 "//libc:hdr_fenv_macros", 139 "//libc/test/UnitTest:fp_test_helpers", 140 ], 141) 142 143libc_test( 144 name = "feupdateenv_test", 145 srcs = [ 146 "excepts.h", 147 "feupdateenv_test.cpp", 148 ], 149 libc_function_deps = [ 150 "//libc:feupdateenv", 151 ], 152 deps = [ 153 "//libc:__support_fputil_fenv_impl", 154 "//libc:hdr_fenv_macros", 155 "//libc:types_fenv_t", 156 "//libc/test/UnitTest:fp_test_helpers", 157 ], 158) 159 160libc_test( 161 name = "getenv_and_setenv_test", 162 srcs = [ 163 "excepts.h", 164 "getenv_and_setenv_test.cpp", 165 ], 166 libc_function_deps = [ 167 "//libc:fegetenv", 168 "//libc:fegetround", 169 "//libc:fesetenv", 170 "//libc:fesetround", 171 ], 172 deps = [ 173 "//libc:__support_fputil_fenv_impl", 174 "//libc:__support_macros_properties_os", 175 "//libc:hdr_fenv_macros", 176 "//libc:types_fenv_t", 177 "//libc/test/UnitTest:fp_test_helpers", 178 ], 179) 180