| 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 stdlib.h functions. |
| 6 |
|
| 7 |
load("//libc/test:libc_test_rules.bzl", "libc_test") |
| 8 |
|
| 9 |
package(default_visibility = ["//visibility:public"]) |
| 10 |
|
| 11 |
licenses(["notice"]) |
| 12 |
|
| 13 |
cc_library( |
| 14 |
name = "atoi_test_helper", |
| 15 |
hdrs = ["AtoiTest.h"], |
| 16 |
) |
| 17 |
|
| 18 |
libc_test( |
| 19 |
name = "atoi_test", |
| 20 |
srcs = ["atoi_test.cpp"], |
| 21 |
deps = [":atoi_test_helper"], |
| 22 |
libc_function_deps = [ |
| 23 |
"//libc:atoi", |
| 24 |
], |
| 25 |
) |
| 26 |
|
| 27 |
libc_test( |
| 28 |
name = "atol_test", |
| 29 |
srcs = ["atol_test.cpp"], |
| 30 |
deps = [":atoi_test_helper"], |
| 31 |
libc_function_deps = [ |
| 32 |
"//libc:atol", |
| 33 |
], |
| 34 |
) |
| 35 |
|
| 36 |
libc_test( |
| 37 |
name = "atoll_test", |
| 38 |
srcs = ["atoll_test.cpp"], |
| 39 |
deps = [":atoi_test_helper"], |
| 40 |
libc_function_deps = [ |
| 41 |
"//libc:atoll", |
| 42 |
], |
| 43 |
) |
| 44 |
|
| 45 |
libc_test( |
| 46 |
name = "bsearch_test", |
| 47 |
srcs = ["bsearch_test.cpp"], |
| 48 |
libc_function_deps = [ |
| 49 |
"//libc:bsearch", |
| 50 |
], |
| 51 |
) |
| 52 |
|
| 53 |
libc_test( |
| 54 |
name = "qsort_test", |
| 55 |
srcs = ["qsort_test.cpp"], |
| 56 |
libc_function_deps = [ |
| 57 |
"//libc:qsort", |
| 58 |
], |
| 59 |
) |
| 60 |
|
| 61 |
cc_library( |
| 62 |
name = "strtol_test_helper", |
| 63 |
hdrs = ["StrtolTest.h"], |
| 64 |
) |
| 65 |
|
| 66 |
libc_test( |
| 67 |
name = "strtol_test", |
| 68 |
srcs = ["strtol_test.cpp"], |
| 69 |
deps = [":strtol_test_helper"], |
| 70 |
libc_function_deps = [ |
| 71 |
"//libc:strtol", |
| 72 |
], |
| 73 |
) |
| 74 |
|
| 75 |
libc_test( |
| 76 |
name = "strtoll_test", |
| 77 |
srcs = ["strtoll_test.cpp"], |
| 78 |
deps = [":strtol_test_helper"], |
| 79 |
libc_function_deps = [ |
| 80 |
"//libc:strtoll", |
| 81 |
], |
| 82 |
) |
| 83 |
|
| 84 |
libc_test( |
| 85 |
name = "strtoul_test", |
| 86 |
srcs = ["strtoul_test.cpp"], |
| 87 |
deps = [":strtol_test_helper"], |
| 88 |
libc_function_deps = [ |
| 89 |
"//libc:strtoul", |
| 90 |
], |
| 91 |
) |
| 92 |
|
| 93 |
libc_test( |
| 94 |
name = "strtoull_test", |
| 95 |
srcs = ["strtoull_test.cpp"], |
| 96 |
deps = [":strtol_test_helper"], |
| 97 |
libc_function_deps = [ |
| 98 |
"//libc:strtoull", |
| 99 |
], |
| 100 |
) |