xref: /aosp_15_r20/external/abseil-cpp/absl/base/BUILD.bazel (revision 9356374a3709195abf420251b3e825997ff56c0f)
1#
2# Copyright 2017 The Abseil Authors.
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8#      https://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15#
16
17load(
18    "//absl:copts/configure_copts.bzl",
19    "ABSL_DEFAULT_COPTS",
20    "ABSL_DEFAULT_LINKOPTS",
21    "ABSL_TEST_COPTS",
22)
23
24package(
25    default_visibility = ["//visibility:public"],
26    features = [
27        "header_modules",
28        "layering_check",
29        "parse_headers",
30    ],
31)
32
33licenses(["notice"])
34
35cc_library(
36    name = "atomic_hook",
37    hdrs = ["internal/atomic_hook.h"],
38    copts = ABSL_DEFAULT_COPTS,
39    linkopts = ABSL_DEFAULT_LINKOPTS,
40    visibility = [
41        "//absl:__subpackages__",
42    ],
43    deps = [
44        ":config",
45        ":core_headers",
46    ],
47)
48
49cc_library(
50    name = "errno_saver",
51    hdrs = ["internal/errno_saver.h"],
52    copts = ABSL_DEFAULT_COPTS,
53    linkopts = ABSL_DEFAULT_LINKOPTS,
54    visibility = [
55        "//absl:__subpackages__",
56    ],
57    deps = [":config"],
58)
59
60cc_library(
61    name = "log_severity",
62    srcs = ["log_severity.cc"],
63    hdrs = ["log_severity.h"],
64    copts = ABSL_DEFAULT_COPTS,
65    linkopts = ABSL_DEFAULT_LINKOPTS,
66    deps = [
67        ":config",
68        ":core_headers",
69    ],
70)
71
72cc_library(
73    name = "no_destructor",
74    hdrs = ["no_destructor.h"],
75    copts = ABSL_DEFAULT_COPTS,
76    linkopts = ABSL_DEFAULT_LINKOPTS,
77    deps = [
78        ":config",
79        ":nullability",
80    ],
81)
82
83cc_library(
84    name = "nullability",
85    srcs = ["internal/nullability_impl.h"],
86    hdrs = ["nullability.h"],
87    copts = ABSL_DEFAULT_COPTS,
88    linkopts = ABSL_DEFAULT_LINKOPTS,
89    deps = [
90        ":config",
91        ":core_headers",
92        "//absl/meta:type_traits",
93    ],
94)
95
96cc_library(
97    name = "raw_logging_internal",
98    srcs = ["internal/raw_logging.cc"],
99    hdrs = ["internal/raw_logging.h"],
100    copts = ABSL_DEFAULT_COPTS,
101    linkopts = ABSL_DEFAULT_LINKOPTS,
102    visibility = [
103        "//absl:__subpackages__",
104    ],
105    deps = [
106        ":atomic_hook",
107        ":config",
108        ":core_headers",
109        ":errno_saver",
110        ":log_severity",
111    ],
112)
113
114cc_library(
115    name = "spinlock_wait",
116    srcs = [
117        "internal/spinlock_akaros.inc",
118        "internal/spinlock_linux.inc",
119        "internal/spinlock_posix.inc",
120        "internal/spinlock_wait.cc",
121        "internal/spinlock_win32.inc",
122    ],
123    hdrs = ["internal/spinlock_wait.h"],
124    copts = ABSL_DEFAULT_COPTS,
125    linkopts = ABSL_DEFAULT_LINKOPTS,
126    visibility = [
127        "//absl/base:__pkg__",
128    ],
129    deps = [
130        ":base_internal",
131        ":core_headers",
132        ":errno_saver",
133    ],
134)
135
136cc_library(
137    name = "config",
138    hdrs = [
139        "config.h",
140        "options.h",
141        "policy_checks.h",
142    ],
143    copts = ABSL_DEFAULT_COPTS,
144    linkopts = ABSL_DEFAULT_LINKOPTS,
145)
146
147cc_library(
148    name = "cycleclock_internal",
149    hdrs = [
150        "internal/cycleclock_config.h",
151        "internal/unscaledcycleclock_config.h",
152    ],
153    copts = ABSL_DEFAULT_COPTS,
154    linkopts = ABSL_DEFAULT_LINKOPTS,
155    visibility = [
156        "//absl:__subpackages__",
157    ],
158    deps = [
159        ":base_internal",
160        ":config",
161    ],
162)
163
164cc_library(
165    name = "dynamic_annotations",
166    srcs = [
167        "internal/dynamic_annotations.h",
168    ],
169    hdrs = [
170        "dynamic_annotations.h",
171    ],
172    copts = ABSL_DEFAULT_COPTS,
173    linkopts = ABSL_DEFAULT_LINKOPTS,
174    deps = [
175        ":config",
176        ":core_headers",
177    ],
178)
179
180cc_library(
181    name = "core_headers",
182    hdrs = [
183        "attributes.h",
184        "const_init.h",
185        "macros.h",
186        "optimization.h",
187        "port.h",
188        "thread_annotations.h",
189    ],
190    copts = ABSL_DEFAULT_COPTS,
191    linkopts = ABSL_DEFAULT_LINKOPTS,
192    deps = [
193        ":config",
194    ],
195)
196
197cc_library(
198    name = "malloc_internal",
199    srcs = [
200        "internal/low_level_alloc.cc",
201    ],
202    hdrs = [
203        "internal/direct_mmap.h",
204        "internal/low_level_alloc.h",
205    ],
206    copts = ABSL_DEFAULT_COPTS + select({
207        "//conditions:default": [],
208    }),
209    linkopts = select({
210        "//absl:msvc_compiler": [],
211        "//absl:clang-cl_compiler": [],
212        "//absl:wasm": [],
213        "//conditions:default": ["-pthread"],
214    }) + ABSL_DEFAULT_LINKOPTS,
215    visibility = [
216        "//visibility:public",
217    ],
218    deps = [
219        ":base",
220        ":base_internal",
221        ":config",
222        ":core_headers",
223        ":dynamic_annotations",
224        ":raw_logging_internal",
225    ],
226)
227
228cc_library(
229    name = "base_internal",
230    hdrs = [
231        "internal/hide_ptr.h",
232        "internal/identity.h",
233        "internal/inline_variable.h",
234        "internal/invoke.h",
235        "internal/scheduling_mode.h",
236    ],
237    copts = ABSL_DEFAULT_COPTS,
238    linkopts = ABSL_DEFAULT_LINKOPTS,
239    visibility = [
240        "//absl:__subpackages__",
241    ],
242    deps = [
243        ":config",
244        "//absl/meta:type_traits",
245    ],
246)
247
248cc_library(
249    name = "base",
250    srcs = [
251        "internal/cycleclock.cc",
252        "internal/spinlock.cc",
253        "internal/sysinfo.cc",
254        "internal/thread_identity.cc",
255        "internal/unscaledcycleclock.cc",
256    ],
257    hdrs = [
258        "call_once.h",
259        "casts.h",
260        "internal/cycleclock.h",
261        "internal/low_level_scheduling.h",
262        "internal/per_thread_tls.h",
263        "internal/spinlock.h",
264        "internal/sysinfo.h",
265        "internal/thread_identity.h",
266        "internal/tsan_mutex_interface.h",
267        "internal/unscaledcycleclock.h",
268    ],
269    copts = ABSL_DEFAULT_COPTS,
270    linkopts = select({
271        "//absl:msvc_compiler": [
272            "-DEFAULTLIB:advapi32.lib",
273        ],
274        "//absl:clang-cl_compiler": [
275            "-DEFAULTLIB:advapi32.lib",
276        ],
277        "//absl:mingw_compiler": [
278            "-DEFAULTLIB:advapi32.lib",
279            "-ladvapi32",
280        ],
281        "//absl:wasm": [],
282        "//conditions:default": ["-pthread"],
283    }) + ABSL_DEFAULT_LINKOPTS,
284    deps = [
285        ":atomic_hook",
286        ":base_internal",
287        ":config",
288        ":core_headers",
289        ":cycleclock_internal",
290        ":dynamic_annotations",
291        ":log_severity",
292        ":nullability",
293        ":raw_logging_internal",
294        ":spinlock_wait",
295        "//absl/meta:type_traits",
296    ],
297)
298
299cc_library(
300    name = "atomic_hook_test_helper",
301    testonly = True,
302    srcs = ["internal/atomic_hook_test_helper.cc"],
303    hdrs = ["internal/atomic_hook_test_helper.h"],
304    copts = ABSL_DEFAULT_COPTS,
305    linkopts = ABSL_DEFAULT_LINKOPTS,
306    deps = [
307        ":atomic_hook",
308        ":core_headers",
309    ],
310)
311
312cc_test(
313    name = "atomic_hook_test",
314    size = "small",
315    srcs = ["internal/atomic_hook_test.cc"],
316    copts = ABSL_TEST_COPTS,
317    linkopts = ABSL_DEFAULT_LINKOPTS,
318    deps = [
319        ":atomic_hook",
320        ":atomic_hook_test_helper",
321        ":core_headers",
322        "@com_google_googletest//:gtest",
323        "@com_google_googletest//:gtest_main",
324    ],
325)
326
327cc_test(
328    name = "bit_cast_test",
329    size = "small",
330    srcs = [
331        "bit_cast_test.cc",
332    ],
333    copts = ABSL_TEST_COPTS,
334    linkopts = ABSL_DEFAULT_LINKOPTS,
335    deps = [
336        ":base",
337        ":core_headers",
338        "@com_google_googletest//:gtest",
339        "@com_google_googletest//:gtest_main",
340    ],
341)
342
343cc_test(
344    name = "c_header_test",
345    srcs = ["c_header_test.c"],
346    tags = [
347        "no_test_wasm",
348    ],
349    deps = [
350        ":config",
351        ":core_headers",
352    ],
353)
354
355cc_library(
356    name = "throw_delegate",
357    srcs = ["internal/throw_delegate.cc"],
358    hdrs = ["internal/throw_delegate.h"],
359    copts = ABSL_DEFAULT_COPTS,
360    linkopts = ABSL_DEFAULT_LINKOPTS,
361    visibility = [
362        "//absl:__subpackages__",
363    ],
364    deps = [
365        ":config",
366        ":raw_logging_internal",
367    ],
368)
369
370cc_test(
371    name = "throw_delegate_test",
372    srcs = ["throw_delegate_test.cc"],
373    copts = ABSL_TEST_COPTS,
374    linkopts = ABSL_DEFAULT_LINKOPTS,
375    deps = [
376        ":config",
377        ":throw_delegate",
378        "@com_google_googletest//:gtest",
379        "@com_google_googletest//:gtest_main",
380    ],
381)
382
383cc_test(
384    name = "errno_saver_test",
385    size = "small",
386    srcs = ["internal/errno_saver_test.cc"],
387    copts = ABSL_TEST_COPTS,
388    linkopts = ABSL_DEFAULT_LINKOPTS,
389    deps = [
390        ":errno_saver",
391        ":strerror",
392        "@com_google_googletest//:gtest",
393        "@com_google_googletest//:gtest_main",
394    ],
395)
396
397cc_library(
398    name = "exception_testing",
399    testonly = True,
400    hdrs = ["internal/exception_testing.h"],
401    copts = ABSL_TEST_COPTS,
402    linkopts = ABSL_DEFAULT_LINKOPTS,
403    visibility = [
404        "//absl:__subpackages__",
405    ],
406    deps = [
407        ":config",
408        "@com_google_googletest//:gtest",
409    ],
410)
411
412cc_library(
413    name = "pretty_function",
414    hdrs = ["internal/pretty_function.h"],
415    linkopts = ABSL_DEFAULT_LINKOPTS,
416    visibility = [
417        "//absl:__subpackages__",
418    ],
419)
420
421cc_library(
422    name = "exception_safety_testing",
423    testonly = True,
424    srcs = ["internal/exception_safety_testing.cc"],
425    hdrs = ["internal/exception_safety_testing.h"],
426    copts = ABSL_TEST_COPTS,
427    linkopts = ABSL_DEFAULT_LINKOPTS,
428    deps = [
429        ":config",
430        ":pretty_function",
431        "//absl/memory",
432        "//absl/meta:type_traits",
433        "//absl/strings",
434        "//absl/utility",
435        "@com_google_googletest//:gtest",
436    ],
437)
438
439cc_test(
440    name = "exception_safety_testing_test",
441    srcs = ["exception_safety_testing_test.cc"],
442    copts = ABSL_TEST_COPTS,
443    linkopts = ABSL_DEFAULT_LINKOPTS,
444    deps = [
445        ":exception_safety_testing",
446        "//absl/memory",
447        "@com_google_googletest//:gtest",
448        "@com_google_googletest//:gtest_main",
449    ],
450)
451
452cc_test(
453    name = "inline_variable_test",
454    size = "small",
455    srcs = [
456        "inline_variable_test.cc",
457        "inline_variable_test_a.cc",
458        "inline_variable_test_b.cc",
459        "internal/inline_variable_testing.h",
460    ],
461    copts = ABSL_TEST_COPTS,
462    linkopts = ABSL_DEFAULT_LINKOPTS,
463    deps = [
464        ":base_internal",
465        "@com_google_googletest//:gtest",
466        "@com_google_googletest//:gtest_main",
467    ],
468)
469
470cc_test(
471    name = "invoke_test",
472    size = "small",
473    srcs = ["invoke_test.cc"],
474    copts = ABSL_TEST_COPTS,
475    linkopts = ABSL_DEFAULT_LINKOPTS,
476    deps = [
477        ":base_internal",
478        "//absl/memory",
479        "//absl/strings",
480        "@com_google_googletest//:gtest",
481        "@com_google_googletest//:gtest_main",
482    ],
483)
484
485# Common test library made available for use in non-absl code that overrides
486# AbslInternalSpinLockDelay and AbslInternalSpinLockWake.
487cc_library(
488    name = "spinlock_test_common",
489    testonly = True,
490    srcs = ["spinlock_test_common.cc"],
491    copts = ABSL_TEST_COPTS,
492    linkopts = ABSL_DEFAULT_LINKOPTS,
493    deps = [
494        ":base",
495        ":base_internal",
496        ":config",
497        ":core_headers",
498        "//absl/synchronization",
499        "@com_google_googletest//:gtest",
500    ],
501    alwayslink = 1,
502)
503
504cc_test(
505    name = "spinlock_test",
506    size = "medium",
507    srcs = ["spinlock_test_common.cc"],
508    copts = ABSL_TEST_COPTS,
509    linkopts = ABSL_DEFAULT_LINKOPTS,
510    tags = [
511        "no_test_wasm",
512    ],
513    deps = [
514        ":base",
515        ":base_internal",
516        ":config",
517        ":core_headers",
518        "//absl/synchronization",
519        "@com_google_googletest//:gtest",
520        "@com_google_googletest//:gtest_main",
521    ],
522)
523
524cc_library(
525    name = "spinlock_benchmark_common",
526    testonly = True,
527    srcs = ["internal/spinlock_benchmark.cc"],
528    copts = ABSL_TEST_COPTS,
529    linkopts = ABSL_DEFAULT_LINKOPTS,
530    visibility = [
531        "//absl/base:__pkg__",
532    ],
533    deps = [
534        ":base",
535        ":base_internal",
536        ":no_destructor",
537        ":raw_logging_internal",
538        "//absl/synchronization",
539        "@com_github_google_benchmark//:benchmark_main",
540    ],
541    alwayslink = 1,
542)
543
544cc_binary(
545    name = "spinlock_benchmark",
546    testonly = True,
547    copts = ABSL_DEFAULT_COPTS,
548    linkopts = ABSL_DEFAULT_LINKOPTS,
549    tags = ["benchmark"],
550    visibility = ["//visibility:private"],
551    deps = [
552        ":spinlock_benchmark_common",
553    ],
554)
555
556cc_library(
557    name = "endian",
558    hdrs = [
559        "internal/endian.h",
560        "internal/unaligned_access.h",
561    ],
562    copts = ABSL_DEFAULT_COPTS,
563    linkopts = ABSL_DEFAULT_LINKOPTS,
564    deps = [
565        ":base",
566        ":config",
567        ":core_headers",
568        ":nullability",
569    ],
570)
571
572cc_test(
573    name = "endian_test",
574    srcs = ["internal/endian_test.cc"],
575    copts = ABSL_TEST_COPTS,
576    deps = [
577        ":config",
578        ":endian",
579        "@com_google_googletest//:gtest",
580        "@com_google_googletest//:gtest_main",
581    ],
582)
583
584cc_test(
585    name = "config_test",
586    srcs = ["config_test.cc"],
587    copts = ABSL_TEST_COPTS,
588    linkopts = ABSL_DEFAULT_LINKOPTS,
589    deps = [
590        ":config",
591        "//absl/synchronization:thread_pool",
592        "@com_google_googletest//:gtest",
593        "@com_google_googletest//:gtest_main",
594    ],
595)
596
597cc_test(
598    name = "call_once_test",
599    srcs = ["call_once_test.cc"],
600    copts = ABSL_TEST_COPTS,
601    linkopts = ABSL_DEFAULT_LINKOPTS,
602    deps = [
603        ":base",
604        ":core_headers",
605        "//absl/synchronization",
606        "@com_google_googletest//:gtest",
607        "@com_google_googletest//:gtest_main",
608    ],
609)
610
611cc_test(
612    name = "no_destructor_test",
613    srcs = ["no_destructor_test.cc"],
614    copts = ABSL_TEST_COPTS,
615    linkopts = ABSL_DEFAULT_LINKOPTS,
616    deps = [
617        ":config",
618        ":no_destructor",
619        ":raw_logging_internal",
620        "@com_google_googletest//:gtest",
621        "@com_google_googletest//:gtest_main",
622    ],
623)
624
625cc_binary(
626    name = "no_destructor_benchmark",
627    testonly = True,
628    srcs = ["no_destructor_benchmark.cc"],
629    copts = ABSL_TEST_COPTS,
630    linkopts = ABSL_DEFAULT_LINKOPTS,
631    tags = ["benchmark"],
632    visibility = ["//visibility:private"],
633    deps = [
634        ":no_destructor",
635        ":raw_logging_internal",
636        "@com_github_google_benchmark//:benchmark_main",
637    ],
638)
639
640cc_test(
641    name = "nullability_test",
642    srcs = ["nullability_test.cc"],
643    deps = [
644        ":core_headers",
645        ":nullability",
646        "@com_google_googletest//:gtest",
647        "@com_google_googletest//:gtest_main",
648    ],
649)
650
651cc_test(
652    name = "raw_logging_test",
653    srcs = ["raw_logging_test.cc"],
654    copts = ABSL_TEST_COPTS,
655    linkopts = ABSL_DEFAULT_LINKOPTS,
656    deps = [
657        ":raw_logging_internal",
658        "//absl/strings",
659        "@com_google_googletest//:gtest",
660        "@com_google_googletest//:gtest_main",
661    ],
662)
663
664cc_test(
665    name = "sysinfo_test",
666    size = "small",
667    srcs = ["internal/sysinfo_test.cc"],
668    copts = ABSL_TEST_COPTS,
669    linkopts = ABSL_DEFAULT_LINKOPTS,
670    deps = [
671        ":base",
672        "//absl/synchronization",
673        "@com_google_googletest//:gtest",
674        "@com_google_googletest//:gtest_main",
675    ],
676)
677
678cc_test(
679    name = "low_level_alloc_test",
680    size = "medium",
681    srcs = ["internal/low_level_alloc_test.cc"],
682    copts = ABSL_TEST_COPTS,
683    linkopts = ABSL_DEFAULT_LINKOPTS,
684    tags = [
685        "no_test_ios_x86_64",
686        "no_test_wasm",
687    ],
688    deps = [
689        ":malloc_internal",
690        "//absl/container:node_hash_map",
691    ],
692)
693
694cc_test(
695    name = "thread_identity_test",
696    size = "small",
697    srcs = ["internal/thread_identity_test.cc"],
698    copts = ABSL_TEST_COPTS,
699    linkopts = ABSL_DEFAULT_LINKOPTS,
700    tags = [
701        "no_test_wasm",
702    ],
703    deps = [
704        ":base",
705        ":core_headers",
706        "//absl/synchronization",
707        "@com_google_googletest//:gtest",
708        "@com_google_googletest//:gtest_main",
709    ],
710)
711
712cc_test(
713    name = "thread_identity_benchmark",
714    srcs = ["internal/thread_identity_benchmark.cc"],
715    copts = ABSL_TEST_COPTS,
716    linkopts = ABSL_DEFAULT_LINKOPTS,
717    tags = ["benchmark"],
718    visibility = ["//visibility:private"],
719    deps = [
720        ":base",
721        "//absl/synchronization",
722        "@com_github_google_benchmark//:benchmark_main",
723        "@com_google_googletest//:gtest",
724    ],
725)
726
727cc_library(
728    name = "scoped_set_env",
729    testonly = True,
730    srcs = ["internal/scoped_set_env.cc"],
731    hdrs = ["internal/scoped_set_env.h"],
732    linkopts = ABSL_DEFAULT_LINKOPTS,
733    visibility = [
734        "//absl:__subpackages__",
735    ],
736    deps = [
737        ":config",
738        ":raw_logging_internal",
739    ],
740)
741
742cc_test(
743    name = "scoped_set_env_test",
744    size = "small",
745    srcs = ["internal/scoped_set_env_test.cc"],
746    copts = ABSL_TEST_COPTS,
747    linkopts = ABSL_DEFAULT_LINKOPTS,
748    deps = [
749        ":scoped_set_env",
750        "@com_google_googletest//:gtest",
751        "@com_google_googletest//:gtest_main",
752    ],
753)
754
755cc_test(
756    name = "log_severity_test",
757    size = "small",
758    srcs = ["log_severity_test.cc"],
759    copts = ABSL_TEST_COPTS,
760    linkopts = ABSL_DEFAULT_LINKOPTS,
761    deps = [
762        ":log_severity",
763        "//absl/flags:flag_internal",
764        "//absl/flags:marshalling",
765        "//absl/strings",
766        "@com_google_googletest//:gtest",
767        "@com_google_googletest//:gtest_main",
768    ],
769)
770
771cc_library(
772    name = "strerror",
773    srcs = ["internal/strerror.cc"],
774    hdrs = ["internal/strerror.h"],
775    copts = ABSL_DEFAULT_COPTS,
776    linkopts = ABSL_DEFAULT_LINKOPTS,
777    visibility = [
778        "//absl:__subpackages__",
779    ],
780    deps = [
781        ":config",
782        ":core_headers",
783        ":errno_saver",
784    ],
785)
786
787cc_test(
788    name = "strerror_test",
789    size = "small",
790    srcs = ["internal/strerror_test.cc"],
791    copts = ABSL_TEST_COPTS,
792    linkopts = ABSL_DEFAULT_LINKOPTS,
793    deps = [
794        ":strerror",
795        "//absl/strings",
796        "@com_google_googletest//:gtest",
797        "@com_google_googletest//:gtest_main",
798    ],
799)
800
801cc_binary(
802    name = "strerror_benchmark",
803    testonly = True,
804    srcs = ["internal/strerror_benchmark.cc"],
805    copts = ABSL_TEST_COPTS,
806    linkopts = ABSL_DEFAULT_LINKOPTS,
807    tags = ["benchmark"],
808    visibility = ["//visibility:private"],
809    deps = [
810        ":strerror",
811        "@com_github_google_benchmark//:benchmark_main",
812    ],
813)
814
815cc_library(
816    name = "fast_type_id",
817    hdrs = ["internal/fast_type_id.h"],
818    copts = ABSL_DEFAULT_COPTS,
819    linkopts = ABSL_DEFAULT_LINKOPTS,
820    visibility = [
821        "//absl:__subpackages__",
822    ],
823    deps = [
824        ":config",
825    ],
826)
827
828cc_test(
829    name = "fast_type_id_test",
830    size = "small",
831    srcs = ["internal/fast_type_id_test.cc"],
832    copts = ABSL_TEST_COPTS,
833    linkopts = ABSL_DEFAULT_LINKOPTS,
834    deps = [
835        ":fast_type_id",
836        "@com_google_googletest//:gtest",
837        "@com_google_googletest//:gtest_main",
838    ],
839)
840
841cc_library(
842    name = "prefetch",
843    hdrs = [
844        "prefetch.h",
845    ],
846    copts = ABSL_DEFAULT_COPTS,
847    linkopts = ABSL_DEFAULT_LINKOPTS,
848    deps = [
849        ":config",
850        ":core_headers",
851    ],
852)
853
854cc_test(
855    name = "prefetch_test",
856    size = "small",
857    srcs = [
858        "prefetch_test.cc",
859    ],
860    copts = ABSL_TEST_COPTS,
861    linkopts = ABSL_DEFAULT_LINKOPTS,
862    deps = [
863        ":prefetch",
864        "@com_google_googletest//:gtest",
865        "@com_google_googletest//:gtest_main",
866    ],
867)
868
869cc_library(
870    name = "poison",
871    srcs = [
872        "internal/poison.cc",
873    ],
874    hdrs = ["internal/poison.h"],
875    copts = ABSL_DEFAULT_COPTS,
876    linkopts = ABSL_DEFAULT_LINKOPTS,
877    visibility = [
878        "//absl:__subpackages__",
879    ],
880    deps = [
881        ":config",
882        ":core_headers",
883        ":malloc_internal",
884    ],
885)
886
887cc_test(
888    name = "poison_test",
889    size = "small",
890    timeout = "short",
891    srcs = [
892        "internal/poison_test.cc",
893    ],
894    copts = ABSL_TEST_COPTS,
895    linkopts = ABSL_DEFAULT_LINKOPTS,
896    deps = [
897        ":config",
898        ":poison",
899        "@com_google_googletest//:gtest",
900        "@com_google_googletest//:gtest_main",
901    ],
902)
903
904cc_test(
905    name = "unique_small_name_test",
906    size = "small",
907    srcs = ["internal/unique_small_name_test.cc"],
908    copts = ABSL_TEST_COPTS,
909    linkopts = ABSL_DEFAULT_LINKOPTS,
910    linkstatic = 1,
911    deps = [
912        ":core_headers",
913        "//absl/strings",
914        "@com_google_googletest//:gtest",
915        "@com_google_googletest//:gtest_main",
916    ],
917)
918
919cc_test(
920    name = "optimization_test",
921    size = "small",
922    srcs = ["optimization_test.cc"],
923    copts = ABSL_TEST_COPTS,
924    linkopts = ABSL_DEFAULT_LINKOPTS,
925    deps = [
926        ":core_headers",
927        "//absl/types:optional",
928        "@com_google_googletest//:gtest",
929        "@com_google_googletest//:gtest_main",
930    ],
931)
932