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 hdrs = [ 167 "dynamic_annotations.h", 168 ], 169 copts = ABSL_DEFAULT_COPTS, 170 linkopts = ABSL_DEFAULT_LINKOPTS, 171 deps = [ 172 ":config", 173 ":core_headers", 174 ], 175) 176 177cc_library( 178 name = "core_headers", 179 hdrs = [ 180 "attributes.h", 181 "const_init.h", 182 "macros.h", 183 "optimization.h", 184 "port.h", 185 "thread_annotations.h", 186 ], 187 copts = ABSL_DEFAULT_COPTS, 188 linkopts = ABSL_DEFAULT_LINKOPTS, 189 deps = [ 190 ":config", 191 ], 192) 193 194cc_library( 195 name = "malloc_internal", 196 srcs = [ 197 "internal/low_level_alloc.cc", 198 ], 199 hdrs = [ 200 "internal/direct_mmap.h", 201 "internal/low_level_alloc.h", 202 ], 203 copts = ABSL_DEFAULT_COPTS + select({ 204 "//conditions:default": [], 205 }), 206 linkopts = select({ 207 "//absl:msvc_compiler": [], 208 "//absl:clang-cl_compiler": [], 209 "//absl:wasm": [], 210 "//conditions:default": ["-pthread"], 211 }) + ABSL_DEFAULT_LINKOPTS, 212 visibility = [ 213 "//visibility:public", 214 ], 215 deps = [ 216 ":base", 217 ":base_internal", 218 ":config", 219 ":core_headers", 220 ":dynamic_annotations", 221 ":raw_logging_internal", 222 ], 223) 224 225cc_library( 226 name = "base_internal", 227 hdrs = [ 228 "internal/hide_ptr.h", 229 "internal/identity.h", 230 "internal/inline_variable.h", 231 "internal/invoke.h", 232 "internal/scheduling_mode.h", 233 ], 234 copts = ABSL_DEFAULT_COPTS, 235 linkopts = ABSL_DEFAULT_LINKOPTS, 236 visibility = [ 237 "//absl:__subpackages__", 238 ], 239 deps = [ 240 ":config", 241 "//absl/meta:type_traits", 242 ], 243) 244 245cc_library( 246 name = "base", 247 srcs = [ 248 "internal/cycleclock.cc", 249 "internal/spinlock.cc", 250 "internal/sysinfo.cc", 251 "internal/thread_identity.cc", 252 "internal/unscaledcycleclock.cc", 253 ], 254 hdrs = [ 255 "call_once.h", 256 "casts.h", 257 "internal/cycleclock.h", 258 "internal/low_level_scheduling.h", 259 "internal/per_thread_tls.h", 260 "internal/spinlock.h", 261 "internal/sysinfo.h", 262 "internal/thread_identity.h", 263 "internal/tsan_mutex_interface.h", 264 "internal/unscaledcycleclock.h", 265 ], 266 copts = ABSL_DEFAULT_COPTS, 267 linkopts = select({ 268 "//absl:msvc_compiler": [ 269 "-DEFAULTLIB:advapi32.lib", 270 ], 271 "//absl:clang-cl_compiler": [ 272 "-DEFAULTLIB:advapi32.lib", 273 ], 274 "//absl:mingw_compiler": [ 275 "-DEFAULTLIB:advapi32.lib", 276 "-ladvapi32", 277 ], 278 "//absl:wasm": [], 279 "//conditions:default": ["-pthread"], 280 }) + ABSL_DEFAULT_LINKOPTS, 281 deps = [ 282 ":atomic_hook", 283 ":base_internal", 284 ":config", 285 ":core_headers", 286 ":cycleclock_internal", 287 ":dynamic_annotations", 288 ":log_severity", 289 ":nullability", 290 ":raw_logging_internal", 291 ":spinlock_wait", 292 "//absl/meta:type_traits", 293 ], 294) 295 296cc_library( 297 name = "atomic_hook_test_helper", 298 testonly = True, 299 srcs = ["internal/atomic_hook_test_helper.cc"], 300 hdrs = ["internal/atomic_hook_test_helper.h"], 301 copts = ABSL_DEFAULT_COPTS, 302 linkopts = ABSL_DEFAULT_LINKOPTS, 303 deps = [ 304 ":atomic_hook", 305 ":core_headers", 306 ], 307) 308 309cc_test( 310 name = "atomic_hook_test", 311 size = "small", 312 srcs = ["internal/atomic_hook_test.cc"], 313 copts = ABSL_TEST_COPTS, 314 linkopts = ABSL_DEFAULT_LINKOPTS, 315 deps = [ 316 ":atomic_hook", 317 ":atomic_hook_test_helper", 318 ":core_headers", 319 "@com_google_googletest//:gtest", 320 "@com_google_googletest//:gtest_main", 321 ], 322) 323 324cc_test( 325 name = "bit_cast_test", 326 size = "small", 327 srcs = [ 328 "bit_cast_test.cc", 329 ], 330 copts = ABSL_TEST_COPTS, 331 linkopts = ABSL_DEFAULT_LINKOPTS, 332 deps = [ 333 ":base", 334 ":core_headers", 335 "@com_google_googletest//:gtest", 336 "@com_google_googletest//:gtest_main", 337 ], 338) 339 340cc_test( 341 name = "c_header_test", 342 srcs = ["c_header_test.c"], 343 tags = [ 344 "no_test_wasm", 345 ], 346 deps = [ 347 ":config", 348 ":core_headers", 349 ], 350) 351 352cc_library( 353 name = "throw_delegate", 354 srcs = ["internal/throw_delegate.cc"], 355 hdrs = ["internal/throw_delegate.h"], 356 copts = ABSL_DEFAULT_COPTS, 357 linkopts = ABSL_DEFAULT_LINKOPTS, 358 visibility = [ 359 "//absl:__subpackages__", 360 ], 361 deps = [ 362 ":config", 363 ":raw_logging_internal", 364 ], 365) 366 367cc_test( 368 name = "throw_delegate_test", 369 srcs = ["throw_delegate_test.cc"], 370 copts = ABSL_TEST_COPTS, 371 linkopts = ABSL_DEFAULT_LINKOPTS, 372 deps = [ 373 ":config", 374 ":throw_delegate", 375 "@com_google_googletest//:gtest", 376 "@com_google_googletest//:gtest_main", 377 ], 378) 379 380cc_test( 381 name = "errno_saver_test", 382 size = "small", 383 srcs = ["internal/errno_saver_test.cc"], 384 copts = ABSL_TEST_COPTS, 385 linkopts = ABSL_DEFAULT_LINKOPTS, 386 deps = [ 387 ":errno_saver", 388 ":strerror", 389 "@com_google_googletest//:gtest", 390 "@com_google_googletest//:gtest_main", 391 ], 392) 393 394cc_library( 395 name = "exception_testing", 396 testonly = True, 397 hdrs = ["internal/exception_testing.h"], 398 copts = ABSL_TEST_COPTS, 399 linkopts = ABSL_DEFAULT_LINKOPTS, 400 visibility = [ 401 "//absl:__subpackages__", 402 ], 403 deps = [ 404 ":config", 405 "@com_google_googletest//:gtest", 406 ], 407) 408 409cc_library( 410 name = "pretty_function", 411 hdrs = ["internal/pretty_function.h"], 412 linkopts = ABSL_DEFAULT_LINKOPTS, 413 visibility = [ 414 "//absl:__subpackages__", 415 ], 416) 417 418cc_library( 419 name = "exception_safety_testing", 420 testonly = True, 421 srcs = ["internal/exception_safety_testing.cc"], 422 hdrs = ["internal/exception_safety_testing.h"], 423 copts = ABSL_TEST_COPTS, 424 linkopts = ABSL_DEFAULT_LINKOPTS, 425 deps = [ 426 ":config", 427 ":pretty_function", 428 "//absl/memory", 429 "//absl/meta:type_traits", 430 "//absl/strings", 431 "//absl/utility", 432 "@com_google_googletest//:gtest", 433 ], 434) 435 436cc_test( 437 name = "exception_safety_testing_test", 438 srcs = ["exception_safety_testing_test.cc"], 439 copts = ABSL_TEST_COPTS, 440 linkopts = ABSL_DEFAULT_LINKOPTS, 441 deps = [ 442 ":exception_safety_testing", 443 "//absl/memory", 444 "@com_google_googletest//:gtest", 445 "@com_google_googletest//:gtest_main", 446 ], 447) 448 449cc_test( 450 name = "inline_variable_test", 451 size = "small", 452 srcs = [ 453 "inline_variable_test.cc", 454 "inline_variable_test_a.cc", 455 "inline_variable_test_b.cc", 456 "internal/inline_variable_testing.h", 457 ], 458 copts = ABSL_TEST_COPTS, 459 linkopts = ABSL_DEFAULT_LINKOPTS, 460 deps = [ 461 ":base_internal", 462 "@com_google_googletest//:gtest", 463 "@com_google_googletest//:gtest_main", 464 ], 465) 466 467cc_test( 468 name = "invoke_test", 469 size = "small", 470 srcs = ["invoke_test.cc"], 471 copts = ABSL_TEST_COPTS, 472 linkopts = ABSL_DEFAULT_LINKOPTS, 473 deps = [ 474 ":base_internal", 475 "//absl/memory", 476 "//absl/strings", 477 "@com_google_googletest//:gtest", 478 "@com_google_googletest//:gtest_main", 479 ], 480) 481 482# Common test library made available for use in non-absl code that overrides 483# AbslInternalSpinLockDelay and AbslInternalSpinLockWake. 484cc_library( 485 name = "spinlock_test_common", 486 testonly = True, 487 srcs = ["spinlock_test_common.cc"], 488 copts = ABSL_TEST_COPTS, 489 linkopts = ABSL_DEFAULT_LINKOPTS, 490 deps = [ 491 ":base", 492 ":base_internal", 493 ":config", 494 ":core_headers", 495 "//absl/synchronization", 496 "@com_google_googletest//:gtest", 497 ], 498 alwayslink = 1, 499) 500 501cc_test( 502 name = "spinlock_test", 503 size = "medium", 504 srcs = ["spinlock_test_common.cc"], 505 copts = ABSL_TEST_COPTS, 506 linkopts = ABSL_DEFAULT_LINKOPTS, 507 tags = [ 508 "no_test_wasm", 509 ], 510 deps = [ 511 ":base", 512 ":base_internal", 513 ":config", 514 ":core_headers", 515 "//absl/synchronization", 516 "@com_google_googletest//:gtest", 517 "@com_google_googletest//:gtest_main", 518 ], 519) 520 521cc_library( 522 name = "spinlock_benchmark_common", 523 testonly = True, 524 srcs = ["internal/spinlock_benchmark.cc"], 525 copts = ABSL_TEST_COPTS, 526 linkopts = ABSL_DEFAULT_LINKOPTS, 527 visibility = [ 528 "//absl/base:__pkg__", 529 ], 530 deps = [ 531 ":base", 532 ":base_internal", 533 ":no_destructor", 534 ":raw_logging_internal", 535 "//absl/synchronization", 536 "@com_github_google_benchmark//:benchmark_main", 537 ], 538 alwayslink = 1, 539) 540 541cc_binary( 542 name = "spinlock_benchmark", 543 testonly = True, 544 copts = ABSL_DEFAULT_COPTS, 545 linkopts = ABSL_DEFAULT_LINKOPTS, 546 tags = ["benchmark"], 547 visibility = ["//visibility:private"], 548 deps = [ 549 ":spinlock_benchmark_common", 550 ], 551) 552 553cc_library( 554 name = "endian", 555 hdrs = [ 556 "internal/endian.h", 557 "internal/unaligned_access.h", 558 ], 559 copts = ABSL_DEFAULT_COPTS, 560 linkopts = ABSL_DEFAULT_LINKOPTS, 561 deps = [ 562 ":base", 563 ":config", 564 ":core_headers", 565 ":nullability", 566 ], 567) 568 569cc_test( 570 name = "endian_test", 571 srcs = ["internal/endian_test.cc"], 572 copts = ABSL_TEST_COPTS, 573 deps = [ 574 ":config", 575 ":endian", 576 "@com_google_googletest//:gtest", 577 "@com_google_googletest//:gtest_main", 578 ], 579) 580 581cc_test( 582 name = "config_test", 583 srcs = ["config_test.cc"], 584 copts = ABSL_TEST_COPTS, 585 linkopts = ABSL_DEFAULT_LINKOPTS, 586 deps = [ 587 ":config", 588 "//absl/synchronization:thread_pool", 589 "@com_google_googletest//:gtest", 590 "@com_google_googletest//:gtest_main", 591 ], 592) 593 594cc_test( 595 name = "call_once_test", 596 srcs = ["call_once_test.cc"], 597 copts = ABSL_TEST_COPTS, 598 linkopts = ABSL_DEFAULT_LINKOPTS, 599 deps = [ 600 ":base", 601 ":core_headers", 602 "//absl/synchronization", 603 "@com_google_googletest//:gtest", 604 "@com_google_googletest//:gtest_main", 605 ], 606) 607 608cc_test( 609 name = "no_destructor_test", 610 srcs = ["no_destructor_test.cc"], 611 copts = ABSL_TEST_COPTS, 612 linkopts = ABSL_DEFAULT_LINKOPTS, 613 deps = [ 614 ":config", 615 ":no_destructor", 616 ":raw_logging_internal", 617 "@com_google_googletest//:gtest", 618 "@com_google_googletest//:gtest_main", 619 ], 620) 621 622cc_binary( 623 name = "no_destructor_benchmark", 624 testonly = True, 625 srcs = ["no_destructor_benchmark.cc"], 626 copts = ABSL_TEST_COPTS, 627 linkopts = ABSL_DEFAULT_LINKOPTS, 628 tags = ["benchmark"], 629 visibility = ["//visibility:private"], 630 deps = [ 631 ":no_destructor", 632 ":raw_logging_internal", 633 "@com_github_google_benchmark//:benchmark_main", 634 ], 635) 636 637cc_test( 638 name = "nullability_test", 639 srcs = ["nullability_test.cc"], 640 deps = [ 641 ":core_headers", 642 ":nullability", 643 "@com_google_googletest//:gtest", 644 "@com_google_googletest//:gtest_main", 645 ], 646) 647 648cc_test( 649 name = "nullability_default_nonnull_test", 650 srcs = ["nullability_default_nonnull_test.cc"], 651 deps = [ 652 ":nullability", 653 "@com_google_googletest//:gtest", 654 "@com_google_googletest//:gtest_main", 655 ], 656) 657 658cc_test( 659 name = "raw_logging_test", 660 srcs = ["raw_logging_test.cc"], 661 copts = ABSL_TEST_COPTS, 662 linkopts = ABSL_DEFAULT_LINKOPTS, 663 deps = [ 664 ":raw_logging_internal", 665 "//absl/strings", 666 "@com_google_googletest//:gtest", 667 "@com_google_googletest//:gtest_main", 668 ], 669) 670 671cc_test( 672 name = "sysinfo_test", 673 size = "small", 674 srcs = ["internal/sysinfo_test.cc"], 675 copts = ABSL_TEST_COPTS, 676 linkopts = ABSL_DEFAULT_LINKOPTS, 677 deps = [ 678 ":base", 679 "//absl/synchronization", 680 "@com_google_googletest//:gtest", 681 "@com_google_googletest//:gtest_main", 682 ], 683) 684 685cc_test( 686 name = "low_level_alloc_test", 687 size = "medium", 688 srcs = ["internal/low_level_alloc_test.cc"], 689 copts = ABSL_TEST_COPTS, 690 linkopts = ABSL_DEFAULT_LINKOPTS, 691 tags = [ 692 "no_test_ios_x86_64", 693 "no_test_wasm", 694 ], 695 deps = [ 696 ":malloc_internal", 697 "//absl/container:node_hash_map", 698 ], 699) 700 701cc_test( 702 name = "thread_identity_test", 703 size = "small", 704 srcs = ["internal/thread_identity_test.cc"], 705 copts = ABSL_TEST_COPTS, 706 linkopts = ABSL_DEFAULT_LINKOPTS, 707 tags = [ 708 "no_test_wasm", 709 ], 710 deps = [ 711 ":base", 712 ":core_headers", 713 "//absl/synchronization", 714 "@com_google_googletest//:gtest", 715 "@com_google_googletest//:gtest_main", 716 ], 717) 718 719cc_test( 720 name = "thread_identity_benchmark", 721 srcs = ["internal/thread_identity_benchmark.cc"], 722 copts = ABSL_TEST_COPTS, 723 linkopts = ABSL_DEFAULT_LINKOPTS, 724 tags = ["benchmark"], 725 visibility = ["//visibility:private"], 726 deps = [ 727 ":base", 728 "//absl/synchronization", 729 "@com_github_google_benchmark//:benchmark_main", 730 "@com_google_googletest//:gtest", 731 ], 732) 733 734cc_library( 735 name = "scoped_set_env", 736 testonly = True, 737 srcs = ["internal/scoped_set_env.cc"], 738 hdrs = ["internal/scoped_set_env.h"], 739 linkopts = ABSL_DEFAULT_LINKOPTS, 740 visibility = [ 741 "//absl:__subpackages__", 742 ], 743 deps = [ 744 ":config", 745 ":raw_logging_internal", 746 ], 747) 748 749cc_test( 750 name = "scoped_set_env_test", 751 size = "small", 752 srcs = ["internal/scoped_set_env_test.cc"], 753 copts = ABSL_TEST_COPTS, 754 linkopts = ABSL_DEFAULT_LINKOPTS, 755 deps = [ 756 ":scoped_set_env", 757 "@com_google_googletest//:gtest", 758 "@com_google_googletest//:gtest_main", 759 ], 760) 761 762cc_test( 763 name = "log_severity_test", 764 size = "small", 765 srcs = ["log_severity_test.cc"], 766 copts = ABSL_TEST_COPTS, 767 linkopts = ABSL_DEFAULT_LINKOPTS, 768 deps = [ 769 ":log_severity", 770 "//absl/flags:flag_internal", 771 "//absl/flags:marshalling", 772 "//absl/strings", 773 "@com_google_googletest//:gtest", 774 "@com_google_googletest//:gtest_main", 775 ], 776) 777 778cc_library( 779 name = "strerror", 780 srcs = ["internal/strerror.cc"], 781 hdrs = ["internal/strerror.h"], 782 copts = ABSL_DEFAULT_COPTS, 783 linkopts = ABSL_DEFAULT_LINKOPTS, 784 visibility = [ 785 "//absl:__subpackages__", 786 ], 787 deps = [ 788 ":config", 789 ":core_headers", 790 ":errno_saver", 791 ], 792) 793 794cc_test( 795 name = "strerror_test", 796 size = "small", 797 srcs = ["internal/strerror_test.cc"], 798 copts = ABSL_TEST_COPTS, 799 linkopts = ABSL_DEFAULT_LINKOPTS, 800 deps = [ 801 ":strerror", 802 "//absl/strings", 803 "@com_google_googletest//:gtest", 804 "@com_google_googletest//:gtest_main", 805 ], 806) 807 808cc_binary( 809 name = "strerror_benchmark", 810 testonly = True, 811 srcs = ["internal/strerror_benchmark.cc"], 812 copts = ABSL_TEST_COPTS, 813 linkopts = ABSL_DEFAULT_LINKOPTS, 814 tags = ["benchmark"], 815 visibility = ["//visibility:private"], 816 deps = [ 817 ":strerror", 818 "@com_github_google_benchmark//:benchmark_main", 819 ], 820) 821 822cc_library( 823 name = "fast_type_id", 824 hdrs = ["internal/fast_type_id.h"], 825 copts = ABSL_DEFAULT_COPTS, 826 linkopts = ABSL_DEFAULT_LINKOPTS, 827 visibility = [ 828 "//absl:__subpackages__", 829 ], 830 deps = [ 831 ":config", 832 ], 833) 834 835cc_test( 836 name = "fast_type_id_test", 837 size = "small", 838 srcs = ["internal/fast_type_id_test.cc"], 839 copts = ABSL_TEST_COPTS, 840 linkopts = ABSL_DEFAULT_LINKOPTS, 841 deps = [ 842 ":fast_type_id", 843 "@com_google_googletest//:gtest", 844 "@com_google_googletest//:gtest_main", 845 ], 846) 847 848cc_library( 849 name = "prefetch", 850 hdrs = [ 851 "prefetch.h", 852 ], 853 copts = ABSL_DEFAULT_COPTS, 854 linkopts = ABSL_DEFAULT_LINKOPTS, 855 deps = [ 856 ":config", 857 ":core_headers", 858 ], 859) 860 861cc_test( 862 name = "prefetch_test", 863 size = "small", 864 srcs = [ 865 "prefetch_test.cc", 866 ], 867 copts = ABSL_TEST_COPTS, 868 linkopts = ABSL_DEFAULT_LINKOPTS, 869 deps = [ 870 ":prefetch", 871 "@com_google_googletest//:gtest", 872 "@com_google_googletest//:gtest_main", 873 ], 874) 875 876cc_library( 877 name = "poison", 878 srcs = [ 879 "internal/poison.cc", 880 ], 881 hdrs = ["internal/poison.h"], 882 copts = ABSL_DEFAULT_COPTS, 883 linkopts = ABSL_DEFAULT_LINKOPTS, 884 visibility = [ 885 "//absl:__subpackages__", 886 ], 887 deps = [ 888 ":config", 889 ":core_headers", 890 ":malloc_internal", 891 ], 892) 893 894cc_test( 895 name = "poison_test", 896 size = "small", 897 timeout = "short", 898 srcs = [ 899 "internal/poison_test.cc", 900 ], 901 copts = ABSL_TEST_COPTS, 902 linkopts = ABSL_DEFAULT_LINKOPTS, 903 deps = [ 904 ":config", 905 ":poison", 906 "@com_google_googletest//:gtest", 907 "@com_google_googletest//:gtest_main", 908 ], 909) 910 911cc_test( 912 name = "unique_small_name_test", 913 size = "small", 914 srcs = ["internal/unique_small_name_test.cc"], 915 copts = ABSL_TEST_COPTS, 916 linkopts = ABSL_DEFAULT_LINKOPTS, 917 linkstatic = 1, 918 deps = [ 919 ":core_headers", 920 "//absl/strings", 921 "@com_google_googletest//:gtest", 922 "@com_google_googletest//:gtest_main", 923 ], 924) 925 926cc_test( 927 name = "optimization_test", 928 size = "small", 929 srcs = ["optimization_test.cc"], 930 copts = ABSL_TEST_COPTS, 931 linkopts = ABSL_DEFAULT_LINKOPTS, 932 deps = [ 933 ":core_headers", 934 "//absl/types:optional", 935 "@com_google_googletest//:gtest", 936 "@com_google_googletest//:gtest_main", 937 ], 938) 939 940cc_library( 941 name = "tracing_internal", 942 srcs = ["internal/tracing.cc"], 943 hdrs = ["internal/tracing.h"], 944 copts = ABSL_DEFAULT_COPTS, 945 linkopts = ABSL_DEFAULT_LINKOPTS, 946 visibility = [ 947 "//absl:__subpackages__", 948 ], 949 deps = [ 950 "//absl/base:config", 951 "//absl/base:core_headers", 952 ], 953) 954 955cc_test( 956 name = "tracing_internal_weak_test", 957 srcs = ["internal/tracing_weak_test.cc"], 958 copts = ABSL_TEST_COPTS, 959 linkopts = ABSL_DEFAULT_LINKOPTS, 960 deps = [ 961 ":tracing_internal", 962 "@com_google_googletest//:gtest", 963 "@com_google_googletest//:gtest_main", 964 ], 965) 966 967cc_test( 968 name = "tracing_internal_strong_test", 969 srcs = ["internal/tracing_strong_test.cc"], 970 copts = ABSL_TEST_COPTS, 971 linkopts = ABSL_DEFAULT_LINKOPTS, 972 deps = [ 973 ":config", 974 ":core_headers", 975 ":tracing_internal", 976 "@com_google_googletest//:gtest", 977 "@com_google_googletest//:gtest_main", 978 ], 979) 980