From 0145515a6451df0999ff2d1c736bef0d9768a167 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Wed, 27 Jun 2018 07:52:37 +0100 Subject: [PATCH] Import llvm-toolchain-6.0_6.0.1.orig-compiler-rt.tar.bz2 [dgit import orig llvm-toolchain-6.0_6.0.1.orig-compiler-rt.tar.bz2] --- .arcconfig | 4 + .gitignore | 6 + CMakeLists.txt | 386 + CODE_OWNERS.TXT | 53 + CREDITS.TXT | 36 + LICENSE.TXT | 91 + README.txt | 11 + cmake/Modules/AddCompilerRT.cmake | 549 + cmake/Modules/BuiltinTests.cmake | 98 + cmake/Modules/CompilerRTCompile.cmake | 143 + cmake/Modules/CompilerRTDarwinUtils.cmake | 438 + cmake/Modules/CompilerRTLink.cmake | 16 + cmake/Modules/CompilerRTUtils.cmake | 307 + cmake/Modules/HandleCompilerRT.cmake | 21 + cmake/Modules/SanitizerUtils.cmake | 94 + cmake/base-config-ix.cmake | 196 + cmake/builtin-config-ix.cmake | 178 + cmake/caches/Apple.cmake | 15 + cmake/config-ix.cmake | 611 + docs/TestingGuide.rst | 66 + include/CMakeLists.txt | 71 + include/sanitizer/allocator_interface.h | 90 + include/sanitizer/asan_interface.h | 155 + include/sanitizer/common_interface_defs.h | 198 + include/sanitizer/coverage_interface.h | 36 + include/sanitizer/dfsan_interface.h | 116 + include/sanitizer/esan_interface.h | 50 + include/sanitizer/hwasan_interface.h | 33 + include/sanitizer/linux_syscall_hooks.h | 3083 + include/sanitizer/lsan_interface.h | 90 + include/sanitizer/msan_interface.h | 111 + include/sanitizer/scudo_interface.h | 34 + include/sanitizer/tsan_interface.h | 144 + include/sanitizer/tsan_interface_atomic.h | 222 + include/xray/xray_interface.h | 119 + include/xray/xray_log_interface.h | 279 + include/xray/xray_records.h | 132 + lib/BlocksRuntime/Block.h | 59 + lib/BlocksRuntime/Block_private.h | 179 + lib/BlocksRuntime/data.c | 41 + lib/BlocksRuntime/runtime.c | 700 + lib/CMakeLists.txt | 54 + lib/asan/.clang-format | 1 + lib/asan/CMakeLists.txt | 290 + lib/asan/README.txt | 26 + lib/asan/asan.syms.extra | 4 + lib/asan/asan_activation.cc | 144 + lib/asan/asan_activation.h | 23 + lib/asan/asan_activation_flags.inc | 37 + lib/asan/asan_allocator.cc | 1071 + lib/asan/asan_allocator.h | 222 + lib/asan/asan_blacklist.txt | 13 + lib/asan/asan_debugging.cc | 146 + lib/asan/asan_descriptions.cc | 510 + lib/asan/asan_descriptions.h | 252 + lib/asan/asan_errors.cc | 481 + lib/asan/asan_errors.h | 358 + lib/asan/asan_fake_stack.cc | 283 + lib/asan/asan_fake_stack.h | 176 + lib/asan/asan_flags.cc | 214 + lib/asan/asan_flags.h | 49 + lib/asan/asan_flags.inc | 162 + lib/asan/asan_fuchsia.cc | 218 + lib/asan/asan_globals.cc | 459 + lib/asan/asan_globals_win.cc | 62 + lib/asan/asan_init_version.h | 45 + lib/asan/asan_interceptors.cc | 628 + lib/asan/asan_interceptors.h | 130 + lib/asan/asan_interceptors_memintrinsics.cc | 44 + lib/asan/asan_interceptors_memintrinsics.h | 148 + lib/asan/asan_interface.inc | 169 + lib/asan/asan_interface_internal.h | 255 + lib/asan/asan_internal.h | 156 + lib/asan/asan_linux.cc | 254 + lib/asan/asan_lock.h | 0 lib/asan/asan_mac.cc | 312 + lib/asan/asan_malloc_linux.cc | 239 + lib/asan/asan_malloc_mac.cc | 61 + lib/asan/asan_malloc_win.cc | 252 + lib/asan/asan_mapping.h | 358 + lib/asan/asan_memory_profile.cc | 130 + lib/asan/asan_new_delete.cc | 193 + lib/asan/asan_poisoning.cc | 455 + lib/asan/asan_poisoning.h | 96 + lib/asan/asan_posix.cc | 72 + lib/asan/asan_preinit.cc | 25 + lib/asan/asan_premap_shadow.cc | 79 + lib/asan/asan_premap_shadow.h | 30 + lib/asan/asan_report.cc | 488 + lib/asan/asan_report.h | 82 + lib/asan/asan_rtl.cc | 569 + lib/asan/asan_scariness_score.h | 74 + lib/asan/asan_shadow_setup.cc | 165 + lib/asan/asan_stack.cc | 40 + lib/asan/asan_stack.h | 114 + lib/asan/asan_stats.cc | 174 + lib/asan/asan_stats.h | 72 + lib/asan/asan_suppressions.cc | 105 + lib/asan/asan_suppressions.h | 30 + lib/asan/asan_thread.cc | 513 + lib/asan/asan_thread.h | 199 + lib/asan/asan_win.cc | 353 + lib/asan/asan_win_dll_thunk.cc | 152 + lib/asan/asan_win_dynamic_runtime_thunk.cc | 131 + lib/asan/asan_win_weak_interception.cc | 23 + lib/asan/scripts/CMakeLists.txt | 4 + lib/asan/scripts/asan_device_setup | 467 + lib/asan/scripts/asan_symbolize.py | 519 + lib/asan/tests/CMakeLists.txt | 305 + lib/asan/tests/asan_asm_test.cc | 274 + lib/asan/tests/asan_benchmarks_test.cc | 85 + lib/asan/tests/asan_exceptions_test.cc | 27 + lib/asan/tests/asan_fake_stack_test.cc | 152 + lib/asan/tests/asan_globals_test.cc | 45 + lib/asan/tests/asan_interface_test.cc | 420 + .../tests/asan_internal_interface_test.cc | 37 + lib/asan/tests/asan_mac_test.cc | 236 + lib/asan/tests/asan_mac_test.h | 19 + lib/asan/tests/asan_mac_test_helpers.mm | 241 + lib/asan/tests/asan_mem_test.cc | 242 + lib/asan/tests/asan_noinst_test.cc | 271 + lib/asan/tests/asan_oob_test.cc | 128 + lib/asan/tests/asan_racy_double_free_test.cc | 32 + lib/asan/tests/asan_str_test.cc | 635 + lib/asan/tests/asan_test.cc | 1356 + lib/asan/tests/asan_test.ignore | 3 + lib/asan/tests/asan_test_config.h | 50 + lib/asan/tests/asan_test_main.cc | 56 + lib/asan/tests/asan_test_utils.h | 109 + lib/asan/weak_symbols.txt | 12 + lib/builtins/CMakeLists.txt | 556 + lib/builtins/Darwin-excludes/10.4.txt | 137 + lib/builtins/Darwin-excludes/CMakeLists.txt | 4 + lib/builtins/Darwin-excludes/README.TXT | 11 + lib/builtins/Darwin-excludes/ios-armv7.txt | 57 + lib/builtins/Darwin-excludes/ios-armv7s.txt | 57 + lib/builtins/Darwin-excludes/ios.txt | 1 + lib/builtins/Darwin-excludes/ios6-armv7.txt | 120 + lib/builtins/Darwin-excludes/ios6-armv7s.txt | 120 + lib/builtins/Darwin-excludes/ios7-arm64.txt | 16 + lib/builtins/Darwin-excludes/iossim-i386.txt | 82 + .../Darwin-excludes/iossim-x86_64.txt | 12 + lib/builtins/Darwin-excludes/iossim.txt | 1 + lib/builtins/Darwin-excludes/osx-i386.txt | 35 + lib/builtins/Darwin-excludes/osx.txt | 7 + lib/builtins/README.txt | 346 + lib/builtins/aarch64/chkstk.S | 34 + lib/builtins/absvdi2.c | 29 + lib/builtins/absvsi2.c | 29 + lib/builtins/absvti2.c | 34 + lib/builtins/adddf3.c | 30 + lib/builtins/addsf3.c | 30 + lib/builtins/addtf3.c | 25 + lib/builtins/addvdi3.c | 36 + lib/builtins/addvsi3.c | 36 + lib/builtins/addvti3.c | 40 + lib/builtins/apple_versioning.c | 350 + lib/builtins/arm/adddf3vfp.S | 33 + lib/builtins/arm/addsf3.S | 277 + lib/builtins/arm/addsf3vfp.S | 33 + lib/builtins/arm/aeabi_cdcmp.S | 149 + lib/builtins/arm/aeabi_cdcmpeq_check_nan.c | 16 + lib/builtins/arm/aeabi_cfcmp.S | 144 + lib/builtins/arm/aeabi_cfcmpeq_check_nan.c | 16 + lib/builtins/arm/aeabi_dcmp.S | 52 + lib/builtins/arm/aeabi_div0.c | 45 + lib/builtins/arm/aeabi_drsub.c | 19 + lib/builtins/arm/aeabi_fcmp.S | 52 + lib/builtins/arm/aeabi_frsub.c | 19 + lib/builtins/arm/aeabi_idivmod.S | 51 + lib/builtins/arm/aeabi_ldivmod.S | 46 + lib/builtins/arm/aeabi_memcmp.S | 30 + lib/builtins/arm/aeabi_memcpy.S | 30 + lib/builtins/arm/aeabi_memmove.S | 29 + lib/builtins/arm/aeabi_memset.S | 50 + lib/builtins/arm/aeabi_uidivmod.S | 58 + lib/builtins/arm/aeabi_uldivmod.S | 46 + lib/builtins/arm/bswapdi2.S | 44 + lib/builtins/arm/bswapsi2.S | 36 + lib/builtins/arm/clzdi2.S | 93 + lib/builtins/arm/clzsi2.S | 73 + lib/builtins/arm/comparesf2.S | 296 + lib/builtins/arm/divdf3vfp.S | 33 + lib/builtins/arm/divmodsi4.S | 71 + lib/builtins/arm/divsf3vfp.S | 33 + lib/builtins/arm/divsi3.S | 82 + lib/builtins/arm/eqdf2vfp.S | 37 + lib/builtins/arm/eqsf2vfp.S | 37 + lib/builtins/arm/extendsfdf2vfp.S | 33 + lib/builtins/arm/fixdfsivfp.S | 34 + lib/builtins/arm/fixsfsivfp.S | 34 + lib/builtins/arm/fixunsdfsivfp.S | 35 + lib/builtins/arm/fixunssfsivfp.S | 35 + lib/builtins/arm/floatsidfvfp.S | 34 + lib/builtins/arm/floatsisfvfp.S | 34 + lib/builtins/arm/floatunssidfvfp.S | 34 + lib/builtins/arm/floatunssisfvfp.S | 34 + lib/builtins/arm/gedf2vfp.S | 37 + lib/builtins/arm/gesf2vfp.S | 37 + lib/builtins/arm/gtdf2vfp.S | 37 + lib/builtins/arm/gtsf2vfp.S | 37 + lib/builtins/arm/ledf2vfp.S | 37 + lib/builtins/arm/lesf2vfp.S | 37 + lib/builtins/arm/ltdf2vfp.S | 37 + lib/builtins/arm/ltsf2vfp.S | 37 + lib/builtins/arm/modsi3.S | 60 + lib/builtins/arm/muldf3vfp.S | 33 + lib/builtins/arm/mulsf3vfp.S | 33 + lib/builtins/arm/nedf2vfp.S | 37 + lib/builtins/arm/negdf2vfp.S | 30 + lib/builtins/arm/negsf2vfp.S | 30 + lib/builtins/arm/nesf2vfp.S | 37 + lib/builtins/arm/restore_vfp_d8_d15_regs.S | 35 + lib/builtins/arm/save_vfp_d8_d15_regs.S | 35 + lib/builtins/arm/softfloat-alias.list | 21 + lib/builtins/arm/subdf3vfp.S | 33 + lib/builtins/arm/subsf3vfp.S | 34 + lib/builtins/arm/switch16.S | 46 + lib/builtins/arm/switch32.S | 46 + lib/builtins/arm/switch8.S | 44 + lib/builtins/arm/switchu8.S | 44 + lib/builtins/arm/sync-ops.h | 64 + lib/builtins/arm/sync_fetch_and_add_4.S | 23 + lib/builtins/arm/sync_fetch_and_add_8.S | 26 + lib/builtins/arm/sync_fetch_and_and_4.S | 22 + lib/builtins/arm/sync_fetch_and_and_8.S | 26 + lib/builtins/arm/sync_fetch_and_max_4.S | 22 + lib/builtins/arm/sync_fetch_and_max_8.S | 24 + lib/builtins/arm/sync_fetch_and_min_4.S | 22 + lib/builtins/arm/sync_fetch_and_min_8.S | 24 + lib/builtins/arm/sync_fetch_and_nand_4.S | 22 + lib/builtins/arm/sync_fetch_and_nand_8.S | 26 + lib/builtins/arm/sync_fetch_and_or_4.S | 22 + lib/builtins/arm/sync_fetch_and_or_8.S | 26 + lib/builtins/arm/sync_fetch_and_sub_4.S | 23 + lib/builtins/arm/sync_fetch_and_sub_8.S | 26 + lib/builtins/arm/sync_fetch_and_umax_4.S | 22 + lib/builtins/arm/sync_fetch_and_umax_8.S | 24 + lib/builtins/arm/sync_fetch_and_umin_4.S | 22 + lib/builtins/arm/sync_fetch_and_umin_8.S | 24 + lib/builtins/arm/sync_fetch_and_xor_4.S | 22 + lib/builtins/arm/sync_fetch_and_xor_8.S | 26 + lib/builtins/arm/sync_synchronize.S | 38 + lib/builtins/arm/truncdfsf2vfp.S | 33 + lib/builtins/arm/udivmodsi4.S | 180 + lib/builtins/arm/udivsi3.S | 264 + lib/builtins/arm/umodsi3.S | 158 + lib/builtins/arm/unorddf2vfp.S | 37 + lib/builtins/arm/unordsf2vfp.S | 37 + lib/builtins/ashldi3.c | 45 + lib/builtins/ashlti3.c | 45 + lib/builtins/ashrdi3.c | 46 + lib/builtins/ashrti3.c | 46 + lib/builtins/assembly.h | 204 + lib/builtins/atomic.c | 338 + lib/builtins/atomic_flag_clear.c | 27 + lib/builtins/atomic_flag_clear_explicit.c | 28 + lib/builtins/atomic_flag_test_and_set.c | 27 + .../atomic_flag_test_and_set_explicit.c | 28 + lib/builtins/atomic_signal_fence.c | 27 + lib/builtins/atomic_thread_fence.c | 27 + lib/builtins/bswapdi2.c | 27 + lib/builtins/bswapsi2.c | 23 + lib/builtins/clear_cache.c | 199 + lib/builtins/clzdi2.c | 29 + lib/builtins/clzsi2.c | 53 + lib/builtins/clzti2.c | 33 + lib/builtins/cmpdi2.c | 51 + lib/builtins/cmpti2.c | 42 + lib/builtins/comparedf2.c | 153 + lib/builtins/comparesf2.c | 153 + lib/builtins/comparetf2.c | 138 + lib/builtins/cpu_model.c | 608 + lib/builtins/ctzdi2.c | 29 + lib/builtins/ctzsi2.c | 57 + lib/builtins/ctzti2.c | 33 + lib/builtins/divdc3.c | 60 + lib/builtins/divdf3.c | 193 + lib/builtins/divdi3.c | 29 + lib/builtins/divmoddi4.c | 25 + lib/builtins/divmodsi4.c | 27 + lib/builtins/divsc3.c | 60 + lib/builtins/divsf3.c | 177 + lib/builtins/divsi3.c | 39 + lib/builtins/divtc3.c | 60 + lib/builtins/divtf3.c | 203 + lib/builtins/divti3.c | 33 + lib/builtins/divxc3.c | 63 + lib/builtins/emutls.c | 361 + lib/builtins/enable_execute_stack.c | 72 + lib/builtins/eprintf.c | 35 + lib/builtins/extenddftf2.c | 23 + lib/builtins/extendhfsf2.c | 33 + lib/builtins/extendsfdf2.c | 27 + lib/builtins/extendsftf2.c | 23 + lib/builtins/ffsdi2.c | 33 + lib/builtins/ffssi2.c | 29 + lib/builtins/ffsti2.c | 37 + lib/builtins/fixdfdi.c | 55 + lib/builtins/fixdfsi.c | 30 + lib/builtins/fixdfti.c | 26 + lib/builtins/fixsfdi.c | 55 + lib/builtins/fixsfsi.c | 30 + lib/builtins/fixsfti.c | 26 + lib/builtins/fixtfdi.c | 23 + lib/builtins/fixtfsi.c | 23 + lib/builtins/fixtfti.c | 23 + lib/builtins/fixunsdfdi.c | 52 + lib/builtins/fixunsdfsi.c | 29 + lib/builtins/fixunsdfti.c | 23 + lib/builtins/fixunssfdi.c | 53 + lib/builtins/fixunssfsi.c | 33 + lib/builtins/fixunssfti.c | 26 + lib/builtins/fixunstfdi.c | 22 + lib/builtins/fixunstfsi.c | 22 + lib/builtins/fixunstfti.c | 22 + lib/builtins/fixunsxfdi.c | 46 + lib/builtins/fixunsxfsi.c | 45 + lib/builtins/fixunsxfti.c | 50 + lib/builtins/fixxfdi.c | 48 + lib/builtins/fixxfti.c | 51 + lib/builtins/floatdidf.c | 115 + lib/builtins/floatdisf.c | 88 + lib/builtins/floatditf.c | 50 + lib/builtins/floatdixf.c | 46 + lib/builtins/floatsidf.c | 61 + lib/builtins/floatsisf.c | 67 + lib/builtins/floatsitf.c | 50 + lib/builtins/floattidf.c | 83 + lib/builtins/floattisf.c | 82 + lib/builtins/floattitf.c | 82 + lib/builtins/floattixf.c | 84 + lib/builtins/floatundidf.c | 114 + lib/builtins/floatundisf.c | 85 + lib/builtins/floatunditf.c | 40 + lib/builtins/floatundixf.c | 42 + lib/builtins/floatunsidf.c | 50 + lib/builtins/floatunsisf.c | 58 + lib/builtins/floatunsitf.c | 40 + lib/builtins/floatuntidf.c | 80 + lib/builtins/floatuntisf.c | 79 + lib/builtins/floatuntitf.c | 79 + lib/builtins/floatuntixf.c | 81 + lib/builtins/fp_add_impl.inc | 144 + lib/builtins/fp_extend.h | 89 + lib/builtins/fp_extend_impl.inc | 108 + lib/builtins/fp_fixint_impl.inc | 41 + lib/builtins/fp_fixuint_impl.inc | 39 + lib/builtins/fp_lib.h | 270 + lib/builtins/fp_mul_impl.inc | 116 + lib/builtins/fp_trunc.h | 76 + lib/builtins/fp_trunc_impl.inc | 135 + lib/builtins/gcc_personality_v0.c | 252 + lib/builtins/i386/ashldi3.S | 61 + lib/builtins/i386/ashrdi3.S | 72 + lib/builtins/i386/chkstk.S | 34 + lib/builtins/i386/chkstk2.S | 40 + lib/builtins/i386/divdi3.S | 165 + lib/builtins/i386/floatdidf.S | 42 + lib/builtins/i386/floatdisf.S | 35 + lib/builtins/i386/floatdixf.S | 33 + lib/builtins/i386/floatundidf.S | 55 + lib/builtins/i386/floatundisf.S | 108 + lib/builtins/i386/floatundixf.S | 46 + lib/builtins/i386/lshrdi3.S | 62 + lib/builtins/i386/moddi3.S | 169 + lib/builtins/i386/muldi3.S | 33 + lib/builtins/i386/udivdi3.S | 118 + lib/builtins/i386/umoddi3.S | 129 + lib/builtins/int_endianness.h | 116 + lib/builtins/int_lib.h | 134 + lib/builtins/int_math.h | 114 + lib/builtins/int_types.h | 164 + lib/builtins/int_util.c | 71 + lib/builtins/int_util.h | 33 + lib/builtins/lshrdi3.c | 45 + lib/builtins/lshrti3.c | 45 + lib/builtins/macho_embedded/CMakeLists.txt | 4 + lib/builtins/macho_embedded/arm.txt | 16 + lib/builtins/macho_embedded/common.txt | 92 + lib/builtins/macho_embedded/i386.txt | 7 + lib/builtins/macho_embedded/thumb2-64.txt | 10 + lib/builtins/macho_embedded/thumb2.txt | 14 + lib/builtins/mingw_fixfloat.c | 36 + lib/builtins/moddi3.c | 30 + lib/builtins/modsi3.c | 23 + lib/builtins/modti3.c | 34 + lib/builtins/muldc3.c | 73 + lib/builtins/muldf3.c | 30 + lib/builtins/muldi3.c | 58 + lib/builtins/mulodi4.c | 58 + lib/builtins/mulosi4.c | 58 + lib/builtins/muloti4.c | 62 + lib/builtins/mulsc3.c | 73 + lib/builtins/mulsf3.c | 30 + lib/builtins/multc3.c | 68 + lib/builtins/multf3.c | 25 + lib/builtins/multi3.c | 58 + lib/builtins/mulvdi3.c | 56 + lib/builtins/mulvsi3.c | 56 + lib/builtins/mulvti3.c | 60 + lib/builtins/mulxc3.c | 77 + lib/builtins/negdf2.c | 30 + lib/builtins/negdi2.c | 26 + lib/builtins/negsf2.c | 30 + lib/builtins/negti2.c | 30 + lib/builtins/negvdi2.c | 28 + lib/builtins/negvsi2.c | 28 + lib/builtins/negvti2.c | 32 + lib/builtins/os_version_check.c | 178 + lib/builtins/paritydi2.c | 25 + lib/builtins/paritysi2.c | 27 + lib/builtins/parityti2.c | 29 + lib/builtins/popcountdi2.c | 36 + lib/builtins/popcountsi2.c | 33 + lib/builtins/popcountti2.c | 44 + lib/builtins/powidf2.c | 34 + lib/builtins/powisf2.c | 34 + lib/builtins/powitf2.c | 38 + lib/builtins/powixf2.c | 38 + lib/builtins/ppc/DD.h | 45 + lib/builtins/ppc/divtc3.c | 91 + lib/builtins/ppc/fixtfdi.c | 104 + lib/builtins/ppc/fixunstfdi.c | 59 + lib/builtins/ppc/floatditf.c | 36 + lib/builtins/ppc/floatunditf.c | 41 + lib/builtins/ppc/gcc_qadd.c | 76 + lib/builtins/ppc/gcc_qdiv.c | 55 + lib/builtins/ppc/gcc_qmul.c | 53 + lib/builtins/ppc/gcc_qsub.c | 76 + lib/builtins/ppc/multc3.c | 90 + lib/builtins/ppc/restFP.S | 46 + lib/builtins/ppc/saveFP.S | 43 + lib/builtins/subdf3.c | 32 + lib/builtins/subsf3.c | 32 + lib/builtins/subtf3.c | 27 + lib/builtins/subvdi3.c | 36 + lib/builtins/subvsi3.c | 36 + lib/builtins/subvti3.c | 40 + lib/builtins/trampoline_setup.c | 48 + lib/builtins/truncdfhf2.c | 26 + lib/builtins/truncdfsf2.c | 26 + lib/builtins/truncsfhf2.c | 32 + lib/builtins/trunctfdf2.c | 22 + lib/builtins/trunctfsf2.c | 22 + lib/builtins/ucmpdi2.c | 51 + lib/builtins/ucmpti2.c | 42 + lib/builtins/udivdi3.c | 23 + lib/builtins/udivmoddi4.c | 231 + lib/builtins/udivmodsi4.c | 27 + lib/builtins/udivmodti4.c | 238 + lib/builtins/udivsi3.c | 68 + lib/builtins/udivti3.c | 27 + lib/builtins/umoddi3.c | 25 + lib/builtins/umodsi3.c | 23 + lib/builtins/umodti3.c | 29 + lib/builtins/unwind-ehabi-helpers.h | 55 + lib/builtins/x86_64/chkstk.S | 39 + lib/builtins/x86_64/chkstk2.S | 42 + lib/builtins/x86_64/floatdidf.c | 16 + lib/builtins/x86_64/floatdisf.c | 14 + lib/builtins/x86_64/floatdixf.c | 16 + lib/builtins/x86_64/floatundidf.S | 52 + lib/builtins/x86_64/floatundisf.S | 38 + lib/builtins/x86_64/floatundixf.S | 71 + lib/cfi/CMakeLists.txt | 39 + lib/cfi/cfi.cc | 430 + lib/cfi/cfi_blacklist.txt | 17 + lib/dfsan/.clang-format | 1 + lib/dfsan/CMakeLists.txt | 47 + lib/dfsan/dfsan.cc | 452 + lib/dfsan/dfsan.h | 73 + lib/dfsan/dfsan.syms.extra | 3 + lib/dfsan/dfsan_custom.cc | 1135 + lib/dfsan/dfsan_flags.inc | 32 + lib/dfsan/dfsan_interceptors.cc | 46 + lib/dfsan/dfsan_platform.h | 116 + lib/dfsan/done_abilist.txt | 298 + lib/dfsan/libc_ubuntu1404_abilist.txt | 3433 + lib/dfsan/scripts/build-libc-list.py | 96 + lib/dfsan/scripts/check_custom_wrappers.sh | 52 + lib/esan/CMakeLists.txt | 40 + lib/esan/cache_frag.cpp | 208 + lib/esan/cache_frag.h | 29 + lib/esan/esan.cpp | 278 + lib/esan/esan.h | 61 + lib/esan/esan.syms.extra | 4 + lib/esan/esan_circular_buffer.h | 96 + lib/esan/esan_flags.cpp | 60 + lib/esan/esan_flags.h | 41 + lib/esan/esan_flags.inc | 56 + lib/esan/esan_hashtable.h | 381 + lib/esan/esan_interceptors.cpp | 549 + lib/esan/esan_interface.cpp | 122 + lib/esan/esan_interface_internal.h | 83 + lib/esan/esan_linux.cpp | 83 + lib/esan/esan_shadow.h | 292 + lib/esan/esan_sideline.h | 63 + lib/esan/esan_sideline_linux.cpp | 178 + lib/esan/working_set.cpp | 280 + lib/esan/working_set.h | 40 + lib/esan/working_set_posix.cpp | 134 + lib/fuzzer/CMakeLists.txt | 80 + lib/fuzzer/FuzzerClangCounters.cpp | 49 + lib/fuzzer/FuzzerCommand.h | 180 + lib/fuzzer/FuzzerCorpus.h | 302 + lib/fuzzer/FuzzerCrossOver.cpp | 52 + lib/fuzzer/FuzzerDefs.h | 167 + lib/fuzzer/FuzzerDictionary.h | 127 + lib/fuzzer/FuzzerDriver.cpp | 767 + lib/fuzzer/FuzzerExtFunctions.def | 47 + lib/fuzzer/FuzzerExtFunctions.h | 35 + lib/fuzzer/FuzzerExtFunctionsDlsym.cpp | 52 + lib/fuzzer/FuzzerExtFunctionsDlsymWin.cpp | 62 + lib/fuzzer/FuzzerExtFunctionsWeak.cpp | 54 + lib/fuzzer/FuzzerExtFunctionsWeakAlias.cpp | 56 + lib/fuzzer/FuzzerExtraCounters.cpp | 41 + lib/fuzzer/FuzzerFlags.def | 150 + lib/fuzzer/FuzzerIO.cpp | 129 + lib/fuzzer/FuzzerIO.h | 85 + lib/fuzzer/FuzzerIOPosix.cpp | 140 + lib/fuzzer/FuzzerIOWindows.cpp | 323 + lib/fuzzer/FuzzerInterface.h | 67 + lib/fuzzer/FuzzerInternal.h | 155 + lib/fuzzer/FuzzerLoop.cpp | 839 + lib/fuzzer/FuzzerMain.cpp | 21 + lib/fuzzer/FuzzerMerge.cpp | 390 + lib/fuzzer/FuzzerMerge.h | 80 + lib/fuzzer/FuzzerMutate.cpp | 533 + lib/fuzzer/FuzzerMutate.h | 150 + lib/fuzzer/FuzzerOptions.h | 75 + lib/fuzzer/FuzzerRandom.h | 34 + lib/fuzzer/FuzzerSHA1.cpp | 222 + lib/fuzzer/FuzzerSHA1.h | 33 + lib/fuzzer/FuzzerShmem.h | 69 + lib/fuzzer/FuzzerShmemFuchsia.cpp | 38 + lib/fuzzer/FuzzerShmemPosix.cpp | 103 + lib/fuzzer/FuzzerShmemWindows.cpp | 64 + lib/fuzzer/FuzzerTracePC.cpp | 602 + lib/fuzzer/FuzzerTracePC.h | 297 + lib/fuzzer/FuzzerUtil.cpp | 215 + lib/fuzzer/FuzzerUtil.h | 87 + lib/fuzzer/FuzzerUtilDarwin.cpp | 162 + lib/fuzzer/FuzzerUtilFuchsia.cpp | 228 + lib/fuzzer/FuzzerUtilLinux.cpp | 26 + lib/fuzzer/FuzzerUtilPosix.cpp | 151 + lib/fuzzer/FuzzerUtilWindows.cpp | 194 + lib/fuzzer/FuzzerValueBitMap.h | 73 + lib/fuzzer/README.txt | 1 + lib/fuzzer/afl/afl_driver.cpp | 347 + lib/fuzzer/build.sh | 11 + lib/fuzzer/scripts/unbalanced_allocs.py | 93 + .../standalone/StandaloneFuzzTargetMain.c | 41 + lib/fuzzer/tests/CMakeLists.txt | 46 + lib/fuzzer/tests/FuzzerUnittest.cpp | 932 + lib/hwasan/.clang-format | 1 + lib/hwasan/CMakeLists.txt | 145 + lib/hwasan/hwasan.cc | 375 + lib/hwasan/hwasan.h | 172 + lib/hwasan/hwasan.syms.extra | 2 + lib/hwasan/hwasan_allocator.cc | 330 + lib/hwasan/hwasan_allocator.h | 55 + lib/hwasan/hwasan_blacklist.txt | 7 + lib/hwasan/hwasan_flags.h | 30 + lib/hwasan/hwasan_flags.inc | 29 + lib/hwasan/hwasan_interceptors.cc | 483 + lib/hwasan/hwasan_interface_internal.h | 123 + lib/hwasan/hwasan_linux.cc | 255 + lib/hwasan/hwasan_new_delete.cc | 66 + lib/hwasan/hwasan_poisoning.cc | 36 + lib/hwasan/hwasan_poisoning.h | 25 + lib/hwasan/hwasan_report.cc | 133 + lib/hwasan/hwasan_thread.cc | 75 + lib/hwasan/hwasan_thread.h | 81 + lib/interception/.clang-format | 1 + lib/interception/CMakeLists.txt | 23 + lib/interception/interception.h | 289 + lib/interception/interception_linux.cc | 55 + lib/interception/interception_linux.h | 50 + lib/interception/interception_mac.cc | 19 + lib/interception/interception_mac.h | 28 + lib/interception/interception_type_test.cc | 40 + lib/interception/interception_win.cc | 1016 + lib/interception/interception_win.h | 84 + lib/interception/tests/CMakeLists.txt | 113 + .../tests/interception_linux_test.cc | 68 + .../tests/interception_test_main.cc | 22 + .../tests/interception_win_test.cc | 637 + lib/lsan/.clang-format | 1 + lib/lsan/CMakeLists.txt | 64 + lib/lsan/lsan.cc | 116 + lib/lsan/lsan.h | 67 + lib/lsan/lsan_allocator.cc | 290 + lib/lsan/lsan_allocator.h | 103 + lib/lsan/lsan_common.cc | 878 + lib/lsan/lsan_common.h | 264 + lib/lsan/lsan_common_linux.cc | 140 + lib/lsan/lsan_common_mac.cc | 199 + lib/lsan/lsan_flags.inc | 47 + lib/lsan/lsan_interceptors.cc | 455 + lib/lsan/lsan_linux.cc | 33 + lib/lsan/lsan_mac.cc | 192 + lib/lsan/lsan_malloc_mac.cc | 55 + lib/lsan/lsan_preinit.cc | 22 + lib/lsan/lsan_thread.cc | 158 + lib/lsan/lsan_thread.h | 60 + lib/lsan/weak_symbols.txt | 3 + lib/msan/.clang-format | 1 + lib/msan/CMakeLists.txt | 66 + lib/msan/msan.cc | 656 + lib/msan/msan.h | 402 + lib/msan/msan.syms.extra | 2 + lib/msan/msan_allocator.cc | 322 + lib/msan/msan_allocator.h | 33 + lib/msan/msan_blacklist.txt | 7 + lib/msan/msan_chained_origin_depot.cc | 132 + lib/msan/msan_chained_origin_depot.h | 29 + lib/msan/msan_flags.h | 30 + lib/msan/msan_flags.inc | 35 + lib/msan/msan_interceptors.cc | 1678 + lib/msan/msan_interface_internal.h | 179 + lib/msan/msan_linux.cc | 216 + lib/msan/msan_new_delete.cc | 108 + lib/msan/msan_origin.h | 169 + lib/msan/msan_poisoning.cc | 174 + lib/msan/msan_poisoning.h | 59 + lib/msan/msan_report.cc | 272 + lib/msan/msan_thread.cc | 82 + lib/msan/msan_thread.h | 71 + lib/msan/tests/CMakeLists.txt | 138 + lib/msan/tests/msan_loadable.cc | 27 + lib/msan/tests/msan_test.cc | 4614 ++ lib/msan/tests/msan_test_config.h | 20 + lib/msan/tests/msan_test_main.cc | 21 + lib/profile/CMakeLists.txt | 115 + lib/profile/GCDAProfiling.c | 569 + lib/profile/InstrProfData.inc | 740 + lib/profile/InstrProfiling.c | 81 + lib/profile/InstrProfiling.h | 209 + lib/profile/InstrProfilingBuffer.c | 68 + lib/profile/InstrProfilingFile.c | 622 + lib/profile/InstrProfilingInternal.h | 190 + lib/profile/InstrProfilingMerge.c | 132 + lib/profile/InstrProfilingMergeFile.c | 41 + lib/profile/InstrProfilingNameVar.c | 18 + lib/profile/InstrProfilingPlatformDarwin.c | 63 + lib/profile/InstrProfilingPlatformLinux.c | 77 + lib/profile/InstrProfilingPlatformOther.c | 95 + lib/profile/InstrProfilingPort.h | 130 + lib/profile/InstrProfilingRuntime.cc | 30 + lib/profile/InstrProfilingUtil.c | 283 + lib/profile/InstrProfilingUtil.h | 65 + lib/profile/InstrProfilingValue.c | 358 + lib/profile/InstrProfilingWriter.c | 287 + lib/profile/WindowsMMap.c | 184 + lib/profile/WindowsMMap.h | 59 + lib/safestack/.clang-format | 1 + lib/safestack/CMakeLists.txt | 34 + lib/safestack/safestack.cc | 255 + lib/sanitizer_common/.clang-format | 1 + lib/sanitizer_common/.clang-tidy | 16 + lib/sanitizer_common/CMakeLists.txt | 307 + lib/sanitizer_common/sancov_begin.S | 5 + lib/sanitizer_common/sancov_end.S | 5 + lib/sanitizer_common/sancov_flags.cc | 59 + lib/sanitizer_common/sancov_flags.h | 40 + lib/sanitizer_common/sancov_flags.inc | 21 + lib/sanitizer_common/sanitizer_addrhashmap.h | 354 + lib/sanitizer_common/sanitizer_allocator.cc | 260 + lib/sanitizer_common/sanitizer_allocator.h | 83 + .../sanitizer_allocator_bytemap.h | 103 + .../sanitizer_allocator_checks.cc | 23 + .../sanitizer_allocator_checks.h | 75 + .../sanitizer_allocator_combined.h | 197 + .../sanitizer_allocator_interface.h | 48 + .../sanitizer_allocator_internal.h | 73 + .../sanitizer_allocator_local_cache.h | 272 + .../sanitizer_allocator_primary32.h | 370 + .../sanitizer_allocator_primary64.h | 849 + .../sanitizer_allocator_secondary.h | 268 + .../sanitizer_allocator_size_class_map.h | 233 + .../sanitizer_allocator_stats.h | 107 + lib/sanitizer_common/sanitizer_asm.h | 58 + lib/sanitizer_common/sanitizer_atomic.h | 87 + lib/sanitizer_common/sanitizer_atomic_clang.h | 106 + .../sanitizer_atomic_clang_mips.h | 118 + .../sanitizer_atomic_clang_other.h | 98 + .../sanitizer_atomic_clang_x86.h | 116 + lib/sanitizer_common/sanitizer_atomic_msvc.h | 266 + lib/sanitizer_common/sanitizer_bitvector.h | 351 + lib/sanitizer_common/sanitizer_bvgraph.h | 165 + lib/sanitizer_common/sanitizer_common.cc | 371 + lib/sanitizer_common/sanitizer_common.h | 953 + .../sanitizer_common_interceptors.inc | 6621 ++ .../sanitizer_common_interceptors_format.inc | 563 + .../sanitizer_common_interceptors_ioctl.inc | 606 + .../sanitizer_common_interface.inc | 40 + .../sanitizer_common_interface_posix.inc | 14 + .../sanitizer_common_libcdep.cc | 349 + .../sanitizer_common_nolibc.cc | 36 + .../sanitizer_common_syscalls.inc | 2886 + .../sanitizer_coverage_fuchsia.cc | 240 + .../sanitizer_coverage_interface.inc | 33 + .../sanitizer_coverage_libcdep_new.cc | 220 + .../sanitizer_coverage_win_dll_thunk.cc | 21 + ...izer_coverage_win_dynamic_runtime_thunk.cc | 21 + .../sanitizer_coverage_win_sections.cc | 22 + ...anitizer_coverage_win_weak_interception.cc | 24 + lib/sanitizer_common/sanitizer_dbghelp.h | 42 + .../sanitizer_deadlock_detector.h | 416 + .../sanitizer_deadlock_detector1.cc | 195 + .../sanitizer_deadlock_detector2.cc | 428 + .../sanitizer_deadlock_detector_interface.h | 93 + lib/sanitizer_common/sanitizer_errno.cc | 35 + lib/sanitizer_common/sanitizer_errno.h | 39 + lib/sanitizer_common/sanitizer_errno_codes.h | 34 + lib/sanitizer_common/sanitizer_file.cc | 177 + lib/sanitizer_common/sanitizer_file.h | 110 + lib/sanitizer_common/sanitizer_flag_parser.cc | 171 + lib/sanitizer_common/sanitizer_flag_parser.h | 143 + lib/sanitizer_common/sanitizer_flags.cc | 130 + lib/sanitizer_common/sanitizer_flags.h | 68 + lib/sanitizer_common/sanitizer_flags.inc | 239 + lib/sanitizer_common/sanitizer_freebsd.h | 137 + lib/sanitizer_common/sanitizer_fuchsia.cc | 539 + lib/sanitizer_common/sanitizer_fuchsia.h | 31 + lib/sanitizer_common/sanitizer_getauxval.h | 47 + .../sanitizer_interface_internal.h | 111 + .../sanitizer_internal_defs.h | 409 + lib/sanitizer_common/sanitizer_lfstack.h | 73 + lib/sanitizer_common/sanitizer_libc.cc | 293 + lib/sanitizer_common/sanitizer_libc.h | 89 + lib/sanitizer_common/sanitizer_libignore.cc | 129 + lib/sanitizer_common/sanitizer_libignore.h | 114 + lib/sanitizer_common/sanitizer_linux.cc | 1901 + lib/sanitizer_common/sanitizer_linux.h | 150 + .../sanitizer_linux_libcdep.cc | 773 + lib/sanitizer_common/sanitizer_linux_mips64.S | 23 + lib/sanitizer_common/sanitizer_linux_s390.cc | 222 + lib/sanitizer_common/sanitizer_linux_x86_64.S | 25 + lib/sanitizer_common/sanitizer_list.h | 167 + lib/sanitizer_common/sanitizer_mac.cc | 1026 + lib/sanitizer_common/sanitizer_mac.h | 72 + lib/sanitizer_common/sanitizer_mac_libcdep.cc | 30 + lib/sanitizer_common/sanitizer_malloc_mac.inc | 368 + lib/sanitizer_common/sanitizer_mutex.h | 229 + .../sanitizer_persistent_allocator.cc | 19 + .../sanitizer_persistent_allocator.h | 72 + .../sanitizer_placement_new.h | 25 + lib/sanitizer_common/sanitizer_platform.h | 305 + .../sanitizer_platform_interceptors.h | 433 + .../sanitizer_platform_limits_linux.cc | 109 + .../sanitizer_platform_limits_netbsd.cc | 363 + .../sanitizer_platform_limits_netbsd.h | 582 + .../sanitizer_platform_limits_posix.cc | 1296 + .../sanitizer_platform_limits_posix.h | 1505 + .../sanitizer_platform_limits_solaris.cc | 366 + .../sanitizer_platform_limits_solaris.h | 485 + lib/sanitizer_common/sanitizer_posix.cc | 330 + lib/sanitizer_common/sanitizer_posix.h | 97 + .../sanitizer_posix_libcdep.cc | 520 + lib/sanitizer_common/sanitizer_printf.cc | 343 + lib/sanitizer_common/sanitizer_procmaps.h | 100 + .../sanitizer_procmaps_common.cc | 174 + .../sanitizer_procmaps_freebsd.cc | 103 + .../sanitizer_procmaps_linux.cc | 81 + .../sanitizer_procmaps_mac.cc | 381 + .../sanitizer_procmaps_solaris.cc | 57 + lib/sanitizer_common/sanitizer_quarantine.h | 315 + .../sanitizer_report_decorator.h | 48 + .../sanitizer_signal_interceptors.inc | 87 + lib/sanitizer_common/sanitizer_solaris.cc | 219 + lib/sanitizer_common/sanitizer_stackdepot.cc | 163 + lib/sanitizer_common/sanitizer_stackdepot.h | 72 + .../sanitizer_stackdepotbase.h | 178 + lib/sanitizer_common/sanitizer_stacktrace.cc | 127 + lib/sanitizer_common/sanitizer_stacktrace.h | 146 + .../sanitizer_stacktrace_libcdep.cc | 143 + .../sanitizer_stacktrace_printer.cc | 262 + .../sanitizer_stacktrace_printer.h | 72 + lib/sanitizer_common/sanitizer_stoptheworld.h | 65 + .../sanitizer_stoptheworld_linux_libcdep.cc | 573 + .../sanitizer_stoptheworld_mac.cc | 178 + .../sanitizer_suppressions.cc | 171 + lib/sanitizer_common/sanitizer_suppressions.h | 57 + lib/sanitizer_common/sanitizer_symbolizer.cc | 120 + lib/sanitizer_common/sanitizer_symbolizer.h | 194 + .../sanitizer_symbolizer_fuchsia.cc | 107 + .../sanitizer_symbolizer_internal.h | 152 + .../sanitizer_symbolizer_libbacktrace.cc | 210 + .../sanitizer_symbolizer_libbacktrace.h | 50 + .../sanitizer_symbolizer_libcdep.cc | 499 + .../sanitizer_symbolizer_mac.cc | 169 + .../sanitizer_symbolizer_mac.h | 48 + .../sanitizer_symbolizer_posix_libcdep.cc | 541 + .../sanitizer_symbolizer_win.cc | 320 + .../sanitizer_syscall_generic.inc | 63 + .../sanitizer_syscall_linux_aarch64.inc | 141 + .../sanitizer_syscall_linux_arm.inc | 141 + .../sanitizer_syscall_linux_x86_64.inc | 94 + lib/sanitizer_common/sanitizer_termination.cc | 86 + .../sanitizer_thread_registry.cc | 341 + .../sanitizer_thread_registry.h | 154 + .../sanitizer_tls_get_addr.cc | 154 + lib/sanitizer_common/sanitizer_tls_get_addr.h | 63 + .../sanitizer_unwind_linux_libcdep.cc | 171 + lib/sanitizer_common/sanitizer_vector.h | 125 + lib/sanitizer_common/sanitizer_win.cc | 1116 + lib/sanitizer_common/sanitizer_win.h | 26 + lib/sanitizer_common/sanitizer_win_defs.h | 153 + .../sanitizer_win_dll_thunk.cc | 102 + .../sanitizer_win_dll_thunk.h | 182 + .../sanitizer_win_dynamic_runtime_thunk.cc | 21 + .../sanitizer_win_weak_interception.cc | 94 + .../sanitizer_win_weak_interception.h | 33 + lib/sanitizer_common/scripts/check_lint.sh | 142 + lib/sanitizer_common/scripts/cpplint.py | 4024 + .../scripts/gen_dynamic_list.py | 132 + lib/sanitizer_common/scripts/litlint.py | 72 + lib/sanitizer_common/scripts/litlint_test.py | 23 + lib/sanitizer_common/scripts/sancov.py | 251 + .../symbolizer/sanitizer_symbolize.cc | 75 + .../symbolizer/sanitizer_wrappers.cc | 199 + .../symbolizer/scripts/ar_to_bc.sh | 39 + .../symbolizer/scripts/build_symbolizer.sh | 185 + .../symbolizer/scripts/global_symbols.txt | 139 + lib/sanitizer_common/tests/CMakeLists.txt | 217 + .../tests/malloc_stress_transfer_test.cc | 37 + .../tests/sanitizer_allocator_test.cc | 1354 + .../tests/sanitizer_allocator_testlib.cc | 203 + .../tests/sanitizer_atomic_test.cc | 128 + .../tests/sanitizer_bitvector_test.cc | 178 + .../tests/sanitizer_bvgraph_test.cc | 339 + .../tests/sanitizer_common_test.cc | 388 + .../tests/sanitizer_deadlock_detector_test.cc | 496 + .../tests/sanitizer_flags_test.cc | 180 + .../sanitizer_format_interceptor_test.cc | 263 + .../tests/sanitizer_ioctl_test.cc | 105 + .../tests/sanitizer_libc_test.cc | 244 + .../tests/sanitizer_linux_test.cc | 304 + .../tests/sanitizer_list_test.cc | 189 + .../tests/sanitizer_mutex_test.cc | 137 + .../tests/sanitizer_nolibc_test.cc | 31 + .../tests/sanitizer_nolibc_test_main.cc | 19 + .../tests/sanitizer_posix_test.cc | 81 + .../tests/sanitizer_printf_test.cc | 153 + .../tests/sanitizer_procmaps_test.cc | 77 + .../tests/sanitizer_pthread_wrappers.h | 68 + .../tests/sanitizer_quarantine_test.cc | 180 + .../tests/sanitizer_stackdepot_test.cc | 93 + .../sanitizer_stacktrace_printer_test.cc | 157 + .../tests/sanitizer_stacktrace_test.cc | 167 + .../tests/sanitizer_stoptheworld_test.cc | 204 + .../tests/sanitizer_stoptheworld_testlib.cc | 53 + .../tests/sanitizer_suppressions_test.cc | 135 + .../tests/sanitizer_symbolizer_test.cc | 72 + .../tests/sanitizer_test_config.h | 30 + .../tests/sanitizer_test_main.cc | 24 + .../tests/sanitizer_test_utils.h | 133 + .../tests/sanitizer_thread_registry_test.cc | 236 + .../tests/sanitizer_vector_test.cc | 42 + .../tests/standalone_malloc_test.cc | 87 + lib/sanitizer_common/weak_symbols.txt | 8 + lib/scudo/CMakeLists.txt | 72 + lib/scudo/scudo_allocator.cpp | 744 + lib/scudo/scudo_allocator.h | 129 + lib/scudo/scudo_allocator_combined.h | 76 + lib/scudo/scudo_allocator_secondary.h | 140 + lib/scudo/scudo_crc32.cpp | 25 + lib/scudo/scudo_crc32.h | 101 + lib/scudo/scudo_flags.cpp | 121 + lib/scudo/scudo_flags.h | 33 + lib/scudo/scudo_flags.inc | 47 + lib/scudo/scudo_interceptors.cpp | 75 + lib/scudo/scudo_interface_internal.h | 22 + lib/scudo/scudo_new_delete.cpp | 74 + lib/scudo/scudo_platform.h | 80 + lib/scudo/scudo_termination.cpp | 42 + lib/scudo/scudo_tsd.h | 72 + lib/scudo/scudo_tsd_exclusive.cpp | 68 + lib/scudo/scudo_tsd_exclusive.inc | 46 + lib/scudo/scudo_tsd_shared.cpp | 87 + lib/scudo/scudo_tsd_shared.inc | 48 + lib/scudo/scudo_utils.cpp | 118 + lib/scudo/scudo_utils.h | 37 + lib/stats/CMakeLists.txt | 39 + lib/stats/stats.cc | 137 + lib/stats/stats.h | 43 + lib/stats/stats_client.cc | 84 + lib/tsan/.clang-format | 1 + lib/tsan/CMakeLists.txt | 224 + lib/tsan/analyze_libtsan.sh | 54 + lib/tsan/benchmarks/mini_bench_local.cc | 49 + lib/tsan/benchmarks/mini_bench_shared.cc | 51 + lib/tsan/benchmarks/start_many_threads.cc | 52 + lib/tsan/benchmarks/vts_many_threads_bench.cc | 120 + lib/tsan/check_analyze.sh | 56 + lib/tsan/check_cmake.sh | 18 + lib/tsan/dd/CMakeLists.txt | 49 + lib/tsan/dd/dd_interceptors.cc | 329 + lib/tsan/dd/dd_rtl.cc | 159 + lib/tsan/dd/dd_rtl.h | 67 + lib/tsan/go/build.bat | 4 + lib/tsan/go/buildgo.sh | 152 + lib/tsan/go/test.c | 89 + lib/tsan/go/tsan_go.cc | 292 + lib/tsan/rtl/tsan.syms.extra | 26 + lib/tsan/rtl/tsan_clock.cc | 598 + lib/tsan/rtl/tsan_clock.h | 226 + lib/tsan/rtl/tsan_debugging.cc | 250 + lib/tsan/rtl/tsan_defs.h | 196 + lib/tsan/rtl/tsan_dense_alloc.h | 142 + lib/tsan/rtl/tsan_external.cc | 125 + lib/tsan/rtl/tsan_fd.cc | 316 + lib/tsan/rtl/tsan_fd.h | 65 + lib/tsan/rtl/tsan_flags.cc | 127 + lib/tsan/rtl/tsan_flags.h | 34 + lib/tsan/rtl/tsan_flags.inc | 86 + lib/tsan/rtl/tsan_ignoreset.cc | 47 + lib/tsan/rtl/tsan_ignoreset.h | 38 + lib/tsan/rtl/tsan_interceptors.cc | 2828 + lib/tsan/rtl/tsan_interceptors.h | 64 + lib/tsan/rtl/tsan_interceptors_mac.cc | 388 + lib/tsan/rtl/tsan_interface.cc | 135 + lib/tsan/rtl/tsan_interface.h | 405 + lib/tsan/rtl/tsan_interface_ann.cc | 553 + lib/tsan/rtl/tsan_interface_ann.h | 33 + lib/tsan/rtl/tsan_interface_atomic.cc | 956 + lib/tsan/rtl/tsan_interface_inl.h | 125 + lib/tsan/rtl/tsan_interface_java.cc | 268 + lib/tsan/rtl/tsan_interface_java.h | 100 + lib/tsan/rtl/tsan_libdispatch_mac.cc | 730 + lib/tsan/rtl/tsan_malloc_mac.cc | 60 + lib/tsan/rtl/tsan_md5.cc | 243 + lib/tsan/rtl/tsan_mman.cc | 359 + lib/tsan/rtl/tsan_mman.h | 90 + lib/tsan/rtl/tsan_mutex.cc | 290 + lib/tsan/rtl/tsan_mutex.h | 91 + lib/tsan/rtl/tsan_mutexset.cc | 89 + lib/tsan/rtl/tsan_mutexset.h | 70 + lib/tsan/rtl/tsan_new_delete.cc | 192 + lib/tsan/rtl/tsan_platform.h | 926 + lib/tsan/rtl/tsan_platform_linux.cc | 405 + lib/tsan/rtl/tsan_platform_mac.cc | 297 + lib/tsan/rtl/tsan_platform_posix.cc | 158 + lib/tsan/rtl/tsan_platform_windows.cc | 38 + lib/tsan/rtl/tsan_ppc_regs.h | 96 + lib/tsan/rtl/tsan_preinit.cc | 27 + lib/tsan/rtl/tsan_report.cc | 484 + lib/tsan/rtl/tsan_report.h | 135 + lib/tsan/rtl/tsan_rtl.cc | 1079 + lib/tsan/rtl/tsan_rtl.h | 864 + lib/tsan/rtl/tsan_rtl_aarch64.S | 337 + lib/tsan/rtl/tsan_rtl_amd64.S | 395 + lib/tsan/rtl/tsan_rtl_mips64.S | 214 + lib/tsan/rtl/tsan_rtl_mutex.cc | 540 + lib/tsan/rtl/tsan_rtl_ppc64.S | 288 + lib/tsan/rtl/tsan_rtl_proc.cc | 61 + lib/tsan/rtl/tsan_rtl_report.cc | 755 + lib/tsan/rtl/tsan_rtl_thread.cc | 401 + lib/tsan/rtl/tsan_stack_trace.cc | 46 + lib/tsan/rtl/tsan_stack_trace.h | 39 + lib/tsan/rtl/tsan_stat.cc | 187 + lib/tsan/rtl/tsan_stat.h | 191 + lib/tsan/rtl/tsan_suppressions.cc | 170 + lib/tsan/rtl/tsan_suppressions.h | 38 + lib/tsan/rtl/tsan_symbolize.cc | 82 + lib/tsan/rtl/tsan_symbolize.h | 31 + lib/tsan/rtl/tsan_sync.cc | 296 + lib/tsan/rtl/tsan_sync.h | 146 + lib/tsan/rtl/tsan_trace.h | 76 + lib/tsan/rtl/tsan_update_shadow_word_inl.h | 66 + lib/tsan/tests/CMakeLists.txt | 69 + lib/tsan/tests/rtl/CMakeLists.txt | 19 + lib/tsan/tests/rtl/tsan_bench.cc | 105 + lib/tsan/tests/rtl/tsan_mop.cc | 233 + lib/tsan/tests/rtl/tsan_mutex.cc | 221 + lib/tsan/tests/rtl/tsan_posix.cc | 155 + lib/tsan/tests/rtl/tsan_posix_util.h | 77 + lib/tsan/tests/rtl/tsan_string.cc | 82 + lib/tsan/tests/rtl/tsan_test.cc | 66 + lib/tsan/tests/rtl/tsan_test_util.h | 130 + lib/tsan/tests/rtl/tsan_test_util_posix.cc | 478 + lib/tsan/tests/rtl/tsan_thread.cc | 59 + lib/tsan/tests/unit/CMakeLists.txt | 12 + lib/tsan/tests/unit/tsan_clock_test.cc | 494 + lib/tsan/tests/unit/tsan_dense_alloc_test.cc | 55 + lib/tsan/tests/unit/tsan_flags_test.cc | 174 + lib/tsan/tests/unit/tsan_mman_test.cc | 232 + lib/tsan/tests/unit/tsan_mutex_test.cc | 126 + lib/tsan/tests/unit/tsan_mutexset_test.cc | 127 + lib/tsan/tests/unit/tsan_shadow_test.cc | 78 + lib/tsan/tests/unit/tsan_stack_test.cc | 95 + lib/tsan/tests/unit/tsan_sync_test.cc | 123 + lib/tsan/tests/unit/tsan_unit_test_main.cc | 25 + lib/ubsan/CMakeLists.txt | 196 + lib/ubsan/ubsan.syms.extra | 1 + lib/ubsan/ubsan_checks.inc | 47 + lib/ubsan/ubsan_diag.cc | 428 + lib/ubsan/ubsan_diag.h | 266 + lib/ubsan/ubsan_diag_standalone.cc | 38 + lib/ubsan/ubsan_flags.cc | 77 + lib/ubsan/ubsan_flags.h | 49 + lib/ubsan/ubsan_flags.inc | 26 + lib/ubsan/ubsan_handlers.cc | 705 + lib/ubsan/ubsan_handlers.h | 204 + lib/ubsan/ubsan_handlers_cxx.cc | 147 + lib/ubsan/ubsan_handlers_cxx.h | 39 + lib/ubsan/ubsan_init.cc | 65 + lib/ubsan/ubsan_init.h | 34 + lib/ubsan/ubsan_init_standalone.cc | 34 + lib/ubsan/ubsan_interface.inc | 54 + lib/ubsan/ubsan_platform.h | 29 + lib/ubsan/ubsan_signals_standalone.cc | 53 + lib/ubsan/ubsan_signals_standalone.h | 25 + lib/ubsan/ubsan_type_hash.cc | 34 + lib/ubsan/ubsan_type_hash.h | 70 + lib/ubsan/ubsan_type_hash_itanium.cc | 261 + lib/ubsan/ubsan_type_hash_win.cc | 81 + lib/ubsan/ubsan_value.cc | 113 + lib/ubsan/ubsan_value.h | 197 + lib/ubsan/ubsan_win_dll_thunk.cc | 21 + lib/ubsan/ubsan_win_dynamic_runtime_thunk.cc | 21 + lib/ubsan/ubsan_win_weak_interception.cc | 23 + lib/ubsan/weak_symbols.txt | 1 + lib/ubsan_minimal/CMakeLists.txt | 55 + lib/ubsan_minimal/ubsan.syms.extra | 1 + lib/ubsan_minimal/ubsan_minimal_handlers.cc | 104 + lib/xray/CMakeLists.txt | 115 + lib/xray/tests/CMakeLists.txt | 37 + lib/xray/tests/unit/CMakeLists.txt | 4 + lib/xray/tests/unit/buffer_queue_test.cc | 114 + lib/xray/tests/unit/fdr_logging_test.cc | 201 + lib/xray/tests/unit/xray_unit_test_main.cc | 18 + lib/xray/weak_symbols.txt | 4 + lib/xray/xray_AArch64.cc | 122 + lib/xray/xray_always_instrument.txt | 6 + lib/xray/xray_arm.cc | 159 + lib/xray/xray_buffer_queue.cc | 114 + lib/xray/xray_buffer_queue.h | 159 + lib/xray/xray_defs.h | 22 + lib/xray/xray_fdr_log_records.h | 69 + lib/xray/xray_fdr_logging.cc | 386 + lib/xray/xray_fdr_logging.h | 39 + lib/xray/xray_fdr_logging_impl.h | 705 + lib/xray/xray_flags.cc | 86 + lib/xray/xray_flags.h | 38 + lib/xray/xray_flags.inc | 49 + lib/xray/xray_init.cc | 102 + lib/xray/xray_inmemory_log.cc | 471 + lib/xray/xray_inmemory_log.h | 44 + lib/xray/xray_interface.cc | 401 + lib/xray/xray_interface_internal.h | 79 + lib/xray/xray_log_interface.cc | 118 + lib/xray/xray_mips.cc | 165 + lib/xray/xray_mips64.cc | 173 + lib/xray/xray_never_instrument.txt | 6 + lib/xray/xray_powerpc64.cc | 106 + lib/xray/xray_powerpc64.inc | 37 + lib/xray/xray_trampoline_AArch64.S | 144 + lib/xray/xray_trampoline_arm.S | 102 + lib/xray/xray_trampoline_mips.S | 110 + lib/xray/xray_trampoline_mips64.S | 136 + lib/xray/xray_trampoline_powerpc64.cc | 15 + lib/xray/xray_trampoline_powerpc64_asm.S | 235 + lib/xray/xray_trampoline_x86_64.S | 237 + lib/xray/xray_tsc.h | 68 + lib/xray/xray_utils.cc | 126 + lib/xray/xray_utils.h | 41 + lib/xray/xray_x86_64.cc | 276 + lib/xray/xray_x86_64.inc | 33 + test/BlocksRuntime/block-static.c | 25 + test/BlocksRuntime/blockimport.c | 51 + test/BlocksRuntime/byrefaccess.c | 34 + test/BlocksRuntime/byrefcopy.c | 41 + test/BlocksRuntime/byrefcopycopy.c | 46 + test/BlocksRuntime/byrefcopyinner.c | 32 + test/BlocksRuntime/byrefcopyint.c | 69 + test/BlocksRuntime/byrefcopystack.c | 41 + test/BlocksRuntime/byrefsanity.c | 73 + test/BlocksRuntime/byrefstruct.c | 57 + test/BlocksRuntime/c99.c | 20 + test/BlocksRuntime/cast.c | 37 + test/BlocksRuntime/constassign.c | 28 + .../copy-block-literal-rdar6439600.c | 29 + test/BlocksRuntime/copyconstructor.C | 85 + test/BlocksRuntime/copynull.c | 37 + test/BlocksRuntime/dispatch_async.c | 57 + .../dispatch_call_Block_with_release.c | 31 + test/BlocksRuntime/fail.c | 107 + test/BlocksRuntime/flagsisa.c | 21 + test/BlocksRuntime/globalexpression.c | 42 + test/BlocksRuntime/goto.c | 34 + test/BlocksRuntime/hasdescriptor.c | 29 + test/BlocksRuntime/josh.C | 32 + test/BlocksRuntime/k-and-r.c | 33 + test/BlocksRuntime/large-struct.c | 51 + test/BlocksRuntime/localisglobal.c | 42 + test/BlocksRuntime/macro.c | 14 + test/BlocksRuntime/makefile | 70 + test/BlocksRuntime/modglobal.c | 18 + test/BlocksRuntime/nestedimport.c | 44 + test/BlocksRuntime/nullblockisa.c | 43 + test/BlocksRuntime/objectRRGC.c | 77 + test/BlocksRuntime/objectassign.c | 76 + test/BlocksRuntime/orbars.c | 23 + test/BlocksRuntime/rdar6396238.c | 32 + test/BlocksRuntime/rdar6405500.c | 29 + test/BlocksRuntime/rdar6414583.c | 31 + test/BlocksRuntime/recursive-block.c | 55 + test/BlocksRuntime/recursive-test.c | 74 + test/BlocksRuntime/recursiveassign.c | 44 + test/BlocksRuntime/reference.C | 95 + test/BlocksRuntime/rettypepromotion.c | 36 + test/BlocksRuntime/returnfunctionptr.c | 23 + test/BlocksRuntime/shorthandexpression.c | 24 + test/BlocksRuntime/sizeof.c | 26 + test/BlocksRuntime/small-struct.c | 45 + test/BlocksRuntime/structmember.c | 45 + test/BlocksRuntime/testfilerunner.h | 110 + test/BlocksRuntime/testfilerunner.m | 805 + test/BlocksRuntime/varargs-bad-assign.c | 44 + test/BlocksRuntime/varargs.c | 39 + test/BlocksRuntime/variadic.c | 66 + test/BlocksRuntime/voidarg.c | 27 + test/CMakeLists.txt | 97 + test/asan/CMakeLists.txt | 176 + test/asan/TestCases/Android/lit.local.cfg | 11 + test/asan/TestCases/Darwin/abort_on_error.cc | 19 + .../TestCases/Darwin/address-range-limit.mm | 41 + .../TestCases/Darwin/asan_gen_prefixes.cc | 16 + .../Darwin/atos-symbolizer-dyld-root-path.cc | 30 + test/asan/TestCases/Darwin/atos-symbolizer.cc | 27 + .../TestCases/Darwin/crashlog-stacktraces.c | 48 + .../Darwin/cstring_literals_regtest.mm | 23 + test/asan/TestCases/Darwin/cstring_section.c | 17 + test/asan/TestCases/Darwin/dead-strip.c | 23 + .../TestCases/Darwin/dladdr-demangling.cc | 36 + test/asan/TestCases/Darwin/dump_registers.cc | 26 + .../Darwin/dyld_insert_libraries_reexec.cc | 46 + .../Darwin/dyld_insert_libraries_remove.cc | 45 + test/asan/TestCases/Darwin/empty-section.cc | 12 + test/asan/TestCases/Darwin/fclose.c | 13 + test/asan/TestCases/Darwin/getpwnam.c | 15 + .../TestCases/Darwin/haswell-symbolication.cc | 100 + .../Darwin/interface_symbols_darwin.cc | 36 + test/asan/TestCases/Darwin/linked-only.cc | 33 + test/asan/TestCases/Darwin/lit.local.cfg | 9 + .../TestCases/Darwin/malloc_destroy_zone.cc | 21 + .../Darwin/malloc_set_zone_name-mprotect.cc | 52 + .../TestCases/Darwin/malloc_size_crash.mm | 15 + .../TestCases/Darwin/malloc_zone-protected.cc | 20 + .../Darwin/mixing-global-constructors.cc | 42 + .../TestCases/Darwin/nil-return-struct.mm | 31 + test/asan/TestCases/Darwin/objc-odr.mm | 23 + test/asan/TestCases/Darwin/odr-lto.cc | 45 + .../Darwin/reexec-insert-libraries-env.cc | 27 + .../TestCases/Darwin/sandbox-symbolizer.cc | 32 + test/asan/TestCases/Darwin/scribble.cc | 58 + test/asan/TestCases/Darwin/segv_read_write.c | 26 + .../TestCases/Darwin/suppressions-darwin.cc | 36 + .../TestCases/Darwin/suppressions-function.cc | 28 + .../TestCases/Darwin/suppressions-sandbox.cc | 30 + .../Darwin/unset-insert-libraries-on-exec.cc | 27 + test/asan/TestCases/Darwin/uuid.cc | 31 + .../asan/TestCases/Helpers/blacklist-extra.cc | 5 + test/asan/TestCases/Helpers/echo-env.cc | 19 + .../Helpers/init-order-atexit-extra.cc | 16 + .../Helpers/initialization-blacklist-extra.cc | 15 + .../initialization-blacklist-extra2.cc | 4 + .../Helpers/initialization-blacklist.txt | 3 + .../Helpers/initialization-bug-extra.cc | 5 + .../Helpers/initialization-bug-extra2.cc | 6 + .../Helpers/initialization-constexpr-extra.cc | 3 + .../Helpers/initialization-nobug-extra.cc | 9 + test/asan/TestCases/Helpers/lit.local.cfg | 3 + test/asan/TestCases/Helpers/underflow.cc | 1 + test/asan/TestCases/Linux/abort_on_error.cc | 21 + .../TestCases/Linux/activation-options.cc | 71 + .../TestCases/Linux/aligned_delete_test.cc | 140 + .../TestCases/Linux/allocator_oom_test.cc | 88 + .../Linux/asan-asm-stacktrace-test.cc | 33 + .../Linux/asan_default_suppressions.cc | 7 + test/asan/TestCases/Linux/asan_dlopen_test.cc | 17 + .../asan/TestCases/Linux/asan_prelink_test.cc | 29 + .../TestCases/Linux/asan_preload_test-1.cc | 30 + .../TestCases/Linux/asan_preload_test-2.cc | 24 + .../TestCases/Linux/asan_preload_test-3.cc | 36 + .../TestCases/Linux/asan_rt_confict_test-1.cc | 13 + .../TestCases/Linux/asan_rt_confict_test-2.cc | 25 + .../Linux/auto_memory_profile_test.cc | 32 + test/asan/TestCases/Linux/calloc-preload.c | 36 + test/asan/TestCases/Linux/clang_gcc_abi.cc | 45 + test/asan/TestCases/Linux/clone_test.cc | 45 + test/asan/TestCases/Linux/coverage-missing.cc | 84 + test/asan/TestCases/Linux/cuda_test.cc | 35 + .../Linux/function-sections-are-bad.cc | 41 + .../TestCases/Linux/global-overflow-bfd.cc | 18 + .../TestCases/Linux/global-overflow-lld.cc | 19 + .../Linux/globals-gc-sections-lld.cc | 15 + .../asan/TestCases/Linux/init-order-dlopen.cc | 47 + .../TestCases/Linux/init_fini_sections.cc | 30 + .../Linux/initialization-bug-any-order.cc | 36 + .../Linux/interception_malloc_test.cc | 23 + .../Linux/interception_readdir_r_test.cc | 62 + .../asan/TestCases/Linux/interception_test.cc | 22 + .../Linux/interface_symbols_linux.cc | 32 + test/asan/TestCases/Linux/kernel-area.cc | 23 + test/asan/TestCases/Linux/leak.cc | 16 + test/asan/TestCases/Linux/leak_check_segv.cc | 23 + test/asan/TestCases/Linux/lit.local.cfg | 9 + test/asan/TestCases/Linux/local_alias.cc | 43 + test/asan/TestCases/Linux/longjmp_chk.c | 51 + test/asan/TestCases/Linux/malloc-in-qsort.cc | 53 + .../TestCases/Linux/malloc_delete_mismatch.cc | 32 + test/asan/TestCases/Linux/memmem_test.cc | 24 + test/asan/TestCases/Linux/mincore.cc | 34 + .../TestCases/Linux/new_delete_mismatch.cc | 16 + test/asan/TestCases/Linux/nohugepage_test.cc | 107 + test/asan/TestCases/Linux/odr-violation.cc | 61 + test/asan/TestCases/Linux/odr_c_test.c | 28 + .../asan/TestCases/Linux/overflow-in-qsort.cc | 49 + test/asan/TestCases/Linux/preinit_test.cc | 33 + .../TestCases/Linux/preinstalled_signal.cc | 113 + .../Linux/print_memory_profile_test.cc | 39 + test/asan/TestCases/Linux/printf-fortify-1.c | 18 + test/asan/TestCases/Linux/printf-fortify-2.c | 18 + test/asan/TestCases/Linux/printf-fortify-3.c | 22 + test/asan/TestCases/Linux/printf-fortify-4.c | 22 + test/asan/TestCases/Linux/printf-fortify-5.c | 18 + .../Linux/pthread_create_from_constructor.cc | 49 + .../TestCases/Linux/pthread_create_version.cc | 23 + test/asan/TestCases/Linux/ptrace.cc | 132 + test/asan/TestCases/Linux/pvalloc-overflow.cc | 41 + .../TestCases/Linux/quarantine_size_mb.cc | 24 + .../Linux/read_binary_name_regtest.c | 55 + test/asan/TestCases/Linux/recoverable-lsan.cc | 22 + test/asan/TestCases/Linux/recvfrom.cc | 81 + .../TestCases/Linux/release_to_os_test.cc | 54 + test/asan/TestCases/Linux/rlimit_mmap_test.cc | 16 + .../Linux/sanbox_read_proc_self_maps_test.cc | 28 + test/asan/TestCases/Linux/segv_read_write.c | 26 + test/asan/TestCases/Linux/shmctl.cc | 27 + .../Linux/signal_during_stop_the_world.cc | 60 + .../asan/TestCases/Linux/sized_delete_test.cc | 89 + .../Linux/stack-overflow-recovery-mode.cc | 36 + .../TestCases/Linux/stack-overflow-sigbus.cc | 64 + .../TestCases/Linux/stack-trace-dlclose.cc | 44 + test/asan/TestCases/Linux/static_tls.cc | 31 + test/asan/TestCases/Linux/stress_dtls.c | 117 + .../TestCases/Linux/swapcontext_annotation.cc | 206 + test/asan/TestCases/Linux/swapcontext_test.cc | 90 + test/asan/TestCases/Linux/syscalls.cc | 25 + test/asan/TestCases/Linux/textdomain.c | 13 + .../thread_local_quarantine_pthread_join.cc | 56 + .../Linux/thread_local_quarantine_size_kb.cc | 45 + test/asan/TestCases/Linux/uar_signals.cc | 77 + test/asan/TestCases/Linux/unpoison_tls.cc | 35 + test/asan/TestCases/Posix/asan-sigbus.cpp | 42 + .../Posix/asan-symbolize-bad-path.cc | 4 + .../Posix/asan-symbolize-sanity-test.cc | 64 + test/asan/TestCases/Posix/asprintf.cc | 20 + .../Posix/assign_large_valloc_to_global.cc | 6 + test/asan/TestCases/Posix/closed-fds.cc | 35 + .../TestCases/Posix/concurrent_overflow.cc | 33 + test/asan/TestCases/Posix/coverage-fork.cc | 41 + .../Posix/coverage-module-unloaded.cc | 51 + test/asan/TestCases/Posix/coverage-reset.cc | 65 + test/asan/TestCases/Posix/coverage.cc | 76 + .../Posix/current_allocated_bytes.cc | 44 + test/asan/TestCases/Posix/deep_call_stack.cc | 29 + .../asan/TestCases/Posix/deep_thread_stack.cc | 58 + test/asan/TestCases/Posix/dlclose-test.cc | 106 + test/asan/TestCases/Posix/fread_fwrite.cc | 34 + .../asan/TestCases/Posix/free_hook_realloc.cc | 34 + test/asan/TestCases/Posix/freopen.cc | 15 + test/asan/TestCases/Posix/gc-test.cc | 54 + test/asan/TestCases/Posix/glob.cc | 34 + test/asan/TestCases/Posix/glob_test_root/aa | 0 test/asan/TestCases/Posix/glob_test_root/ab | 0 test/asan/TestCases/Posix/glob_test_root/ba | 0 .../TestCases/Posix/global-registration.c | 69 + .../TestCases/Posix/halt_on_error-signals.c | 101 + .../TestCases/Posix/halt_on_error-torture.cc | 80 + .../Posix/halt_on_error_suppress_equal_pcs.cc | 56 + .../TestCases/Posix/handle_abort_on_error.cc | 11 + .../Posix/init-order-pthread-create.cc | 54 + .../Posix/interception-in-shared-lib-test.cc | 27 + .../Posix/invalid-pointer-pairs-threads.cc | 57 + test/asan/TestCases/Posix/ioctl.cc | 24 + .../large_allocator_unpoisons_on_free.cc | 39 + test/asan/TestCases/Posix/lit.local.cfg | 9 + .../Posix/log_path_fork_test.cc.disabled | 22 + test/asan/TestCases/Posix/mmap_limit_mb.cc | 35 + .../TestCases/Posix/new_array_cookie_test.cc | 27 + .../Posix/new_array_cookie_uaf_test.cc | 41 + .../new_array_cookie_with_new_from_class.cc | 40 + .../TestCases/Posix/no_asan_gen_globals.c | 12 + test/asan/TestCases/Posix/print_cmdline.cc | 18 + test/asan/TestCases/Posix/readv.cc | 32 + test/asan/TestCases/Posix/shared-lib-test.cc | 57 + test/asan/TestCases/Posix/stack-overflow.cc | 116 + .../TestCases/Posix/stack-use-after-return.cc | 110 + .../asan/TestCases/Posix/start-deactivated.cc | 147 + test/asan/TestCases/Posix/strchr.c | 34 + test/asan/TestCases/Posix/strerror_r_test.cc | 14 + test/asan/TestCases/Posix/strndup_oob_test.cc | 27 + .../asan/TestCases/Posix/strndup_oob_test2.cc | 22 + test/asan/TestCases/Posix/tsd_dtor_leak.cc | 41 + test/asan/TestCases/Posix/wait.cc | 34 + test/asan/TestCases/Posix/wait3.cc | 36 + test/asan/TestCases/Posix/wait4.cc | 44 + test/asan/TestCases/Posix/waitid.cc | 30 + .../asan/TestCases/Windows/aligned_mallocs.cc | 29 + .../TestCases/Windows/allocators_sanity.cc | 37 + test/asan/TestCases/Windows/beginthreadex.cc | 21 + .../Windows/bind_io_completion_callback.cc | 61 + test/asan/TestCases/Windows/bitfield.cc | 21 + test/asan/TestCases/Windows/bitfield_uaf.cc | 34 + .../asan/TestCases/Windows/calloc_left_oob.cc | 17 + .../TestCases/Windows/calloc_right_oob.cc | 17 + test/asan/TestCases/Windows/calloc_uaf.cc | 20 + test/asan/TestCases/Windows/coverage-basic.cc | 25 + .../TestCases/Windows/coverage-dll-stdio.cc | 16 + .../TestCases/Windows/crash_read_write.cc | 29 + .../TestCases/Windows/crt_initializers.cc | 31 + test/asan/TestCases/Windows/delay_dbghelp.cc | 18 + .../asan/TestCases/Windows/demangled_names.cc | 50 + .../TestCases/Windows/dll_aligned_mallocs.cc | 34 + .../Windows/dll_allocators_sanity.cc | 39 + test/asan/TestCases/Windows/dll_and_lib.cc | 19 + test/asan/TestCases/Windows/dll_cerr.cc | 23 + test/asan/TestCases/Windows/dll_control_c.cc | 130 + .../TestCases/Windows/dll_global_dead_strip.c | 28 + .../TestCases/Windows/dll_heap_allocation.cc | 30 + test/asan/TestCases/Windows/dll_host.cc | 75 + .../TestCases/Windows/dll_intercept_memchr.cc | 27 + .../TestCases/Windows/dll_intercept_memcpy.cc | 32 + .../Windows/dll_intercept_memcpy_indirect.cc | 34 + .../TestCases/Windows/dll_intercept_memset.cc | 32 + .../TestCases/Windows/dll_intercept_strlen.cc | 28 + .../TestCases/Windows/dll_large_function.cc | 12 + .../TestCases/Windows/dll_malloc_left_oob.cc | 23 + test/asan/TestCases/Windows/dll_malloc_uaf.cc | 28 + test/asan/TestCases/Windows/dll_noreturn.cc | 28 + test/asan/TestCases/Windows/dll_null_deref.cc | 18 + .../dll_operator_array_new_left_oob.cc | 25 + ...l_operator_array_new_with_dtor_left_oob.cc | 33 + .../TestCases/Windows/dll_poison_unpoison.cc | 35 + ...report_globals_symbolization_at_startup.cc | 40 + test/asan/TestCases/Windows/dll_seh.cc | 50 + .../Windows/dll_stack_use_after_return.cc | 28 + .../dll_thread_stack_array_left_oob.cc | 36 + test/asan/TestCases/Windows/double_free.cc | 21 + .../Windows/double_operator_delete.cc | 25 + .../TestCases/Windows/free_hook_realloc.cc | 40 + test/asan/TestCases/Windows/fuse-lld.cc | 19 + .../TestCases/Windows/global_const_string.cc | 12 + .../Windows/global_const_string_oob.cc | 20 + .../TestCases/Windows/global_dead_strip.c | 23 + test/asan/TestCases/Windows/hello_world.cc | 9 + .../TestCases/Windows/intercept_memcpy.cc | 31 + .../TestCases/Windows/intercept_strdup.cc | 32 + .../TestCases/Windows/intercept_strlen.cc | 27 + .../Windows/interface_symbols_windows.cc | 53 + test/asan/TestCases/Windows/iostream_sbo.cc | 18 + test/asan/TestCases/Windows/lit.local.cfg | 14 + test/asan/TestCases/Windows/longjmp.cc | 26 + .../asan/TestCases/Windows/malloc_left_oob.cc | 17 + .../TestCases/Windows/malloc_right_oob.cc | 17 + test/asan/TestCases/Windows/malloc_uaf.cc | 20 + test/asan/TestCases/Windows/null_deref.cc | 15 + .../Windows/null_deref_multiple_dlls.cc | 40 + test/asan/TestCases/Windows/oom.cc | 12 + .../Windows/operator_array_new_left_oob.cc | 17 + .../Windows/operator_array_new_right_oob.cc | 18 + .../Windows/operator_array_new_uaf.cc | 24 + .../operator_array_new_with_dtor_left_oob.cc | 25 + .../Windows/operator_delete_wrong_argument.cc | 12 + .../Windows/operator_new_left_oob.cc | 17 + .../Windows/operator_new_right_oob.cc | 17 + .../TestCases/Windows/operator_new_uaf.cc | 22 + .../TestCases/Windows/queue_user_work_item.cc | 51 + .../Windows/queue_user_work_item_report.cc | 27 + .../TestCases/Windows/realloc_left_oob.cc | 17 + .../TestCases/Windows/realloc_right_oob.cc | 17 + test/asan/TestCases/Windows/realloc_uaf.cc | 20 + .../Windows/report_after_syminitialize.cc | 25 + .../Windows/report_globals_reload_dll.cc | 51 + .../Windows/report_globals_vs_freelibrary.cc | 47 + test/asan/TestCases/Windows/seh.cc | 58 + .../TestCases/Windows/shadow_conflict_32.cc | 29 + .../Windows/shadow_mapping_failure.cc | 18 + .../TestCases/Windows/stack_array_left_oob.cc | 16 + .../Windows/stack_array_right_oob.cc | 16 + .../TestCases/Windows/stack_array_sanity.cc | 12 + .../Windows/stack_use_after_return.cc | 22 + test/asan/TestCases/Windows/symbols_path.cc | 22 + test/asan/TestCases/Windows/thread_simple.cc | 26 + .../Windows/thread_stack_array_left_oob.cc | 27 + .../Windows/thread_stack_array_right_oob.cc | 27 + .../TestCases/Windows/thread_stack_reuse.cc | 37 + test/asan/TestCases/Windows/thread_stress.cc | 30 + .../TestCases/Windows/thread_suspended.cc | 27 + test/asan/TestCases/Windows/tls_init.cc | 51 + test/asan/TestCases/Windows/unsymbolized.cc | 25 + .../TestCases/Windows/use_after_realloc.cc | 23 + .../Windows/use_after_return_linkage.cc | 12 + test/asan/TestCases/Windows/windows_h.cc | 7 + .../Windows/wrong_downcast_on_heap.cc | 26 + .../Windows/wrong_downcast_on_stack.cc | 26 + test/asan/TestCases/alloca_big_alignment.cc | 18 + test/asan/TestCases/alloca_constant_size.cc | 53 + .../TestCases/alloca_detect_custom_size_.cc | 23 + .../alloca_instruments_all_paddings.cc | 24 + .../asan/TestCases/alloca_loop_unpoisoning.cc | 38 + .../asan/TestCases/alloca_overflow_partial.cc | 18 + test/asan/TestCases/alloca_overflow_right.cc | 18 + test/asan/TestCases/alloca_safe_access.cc | 17 + test/asan/TestCases/alloca_underflow_left.cc | 18 + test/asan/TestCases/alloca_vla_interact.cc | 45 + test/asan/TestCases/allocator_returns_null.cc | 131 + .../TestCases/asan_and_llvm_coverage_test.cc | 12 + test/asan/TestCases/asan_options-help.cc | 9 + test/asan/TestCases/atexit_stats.cc | 18 + test/asan/TestCases/atoi_strict.c | 55 + test/asan/TestCases/atol_strict.c | 55 + test/asan/TestCases/atoll_strict.c | 58 + test/asan/TestCases/blacklist.cc | 38 + test/asan/TestCases/contiguous_container.cc | 83 + .../TestCases/contiguous_container_crash.cc | 53 + test/asan/TestCases/coverage-and-lsan.cc | 20 + test/asan/TestCases/coverage-disabled.cc | 15 + test/asan/TestCases/coverage-trace-pc.cc | 31 + test/asan/TestCases/debug_double_free.cc | 50 + test/asan/TestCases/debug_locate.cc | 80 + test/asan/TestCases/debug_mapping.cc | 30 + test/asan/TestCases/debug_ppc64_mapping.cc | 44 + test/asan/TestCases/debug_report.cc | 66 + test/asan/TestCases/debug_stacks.cc | 74 + test/asan/TestCases/deep_stack_uaf.cc | 35 + test/asan/TestCases/deep_tail_call.cc | 20 + test/asan/TestCases/default_blacklist.cc | 7 + test/asan/TestCases/default_options.cc | 18 + test/asan/TestCases/describe_address.cc | 19 + test/asan/TestCases/double-free.cc | 31 + test/asan/TestCases/error_report_callback.cc | 21 + test/asan/TestCases/exitcode.cc | 130 + test/asan/TestCases/force_inline_opt0.cc | 14 + test/asan/TestCases/frexp_interceptor.cc | 16 + test/asan/TestCases/global-address.cpp | 12 + test/asan/TestCases/global-demangle.cc | 17 + test/asan/TestCases/global-location.cc | 38 + test/asan/TestCases/global-overflow.cc | 21 + test/asan/TestCases/global-underflow.cc | 17 + test/asan/TestCases/halt_on_error-1.c | 29 + test/asan/TestCases/heap-overflow-large.cc | 23 + test/asan/TestCases/heap-overflow.cc | 24 + test/asan/TestCases/heavy_uar_test.cc | 70 + test/asan/TestCases/huge_negative_hea_oob.cc | 13 + test/asan/TestCases/ill.cc | 31 + test/asan/TestCases/init-order-atexit.cc | 31 + .../TestCases/initialization-blacklist.cc | 29 + test/asan/TestCases/initialization-bug.cc | 51 + .../TestCases/initialization-constexpr.cc | 27 + test/asan/TestCases/initialization-nobug.cc | 48 + test/asan/TestCases/inline.cc | 19 + .../TestCases/interception_failure_test.cc | 31 + test/asan/TestCases/interface_test.cc | 10 + test/asan/TestCases/intra-object-overflow.cc | 33 + test/asan/TestCases/invalid-free.cc | 22 + .../invalid-pointer-pairs-compare-errors.cc | 103 + .../invalid-pointer-pairs-compare-success.cc | 74 + .../invalid-pointer-pairs-subtract-errors.cc | 48 + .../invalid-pointer-pairs-subtract-success.cc | 33 + test/asan/TestCases/invalid-pointer-pairs.cc | 44 + test/asan/TestCases/large_func_test.cc | 52 + test/asan/TestCases/log-path_test.cc | 48 + test/asan/TestCases/longjmp.cc | 25 + test/asan/TestCases/lsan_annotations.cc | 16 + test/asan/TestCases/malloc-no-intercept.c | 27 + test/asan/TestCases/malloc_context_size.cc | 27 + test/asan/TestCases/malloc_fill.cc | 22 + test/asan/TestCases/max_redzone.cc | 26 + test/asan/TestCases/memcmp_strict_test.cc | 15 + test/asan/TestCases/memcmp_test.cc | 17 + test/asan/TestCases/memset_test.cc | 71 + test/asan/TestCases/non-executable-pc.cpp | 33 + test/asan/TestCases/null_deref.cc | 24 + test/asan/TestCases/on_error_callback.cc | 20 + test/asan/TestCases/partial_right.cc | 13 + test/asan/TestCases/pass-object-byval.cc | 40 + test/asan/TestCases/pass-struct-byval-uar.cc | 38 + test/asan/TestCases/pass-struct-byval.cc | 23 + test/asan/TestCases/poison_partial.cc | 19 + test/asan/TestCases/pr33372.cc | 39 + test/asan/TestCases/print_summary.cc | 16 + test/asan/TestCases/printf-1.c | 25 + test/asan/TestCases/printf-2.c | 27 + test/asan/TestCases/printf-3.c | 26 + test/asan/TestCases/printf-4.c | 25 + test/asan/TestCases/printf-5.c | 25 + test/asan/TestCases/printf-m.c | 14 + test/asan/TestCases/realloc.cc | 21 + test/asan/TestCases/sanity_check_pure_c.c | 20 + test/asan/TestCases/scariness_score_test.cc | 212 + test/asan/TestCases/set_shadow_test.c | 69 + test/asan/TestCases/sleep_after_init.c | 10 + test/asan/TestCases/sleep_before_dying.c | 10 + test/asan/TestCases/small_memcpy_test.cc | 29 + test/asan/TestCases/speculative_load.cc | 54 + test/asan/TestCases/speculative_load2.cc | 24 + .../stack-buffer-overflow-with-position.cc | 45 + test/asan/TestCases/stack-buffer-overflow.cc | 16 + test/asan/TestCases/stack-frame-demangle.cc | 22 + test/asan/TestCases/stack-oob-frames.cc | 59 + test/asan/TestCases/strcasestr-1.c | 25 + test/asan/TestCases/strcasestr-2.c | 25 + test/asan/TestCases/strcasestr_strict.c | 28 + test/asan/TestCases/strcat_strict.c | 44 + test/asan/TestCases/strchr_strict.c | 22 + test/asan/TestCases/strcmp_strict.c | 26 + test/asan/TestCases/strcspn-1.c | 20 + test/asan/TestCases/strcspn-2.c | 20 + test/asan/TestCases/strcspn_strict.c | 26 + test/asan/TestCases/strdup_oob_test.cc | 31 + test/asan/TestCases/strip_path_prefix.c | 12 + test/asan/TestCases/strncasecmp_strict.c | 67 + test/asan/TestCases/strncat_strict.c | 44 + test/asan/TestCases/strncmp_strict.c | 65 + test/asan/TestCases/strncpy-overflow.cc | 29 + test/asan/TestCases/strpbrk-1.c | 20 + test/asan/TestCases/strpbrk-2.c | 20 + test/asan/TestCases/strpbrk_strict.c | 25 + test/asan/TestCases/strspn-1.c | 20 + test/asan/TestCases/strspn-2.c | 20 + test/asan/TestCases/strspn_strict.c | 25 + test/asan/TestCases/strstr-1.c | 21 + test/asan/TestCases/strstr-2.c | 21 + test/asan/TestCases/strstr_strict.c | 25 + test/asan/TestCases/strtok.c | 103 + test/asan/TestCases/strtol_strict.c | 136 + test/asan/TestCases/strtoll_strict.c | 120 + .../suppressions-exec-relative-location.cc | 48 + test/asan/TestCases/suppressions-function.cc | 35 + .../TestCases/suppressions-interceptor.cc | 24 + test/asan/TestCases/suppressions-library.cc | 42 + test/asan/TestCases/throw_call_test.cc | 49 + test/asan/TestCases/throw_catch.cc | 61 + test/asan/TestCases/throw_invoke_test.cc | 51 + test/asan/TestCases/time_interceptor.cc | 22 + test/asan/TestCases/uar_and_exceptions.cc | 40 + .../TestCases/unaligned_loads_and_stores.cc | 52 + test/asan/TestCases/use-after-delete.cc | 30 + test/asan/TestCases/use-after-free-right.cc | 35 + test/asan/TestCases/use-after-free.cc | 35 + test/asan/TestCases/use-after-poison.cc | 20 + .../asan/TestCases/use-after-scope-capture.cc | 17 + .../TestCases/use-after-scope-conversion.cc | 50 + .../TestCases/use-after-scope-dtor-order.cc | 26 + test/asan/TestCases/use-after-scope-goto.cc | 73 + test/asan/TestCases/use-after-scope-if.cc | 15 + .../asan/TestCases/use-after-scope-inlined.cc | 28 + .../TestCases/use-after-scope-loop-bug.cc | 17 + .../TestCases/use-after-scope-loop-removed.cc | 18 + test/asan/TestCases/use-after-scope-loop.cc | 14 + test/asan/TestCases/use-after-scope-nobug.cc | 16 + test/asan/TestCases/use-after-scope-temp.cc | 21 + test/asan/TestCases/use-after-scope-temp2.cc | 20 + test/asan/TestCases/use-after-scope-types.cc | 74 + test/asan/TestCases/use-after-scope.cc | 21 + test/asan/TestCases/verbose-log-path_test.cc | 25 + test/asan/TestCases/vla_chrome_testcase.cc | 30 + test/asan/TestCases/vla_condition_overflow.cc | 22 + test/asan/TestCases/vla_loop_overfow.cc | 22 + test/asan/TestCases/zero_page_pc.cc | 16 + test/asan/Unit/lit.site.cfg.in | 32 + test/asan/lit.cfg | 216 + test/asan/lit.site.cfg.in | 17 + test/builtins/CMakeLists.txt | 42 + test/builtins/TestCases/Darwin/lit.local.cfg | 9 + .../TestCases/Darwin/os_version_check_test.c | 19 + ...os_version_check_test_no_core_foundation.c | 12 + test/builtins/Unit/absvdi2_test.c | 66 + test/builtins/Unit/absvsi2_test.c | 66 + test/builtins/Unit/absvti2_test.c | 85 + test/builtins/Unit/adddf3vfp_test.c | 50 + test/builtins/Unit/addsf3vfp_test.c | 50 + test/builtins/Unit/addtf3_test.c | 83 + test/builtins/Unit/addvdi3_test.c | 59 + test/builtins/Unit/addvsi3_test.c | 59 + test/builtins/Unit/addvti3_test.c | 95 + test/builtins/Unit/arm/aeabi_cdcmpeq_test.c | 73 + test/builtins/Unit/arm/aeabi_cdcmple_test.c | 96 + test/builtins/Unit/arm/aeabi_cfcmpeq_test.c | 73 + test/builtins/Unit/arm/aeabi_cfcmple_test.c | 96 + test/builtins/Unit/arm/aeabi_drsub_test.c | 49 + test/builtins/Unit/arm/aeabi_frsub_test.c | 49 + test/builtins/Unit/arm/aeabi_idivmod_test.c | 82 + test/builtins/Unit/arm/aeabi_uidivmod_test.c | 69 + test/builtins/Unit/arm/aeabi_uldivmod_test.c | 20659 +++++ test/builtins/Unit/arm/call_apsr.S | 43 + test/builtins/Unit/arm/call_apsr.h | 39 + test/builtins/Unit/ashldi3_test.c | 78 + test/builtins/Unit/ashlti3_test.c | 176 + test/builtins/Unit/ashrdi3_test.c | 119 + test/builtins/Unit/ashrti3_test.c | 174 + test/builtins/Unit/bswapdi2_test.c | 37 + test/builtins/Unit/bswapsi2_test.c | 37 + test/builtins/Unit/clear_cache_test.c | 87 + test/builtins/Unit/clzdi2_test.c | 69 + test/builtins/Unit/clzsi2_test.c | 600 + test/builtins/Unit/clzti2_test.c | 91 + test/builtins/Unit/cmpdi2_test.c | 78 + test/builtins/Unit/cmpti2_test.c | 113 + test/builtins/Unit/comparedf2_test.c | 481 + test/builtins/Unit/comparesf2_test.c | 481 + test/builtins/Unit/cpu_model_test.c | 30 + test/builtins/Unit/ctzdi2_test.c | 68 + test/builtins/Unit/ctzsi2_test.c | 570 + test/builtins/Unit/ctzti2_test.c | 85 + test/builtins/Unit/divdc3_test.c | 374 + test/builtins/Unit/divdf3vfp_test.c | 50 + test/builtins/Unit/divdi3_test.c | 59 + test/builtins/Unit/divmodsi4_test.c | 74 + test/builtins/Unit/divsc3_test.c | 374 + test/builtins/Unit/divsf3vfp_test.c | 50 + test/builtins/Unit/divsi3_test.c | 57 + test/builtins/Unit/divtc3_test.c | 377 + test/builtins/Unit/divtf3_test.c | 96 + test/builtins/Unit/divti3_test.c | 79 + test/builtins/Unit/divxc3_test.c | 385 + .../builtins/Unit/enable_execute_stack_test.c | 58 + test/builtins/Unit/endianness.h | 109 + test/builtins/Unit/eqdf2vfp_test.c | 57 + test/builtins/Unit/eqsf2vfp_test.c | 53 + test/builtins/Unit/eqtf2_test.c | 90 + test/builtins/Unit/extebdsfdf2vfp_test.c | 50 + test/builtins/Unit/extenddftf2_test.c | 84 + test/builtins/Unit/extendhfsf2_test.c | 114 + test/builtins/Unit/extendsftf2_test.c | 85 + test/builtins/Unit/ffsdi2_test.c | 67 + test/builtins/Unit/ffssi2_test.c | 57 + test/builtins/Unit/ffsti2_test.c | 84 + test/builtins/Unit/fixdfdi_test.c | 95 + test/builtins/Unit/fixdfsivfp_test.c | 52 + test/builtins/Unit/fixdfti_test.c | 124 + test/builtins/Unit/fixsfdi_test.c | 85 + test/builtins/Unit/fixsfsivfp_test.c | 54 + test/builtins/Unit/fixsfti_test.c | 112 + test/builtins/Unit/fixtfdi_test.c | 72 + test/builtins/Unit/fixtfsi_test.c | 66 + test/builtins/Unit/fixtfti_test.c | 84 + test/builtins/Unit/fixunsdfdi_test.c | 107 + test/builtins/Unit/fixunsdfsi_test.c | 103 + test/builtins/Unit/fixunsdfsivfp_test.c | 52 + test/builtins/Unit/fixunsdfti_test.c | 132 + test/builtins/Unit/fixunssfdi_test.c | 96 + test/builtins/Unit/fixunssfsi_test.c | 96 + test/builtins/Unit/fixunssfsivfp_test.c | 52 + test/builtins/Unit/fixunssfti_test.c | 121 + test/builtins/Unit/fixunstfdi_test.c | 125 + test/builtins/Unit/fixunstfsi_test.c | 68 + test/builtins/Unit/fixunstfti_test.c | 106 + test/builtins/Unit/fixunsxfdi_test.c | 125 + test/builtins/Unit/fixunsxfsi_test.c | 106 + test/builtins/Unit/fixunsxfti_test.c | 144 + test/builtins/Unit/fixxfdi_test.c | 116 + test/builtins/Unit/fixxfti_test.c | 149 + test/builtins/Unit/floatdidf_test.c | 138 + test/builtins/Unit/floatdisf_test.c | 96 + test/builtins/Unit/floatditf_test.c | 70 + test/builtins/Unit/floatdixf_test.c | 145 + test/builtins/Unit/floatsidfvfp_test.c | 52 + test/builtins/Unit/floatsisfvfp_test.c | 52 + test/builtins/Unit/floatsitf_test.c | 62 + test/builtins/Unit/floattidf_test.c | 181 + test/builtins/Unit/floattisf_test.c | 137 + test/builtins/Unit/floattitf_test.c | 214 + test/builtins/Unit/floattixf_test.c | 215 + test/builtins/Unit/floatundidf_test.c | 133 + test/builtins/Unit/floatundisf_test.c | 97 + test/builtins/Unit/floatunditf_test.c | 68 + test/builtins/Unit/floatundixf_test.c | 146 + test/builtins/Unit/floatunsitf_test.c | 57 + test/builtins/Unit/floatunssidfvfp_test.c | 52 + test/builtins/Unit/floatunssisfvfp_test.c | 51 + test/builtins/Unit/floatuntidf_test.c | 175 + test/builtins/Unit/floatuntisf_test.c | 166 + test/builtins/Unit/floatuntitf_test.c | 221 + test/builtins/Unit/floatuntixf_test.c | 222 + test/builtins/Unit/fp_test.h | 279 + test/builtins/Unit/gcc_personality_test.c | 45 + .../Unit/gcc_personality_test_helper.cxx | 85 + test/builtins/Unit/gedf2vfp_test.c | 55 + test/builtins/Unit/gesf2vfp_test.c | 55 + test/builtins/Unit/getf2_test.c | 90 + test/builtins/Unit/gtdf2vfp_test.c | 55 + test/builtins/Unit/gtsf2vfp_test.c | 55 + test/builtins/Unit/gttf2_test.c | 90 + test/builtins/Unit/ledf2vfp_test.c | 55 + test/builtins/Unit/lesf2vfp_test.c | 55 + test/builtins/Unit/letf2_test.c | 90 + test/builtins/Unit/lit.cfg | 87 + test/builtins/Unit/lit.site.cfg.in | 12 + test/builtins/Unit/lshrdi3_test.c | 119 + test/builtins/Unit/lshrti3_test.c | 174 + test/builtins/Unit/ltdf2vfp_test.c | 53 + test/builtins/Unit/ltsf2vfp_test.c | 55 + test/builtins/Unit/lttf2_test.c | 90 + test/builtins/Unit/moddi3_test.c | 63 + test/builtins/Unit/modsi3_test.c | 58 + test/builtins/Unit/modti3_test.c | 96 + test/builtins/Unit/muldc3_test.c | 370 + test/builtins/Unit/muldf3vfp_test.c | 52 + test/builtins/Unit/muldi3_test.c | 111 + test/builtins/Unit/mulodi4_test.c | 179 + test/builtins/Unit/mulosi4_test.c | 157 + test/builtins/Unit/muloti4_test.c | 281 + test/builtins/Unit/mulsc3_test.c | 374 + test/builtins/Unit/mulsf3vfp_test.c | 52 + test/builtins/Unit/multc3_test.c | 376 + test/builtins/Unit/multf3_test.c | 97 + test/builtins/Unit/multi3_test.c | 135 + test/builtins/Unit/mulvdi3_test.c | 176 + test/builtins/Unit/mulvsi3_test.c | 149 + test/builtins/Unit/mulvti3_test.c | 261 + test/builtins/Unit/mulxc3_test.c | 381 + test/builtins/Unit/nedf2vfp_test.c | 53 + test/builtins/Unit/negdf2vfp_test.c | 50 + test/builtins/Unit/negdi2_test.c | 85 + test/builtins/Unit/negsf2vfp_test.c | 50 + test/builtins/Unit/negti2_test.c | 128 + test/builtins/Unit/negvdi2_test.c | 58 + test/builtins/Unit/negvsi2_test.c | 57 + test/builtins/Unit/negvti2_test.c | 110 + test/builtins/Unit/nesf2vfp_test.c | 53 + test/builtins/Unit/netf2_test.c | 90 + test/builtins/Unit/paritydi2_test.c | 52 + test/builtins/Unit/paritysi2_test.c | 51 + test/builtins/Unit/parityti2_test.c | 65 + test/builtins/Unit/popcountdi2_test.c | 64 + test/builtins/Unit/popcountsi2_test.c | 63 + test/builtins/Unit/popcountti2_test.c | 83 + test/builtins/Unit/powidf2_test.c | 225 + test/builtins/Unit/powisf2_test.c | 225 + test/builtins/Unit/powitf2_test.c | 234 + test/builtins/Unit/powixf2_test.c | 235 + test/builtins/Unit/ppc/DD.h | 14 + test/builtins/Unit/ppc/fixtfdi_test.c | 479 + test/builtins/Unit/ppc/floatditf_test.c | 32 + test/builtins/Unit/ppc/floatditf_test.h | 38018 +++++++++ test/builtins/Unit/ppc/floatunditf_test.c | 32 + test/builtins/Unit/ppc/floatunditf_test.h | 19014 +++++ test/builtins/Unit/ppc/qadd_test.c | 1874 + test/builtins/Unit/ppc/qdiv_test.c | 797 + test/builtins/Unit/ppc/qmul_test.c | 795 + test/builtins/Unit/ppc/qsub_test.c | 1876 + test/builtins/Unit/ppc/test | 18 + test/builtins/Unit/subdf3vfp_test.c | 50 + test/builtins/Unit/subsf3vfp_test.c | 50 + test/builtins/Unit/subtf3_test.c | 76 + test/builtins/Unit/subvdi3_test.c | 61 + test/builtins/Unit/subvsi3_test.c | 61 + test/builtins/Unit/subvti3_test.c | 81 + test/builtins/Unit/test | 68 + test/builtins/Unit/trampoline_setup_test.c | 64 + test/builtins/Unit/truncdfhf2_test.c | 116 + test/builtins/Unit/truncdfsf2_test.c | 40 + test/builtins/Unit/truncdfsf2vfp_test.c | 52 + test/builtins/Unit/truncsfhf2_test.c | 116 + test/builtins/Unit/trunctfdf2_test.c | 78 + test/builtins/Unit/trunctfsf2_test.c | 77 + test/builtins/Unit/ucmpdi2_test.c | 76 + test/builtins/Unit/ucmpti2_test.c | 117 + test/builtins/Unit/udivdi3_test.c | 45 + test/builtins/Unit/udivmoddi4_test.c | 20640 +++++ test/builtins/Unit/udivmodsi4_test.c | 60 + test/builtins/Unit/udivmodti4_test.c | 65354 ++++++++++++++++ test/builtins/Unit/udivsi3_test.c | 176 + test/builtins/Unit/udivti3_test.c | 68 + test/builtins/Unit/umoddi3_test.c | 45 + test/builtins/Unit/umodsi3_test.c | 176 + test/builtins/Unit/umodti3_test.c | 66 + test/builtins/Unit/unorddf2vfp_test.c | 51 + test/builtins/Unit/unordsf2vfp_test.c | 51 + test/builtins/Unit/unordtf2_test.c | 66 + test/builtins/lit.cfg | 20 + test/builtins/lit.site.cfg.in | 7 + test/builtins/timing/ashldi3.c | 49 + test/builtins/timing/ashrdi3.c | 49 + test/builtins/timing/divdi3.c | 52 + test/builtins/timing/floatdidf.c | 47 + test/builtins/timing/floatdisf.c | 47 + test/builtins/timing/floatdixf.c | 47 + test/builtins/timing/floatundidf.c | 44 + test/builtins/timing/floatundisf.c | 47 + test/builtins/timing/floatundixf.c | 47 + test/builtins/timing/lshrdi3.c | 49 + test/builtins/timing/moddi3.c | 52 + test/builtins/timing/modsi3.c | 52 + test/builtins/timing/muldi3.c | 52 + test/builtins/timing/negdi2.c | 50 + test/builtins/timing/time | 39 + test/builtins/timing/timing.h | 28 + test/builtins/timing/udivdi3.c | 52 + test/builtins/timing/umoddi3.c | 52 + test/cfi/CMakeLists.txt | 98 + test/cfi/README.txt | 8 + test/cfi/anon-namespace.cpp | 91 + test/cfi/bad-cast.cpp | 137 + test/cfi/bad-split.cpp | 21 + test/cfi/base-derived-destructor.cpp | 93 + test/cfi/create-derivers.test | 21 + test/cfi/cross-dso/icall/diag.cpp | 159 + test/cfi/cross-dso/icall/dlopen.cpp | 147 + test/cfi/cross-dso/icall/icall-from-dso.cpp | 34 + test/cfi/cross-dso/icall/icall.cpp | 29 + test/cfi/cross-dso/icall/lit.local.cfg | 3 + test/cfi/cross-dso/lit.local.cfg | 13 + test/cfi/cross-dso/shadow_is_read_only.cpp | 88 + test/cfi/cross-dso/simple-fail.cpp | 101 + test/cfi/cross-dso/simple-pass.cpp | 65 + test/cfi/cross-dso/stats.cpp | 65 + test/cfi/cross-dso/target_out_of_bounds.cpp | 64 + test/cfi/cross-dso/util/cfi_stubs.h | 30 + test/cfi/icall/bad-signature.c | 27 + test/cfi/icall/external-call.c | 28 + test/cfi/icall/lit.local.cfg | 3 + test/cfi/icall/weak.c | 15 + test/cfi/icall/wrong-signature-mixed-lto.c | 41 + test/cfi/lit.cfg | 46 + test/cfi/lit.site.cfg.in | 12 + test/cfi/multiple-inheritance.cpp | 74 + test/cfi/nvcall.cpp | 59 + test/cfi/overwrite.cpp | 64 + test/cfi/sibling.cpp | 54 + test/cfi/simple-fail.cpp | 101 + test/cfi/simple-pass.cpp | 121 + test/cfi/stats.cpp | 55 + test/cfi/target_uninstrumented.cpp | 45 + test/cfi/two-vcalls.cpp | 60 + test/cfi/utils.h | 67 + test/cfi/vdtor.cpp | 56 + test/cfi/vtable-may-alias.cpp | 25 + test/dfsan/CMakeLists.txt | 31 + test/dfsan/Inputs/flags_abilist.txt | 10 + test/dfsan/basic.c | 28 + test/dfsan/custom.cc | 965 + test/dfsan/dump_labels.c | 69 + test/dfsan/flags.c | 24 + test/dfsan/fncall.c | 26 + test/dfsan/label_count.c | 75 + test/dfsan/lit.cfg | 26 + test/dfsan/lit.site.cfg.in | 12 + test/dfsan/propagate.c | 47 + test/dfsan/vararg.c | 24 + test/dfsan/write_callback.c | 111 + test/esan/CMakeLists.txt | 32 + test/esan/TestCases/large-stack-linux.c | 74 + test/esan/TestCases/libc-intercept.c | 20 + test/esan/TestCases/mmap-shadow-conflict.c | 44 + test/esan/TestCases/struct-simple.cpp | 204 + test/esan/TestCases/verbose-simple.c | 18 + test/esan/TestCases/workingset-early-fault.c | 33 + test/esan/TestCases/workingset-memset.cpp | 20 + test/esan/TestCases/workingset-midreport.cpp | 74 + test/esan/TestCases/workingset-samples.cpp | 46 + .../TestCases/workingset-signal-posix.cpp | 75 + test/esan/TestCases/workingset-simple.cpp | 33 + test/esan/Unit/circular_buffer.cpp | 61 + test/esan/Unit/hashtable.cpp | 179 + test/esan/lit.cfg | 44 + test/esan/lit.site.cfg.in | 14 + test/fuzzer/AFLDriverTest.cpp | 28 + test/fuzzer/AbsNegAndConstant64Test.cpp | 24 + test/fuzzer/AbsNegAndConstantTest.cpp | 24 + test/fuzzer/AccumulateAllocationsTest.cpp | 17 + test/fuzzer/BadStrcmpTest.cpp | 19 + test/fuzzer/BogusInitializeTest.cpp | 15 + test/fuzzer/BufferOverflowOnInput.cpp | 24 + test/fuzzer/CMakeLists.txt | 43 + test/fuzzer/CallerCalleeTest.cpp | 59 + test/fuzzer/CleanseTest.cpp | 16 + test/fuzzer/CounterTest.cpp | 18 + test/fuzzer/CustomCrossOverAndMutateTest.cpp | 34 + test/fuzzer/CustomCrossOverTest.cpp | 59 + test/fuzzer/CustomMutatorTest.cpp | 39 + test/fuzzer/CxxStringEqTest.cpp | 25 + test/fuzzer/DSO1.cpp | 14 + test/fuzzer/DSO2.cpp | 14 + test/fuzzer/DSOTestExtra.cpp | 11 + test/fuzzer/DSOTestMain.cpp | 31 + test/fuzzer/DeepRecursionTest.cpp | 25 + test/fuzzer/DivTest.cpp | 20 + test/fuzzer/EmptyTest.cpp | 11 + test/fuzzer/EquivalenceATest.cpp | 17 + test/fuzzer/EquivalenceBTest.cpp | 27 + test/fuzzer/FlagsTest.cpp | 32 + test/fuzzer/FourIndependentBranchesTest.cpp | 22 + test/fuzzer/FullCoverageSetTest.cpp | 24 + test/fuzzer/GcSectionsTest.cpp | 14 + test/fuzzer/InitializeTest.cpp | 29 + test/fuzzer/LargeTest.cpp | 37 + test/fuzzer/LeakTest.cpp | 17 + test/fuzzer/LeakTimeoutTest.cpp | 17 + test/fuzzer/LoadTest.cpp | 22 + test/fuzzer/Memcmp64BytesTest.cpp | 20 + test/fuzzer/MemcmpTest.cpp | 31 + test/fuzzer/NotinstrumentedTest.cpp | 11 + test/fuzzer/NthRunCrashTest.cpp | 19 + test/fuzzer/NullDerefOnEmptyTest.cpp | 19 + test/fuzzer/NullDerefTest.cpp | 26 + test/fuzzer/OneHugeAllocTest.cpp | 28 + .../OutOfMemorySingleLargeMallocTest.cpp | 27 + test/fuzzer/OutOfMemoryTest.cpp | 31 + test/fuzzer/OverwriteInputTest.cpp | 13 + test/fuzzer/PrintFuncTest.cpp | 39 + test/fuzzer/RepeatedBytesTest.cpp | 31 + test/fuzzer/RepeatedMemcmp.cpp | 24 + test/fuzzer/ShrinkControlFlowSimpleTest.cpp | 19 + test/fuzzer/ShrinkControlFlowTest.cpp | 31 + test/fuzzer/ShrinkValueProfileTest.cpp | 22 + test/fuzzer/SignedIntOverflowTest.cpp | 28 + test/fuzzer/SimpleCmpTest.cpp | 47 + test/fuzzer/SimpleDictionaryTest.cpp | 30 + test/fuzzer/SimpleHashTest.cpp | 40 + test/fuzzer/SimpleTest.cpp | 28 + test/fuzzer/SimpleThreadedTest.cpp | 26 + test/fuzzer/SingleByteInputTest.cpp | 17 + test/fuzzer/SingleMemcmpTest.cpp | 17 + test/fuzzer/SingleStrcmpTest.cpp | 21 + test/fuzzer/SingleStrncmpTest.cpp | 18 + test/fuzzer/SleepOneSecondTest.cpp | 13 + test/fuzzer/SpamyTest.cpp | 21 + test/fuzzer/StrcmpTest.cpp | 32 + test/fuzzer/StrncmpOOBTest.cpp | 21 + test/fuzzer/StrncmpTest.cpp | 28 + test/fuzzer/StrstrTest.cpp | 28 + test/fuzzer/SwapCmpTest.cpp | 35 + test/fuzzer/Switch2Test.cpp | 35 + test/fuzzer/SwitchTest.cpp | 58 + test/fuzzer/TableLookupTest.cpp | 44 + test/fuzzer/ThreadedLeakTest.cpp | 18 + test/fuzzer/ThreadedTest.cpp | 26 + test/fuzzer/TimeoutEmptyTest.cpp | 14 + test/fuzzer/TimeoutTest.cpp | 26 + test/fuzzer/TraceMallocTest.cpp | 27 + test/fuzzer/TraceMallocThreadedTest.cpp | 22 + test/fuzzer/TwoDifferentBugsTest.cpp | 22 + test/fuzzer/afl-driver-extra-stats.test | 30 + test/fuzzer/afl-driver-stderr.test | 12 + test/fuzzer/afl-driver.test | 29 + test/fuzzer/bad-strcmp.test | 2 + test/fuzzer/caller-callee.test | 3 + test/fuzzer/cleanse.test | 4 + test/fuzzer/coverage.test | 21 + test/fuzzer/cxxstring.test | 6 + test/fuzzer/deep-recursion.test | 5 + test/fuzzer/dict1.txt | 4 + test/fuzzer/disable-leaks.test | 5 + test/fuzzer/dump_coverage.test | 20 + test/fuzzer/equivalence-signals.test | 9 + test/fuzzer/equivalence.test | 9 + test/fuzzer/exit-report.test | 6 + test/fuzzer/exit_on_src_pos.test | 8 + test/fuzzer/extra-counters.test | 7 + test/fuzzer/fprofile-instr-generate.test | 7 + test/fuzzer/fuzzer-customcrossover.test | 12 + .../fuzzer-customcrossoverandmutate.test | 2 + test/fuzzer/fuzzer-custommutator.test | 5 + test/fuzzer/fuzzer-dict.test | 8 + test/fuzzer/fuzzer-dirs.test | 21 + test/fuzzer/fuzzer-fdmask.test | 32 + test/fuzzer/fuzzer-finalstats.test | 12 + test/fuzzer/fuzzer-flags.test | 19 + test/fuzzer/fuzzer-leak.test | 41 + test/fuzzer/fuzzer-oom-with-profile.test | 7 + test/fuzzer/fuzzer-oom.test | 22 + test/fuzzer/fuzzer-printcovpcs.test | 9 + test/fuzzer/fuzzer-runs.test | 9 + test/fuzzer/fuzzer-seed.test | 4 + test/fuzzer/fuzzer-segv.test | 8 + test/fuzzer/fuzzer-singleinputs.test | 19 + test/fuzzer/fuzzer-threaded.test | 8 + test/fuzzer/fuzzer-timeout.test | 21 + test/fuzzer/fuzzer-ubsan.test | 5 + test/fuzzer/fuzzer.test | 70 + test/fuzzer/gc-sections.test | 13 + test/fuzzer/hi.txt | 1 + test/fuzzer/inline-8bit-counters.test | 4 + test/fuzzer/lit.cfg | 79 + test/fuzzer/lit.site.cfg.in | 17 + test/fuzzer/max-number-of-runs.test | 10 + test/fuzzer/memcmp.test | 3 + test/fuzzer/memcmp64.test | 3 + test/fuzzer/merge-control-file.test | 57 + test/fuzzer/merge-posix.test | 23 + test/fuzzer/merge-sigusr.test | 25 + test/fuzzer/merge-summary.test | 17 + test/fuzzer/merge.test | 70 + test/fuzzer/minimize_crash.test | 16 + test/fuzzer/minimize_two_crashes.test | 18 + test/fuzzer/overwrite-input.test | 3 + test/fuzzer/print-func.test | 10 + test/fuzzer/recommended-dictionary.test | 6 + test/fuzzer/reduce_inputs.test | 16 + test/fuzzer/repeated-bytes.test | 3 + test/fuzzer/shrink.test | 10 + test/fuzzer/sigusr.test | 13 + test/fuzzer/simple-cmp.test | 3 + test/fuzzer/standalone.test | 8 + test/fuzzer/strcmp.test | 4 + test/fuzzer/strncmp.test | 4 + test/fuzzer/strstr.test | 4 + test/fuzzer/swap-cmp.test | 3 + test/fuzzer/trace-malloc-2.test | 10 + test/fuzzer/trace-malloc-threaded.test | 36 + test/fuzzer/trace-malloc-unbalanced.test | 27 + test/fuzzer/trace-malloc.test | 7 + test/fuzzer/trace-pc.test | 3 + test/fuzzer/ulimit.test | 3 + test/fuzzer/unit/lit.site.cfg.in | 9 + test/fuzzer/value-profile-cmp.test | 3 + test/fuzzer/value-profile-cmp2.test | 3 + test/fuzzer/value-profile-cmp3.test | 3 + test/fuzzer/value-profile-cmp4.test | 3 + test/fuzzer/value-profile-div.test | 4 + test/fuzzer/value-profile-load.test | 3 + test/fuzzer/value-profile-mem.test | 3 + test/fuzzer/value-profile-set.test | 4 + test/fuzzer/value-profile-strcmp.test | 3 + test/fuzzer/value-profile-strncmp.test | 3 + test/fuzzer/value-profile-switch.test | 5 + test/hwasan/CMakeLists.txt | 29 + test/hwasan/TestCases/halt-on-error.cc | 42 + test/hwasan/TestCases/use-after-free.cc | 39 + test/hwasan/lit.cfg | 32 + test/hwasan/lit.site.cfg.in | 12 + test/interception/CMakeLists.txt | 17 + test/interception/Unit/lit.site.cfg.in | 14 + test/lit.common.cfg | 345 + test/lit.common.configured.in | 54 + test/lsan/CMakeLists.txt | 39 + test/lsan/TestCases/Darwin/dispatch.mm | 59 + test/lsan/TestCases/Darwin/lit.local.cfg | 9 + .../Linux/cleanup_in_tsd_destructor.c | 46 + .../Linux/disabler_in_tsd_destructor.c | 39 + test/lsan/TestCases/Linux/fork.cc | 24 + test/lsan/TestCases/Linux/fork_threaded.cc | 43 + test/lsan/TestCases/Linux/guard-page.c | 61 + test/lsan/TestCases/Linux/lit.local.cfg | 9 + test/lsan/TestCases/Linux/use_tls_dynamic.cc | 52 + .../Linux/use_tls_pthread_specific_dynamic.cc | 38 + .../Linux/use_tls_pthread_specific_static.cc | 32 + test/lsan/TestCases/Linux/use_tls_static.cc | 22 + test/lsan/TestCases/allocator_returns_null.cc | 131 + test/lsan/TestCases/default_options.cc | 11 + test/lsan/TestCases/disabler.c | 24 + test/lsan/TestCases/disabler.cc | 25 + test/lsan/TestCases/do_leak_check_override.cc | 36 + .../TestCases/high_allocator_contention.cc | 49 + test/lsan/TestCases/ignore_object.c | 23 + test/lsan/TestCases/ignore_object_errors.cc | 20 + test/lsan/TestCases/large_allocation_leak.cc | 23 + test/lsan/TestCases/leak_check_at_exit.cc | 21 + .../leak_check_before_thread_started.cc | 40 + test/lsan/TestCases/link_turned_off.cc | 26 + test/lsan/TestCases/many_tls_keys.cc | 97 + test/lsan/TestCases/new_array_with_dtor_0.cc | 19 + test/lsan/TestCases/pointer_to_self.cc | 19 + test/lsan/TestCases/print_suppressions.cc | 33 + test/lsan/TestCases/recoverable_leak_check.cc | 34 + test/lsan/TestCases/register_root_region.cc | 32 + test/lsan/TestCases/sanity_check_pure_c.c | 10 + test/lsan/TestCases/stale_stack_leak.cc | 47 + test/lsan/TestCases/strace_test.cc | 15 + test/lsan/TestCases/suppressions_default.cc | 28 + test/lsan/TestCases/suppressions_file.cc | 32 + test/lsan/TestCases/swapcontext.cc | 48 + test/lsan/TestCases/use_after_return.cc | 24 + .../lsan/TestCases/use_globals_initialized.cc | 22 + .../TestCases/use_globals_uninitialized.cc | 22 + test/lsan/TestCases/use_poisoned_asan.cc | 26 + test/lsan/TestCases/use_registers.cc | 68 + test/lsan/TestCases/use_stacks.cc | 21 + test/lsan/TestCases/use_stacks_threaded.cc | 38 + test/lsan/TestCases/use_unaligned.cc | 24 + test/lsan/lit.common.cfg | 80 + test/lsan/lit.site.cfg.in | 13 + test/msan/CMakeLists.txt | 58 + test/msan/Linux/cmsghdr.cc | 101 + test/msan/Linux/eventfd.cc | 18 + test/msan/Linux/fopencookie.cc | 65 + test/msan/Linux/forkpty.cc | 25 + test/msan/Linux/getresid.cc | 25 + test/msan/Linux/glob.cc | 27 + test/msan/Linux/glob_altdirfunc.cc | 78 + test/msan/Linux/glob_nomatch.cc | 21 + test/msan/Linux/glob_test_root/aa | 0 test/msan/Linux/glob_test_root/ab | 0 test/msan/Linux/glob_test_root/ba | 0 test/msan/Linux/ioctl_sound.cc | 29 + test/msan/Linux/lit.local.cfg | 9 + test/msan/Linux/mallinfo.cc | 13 + test/msan/Linux/mincore.cc | 36 + test/msan/Linux/obstack.cc | 37 + test/msan/Linux/poll.cc | 42 + test/msan/Linux/process_vm_readv.cc | 75 + test/msan/Linux/sendmsg.cc | 96 + test/msan/Linux/strerror_r.cc | 18 + test/msan/Linux/sunrpc.cc | 40 + test/msan/Linux/sunrpc_bytes.cc | 38 + test/msan/Linux/sunrpc_string.cc | 35 + test/msan/Linux/syscalls.cc | 127 + test/msan/Linux/syscalls_sigaction.cc | 48 + test/msan/Linux/tcgetattr.cc | 21 + test/msan/Linux/xattr.cc | 145 + test/msan/Linux/xattr_test_root/a | 0 test/msan/Unit/lit.site.cfg.in | 13 + test/msan/__strxfrm_l.cc | 19 + test/msan/alloca.cc | 25 + test/msan/allocator_mapping.cc | 36 + test/msan/allocator_returns_null.cc | 131 + test/msan/backtrace.cc | 26 + test/msan/c-strdup.c | 17 + test/msan/chained_origin.cc | 67 + test/msan/chained_origin_empty_stack.cc | 34 + test/msan/chained_origin_limits.cc | 186 + test/msan/chained_origin_memcpy.cc | 62 + test/msan/chained_origin_with_signals.cc | 36 + test/msan/check_mem_is_initialized.cc | 33 + test/msan/coverage-levels.cc | 28 + test/msan/ctermid.cc | 13 + test/msan/cxa_atexit.cc | 28 + test/msan/death-callback.cc | 39 + test/msan/default_blacklist.cc | 3 + test/msan/dlerror.cc | 14 + test/msan/dlopen_executable.cc | 17 + test/msan/dso-origin.cc | 48 + test/msan/dtls_test.c | 60 + test/msan/dtor-base-access.cc | 49 + test/msan/dtor-bit-fields.cc | 70 + test/msan/dtor-derived-class.cc | 39 + test/msan/dtor-member.cc | 48 + ...le-inheritance-nontrivial-class-members.cc | 152 + test/msan/dtor-multiple-inheritance.cc | 98 + test/msan/dtor-trivial-class-members.cc | 55 + test/msan/dtor-trivial.cpp | 41 + test/msan/dtor-vtable-multiple-inheritance.cc | 72 + test/msan/dtor-vtable.cc | 68 + test/msan/errno.cc | 17 + test/msan/fork.cc | 124 + test/msan/fread_fwrite.cc | 34 + test/msan/ftime.cc | 17 + test/msan/getaddrinfo-positive.cc | 23 + test/msan/getaddrinfo.cc | 24 + test/msan/getc_unlocked.c | 32 + test/msan/getline.cc | 40 + test/msan/getloadavg.cc | 16 + test/msan/getutent.cc | 17 + test/msan/heap-origin.cc | 31 + test/msan/icmp_slt_allones.cc | 20 + test/msan/iconv.cc | 53 + test/msan/if_indextoname.cc | 23 + test/msan/ifaddrs.cc | 54 + test/msan/initgroups.cc | 12 + test/msan/inline.cc | 20 + test/msan/insertvalue_origin.cc | 35 + test/msan/ioctl.cc | 20 + test/msan/ioctl_custom.cc | 33 + test/msan/lit.cfg | 41 + test/msan/lit.site.cfg.in | 14 + test/msan/memcmp_test.cc | 18 + test/msan/mktime.cc | 26 + test/msan/mmap.cc | 79 + test/msan/mmap_below_shadow.cc | 42 + test/msan/msan_check_mem_is_initialized.cc | 28 + test/msan/msan_copy_shadow.cc | 35 + test/msan/msan_dump_shadow.cc | 22 + test/msan/msan_print_shadow.cc | 122 + test/msan/msan_print_shadow2.cc | 49 + test/msan/msan_print_shadow3.cc | 16 + test/msan/mul_by_const.cc | 27 + test/msan/no_sanitize_memory.cc | 34 + test/msan/no_sanitize_memory_prop.cc | 24 + test/msan/origin-store-long.cc | 21 + test/msan/param_tls_limit.cc | 89 + test/msan/poison_in_free.cc | 16 + test/msan/pr32842.c | 22 + test/msan/print_stats.cc | 45 + test/msan/pthread_getattr_np_deadlock.cc | 22 + test/msan/pthread_getname_np.cc | 34 + test/msan/pthread_setcancelstate.cc | 19 + test/msan/pvalloc.cc | 43 + test/msan/rand_r.cc | 18 + test/msan/readdir64.cc | 27 + test/msan/realloc-large-origin.cc | 31 + test/msan/realloc-origin.cc | 21 + test/msan/recover-dso.cc | 39 + test/msan/recover.cc | 41 + test/msan/report-demangling.cc | 19 + test/msan/scandir.cc | 56 + test/msan/scandir_null.cc | 34 + test/msan/scandir_test_root/aaa | 0 test/msan/scandir_test_root/aab | 0 test/msan/scandir_test_root/bbb | 0 test/msan/select.cc | 22 + test/msan/select_float_origin.cc | 24 + test/msan/select_origin.cc | 22 + test/msan/sem_getvalue.cc | 22 + test/msan/setlocale.cc | 13 + test/msan/sigaction.cc | 47 + test/msan/signal_stress_test.cc | 71 + test/msan/sigwait.cc | 35 + test/msan/sigwaitinfo.cc | 31 + test/msan/stack-origin.cc | 31 + test/msan/stack-origin2.cc | 41 + test/msan/strerror_r-non-gnu.c | 18 + test/msan/strlen_of_shadow.cc | 36 + test/msan/strndup.cc | 28 + test/msan/strxfrm.cc | 22 + test/msan/sync_lock_set_and_test.cc | 7 + test/msan/test.h | 15 + test/msan/textdomain.cc | 12 + test/msan/times.cc | 20 + test/msan/tls_reuse.cc | 26 + test/msan/tsearch.cc | 39 + test/msan/tzset.cc | 16 + test/msan/unaligned_read_origin.cc | 16 + test/msan/unpoison_string.cc | 16 + test/msan/use-after-dtor.cc | 45 + test/msan/use-after-free.cc | 34 + test/msan/vector_cvt.cc | 24 + test/msan/vector_select.cc | 21 + test/msan/wcsncpy.cc | 40 + test/profile/CMakeLists.txt | 29 + test/profile/Inputs/comdat_rename.h | 13 + test/profile/Inputs/comdat_rename_1.cc | 33 + test/profile/Inputs/comdat_rename_2.cc | 18 + test/profile/Inputs/extern_template.cpp | 14 + test/profile/Inputs/extern_template.h | 17 + test/profile/Inputs/extern_template1.cpp | 9 + test/profile/Inputs/extern_template2.cpp | 9 + test/profile/Inputs/gcc-flag-compatibility.c | 8 + test/profile/Inputs/instrprof-alloc.c | 41 + test/profile/Inputs/instrprof-comdat-1.cpp | 17 + test/profile/Inputs/instrprof-comdat-2.cpp | 12 + test/profile/Inputs/instrprof-comdat.h | 23 + .../Inputs/instrprof-dlopen-dlclose-main.c | 26 + test/profile/Inputs/instrprof-dlopen-func.c | 1 + test/profile/Inputs/instrprof-dlopen-func2.c | 1 + test/profile/Inputs/instrprof-dlopen-main.c | 47 + test/profile/Inputs/instrprof-dynamic-a.cpp | 7 + test/profile/Inputs/instrprof-dynamic-b.cpp | 7 + .../profile/Inputs/instrprof-dynamic-header.h | 7 + .../profile/Inputs/instrprof-dynamic-main.cpp | 9 + test/profile/Inputs/instrprof-file_ex.c | 59 + test/profile/Inputs/instrprof-icall-promo.h | 4 + .../profile/Inputs/instrprof-icall-promo_1.cc | 7 + .../profile/Inputs/instrprof-icall-promo_2.cc | 15 + .../Inputs/instrprof-merge-match-lib.c | 39 + test/profile/Inputs/instrprof-merge-match.c | 54 + test/profile/Inputs/instrprof-shared-lib.c | 9 + test/profile/Inputs/instrprof-shared-main.c | 13 + .../Inputs/instrprof-value-prof-evict.c | 141 + .../Inputs/instrprof-value-prof-real.c | 1096 + .../Inputs/instrprof-visibility-helper.cpp | 3 + test/profile/Linux/comdat_rename.test | 6 + test/profile/Linux/counter_promo_for.c | 59 + test/profile/Linux/counter_promo_nest.c | 48 + test/profile/Linux/counter_promo_while.c | 55 + test/profile/Linux/coverage_ctors.cpp | 32 + test/profile/Linux/coverage_dtor.cpp | 26 + test/profile/Linux/coverage_shared.test | 16 + test/profile/Linux/coverage_test.cpp | 35 + test/profile/Linux/extern_template.test | 29 + test/profile/Linux/instrprof-alloc.test | 6 + test/profile/Linux/instrprof-basic.c | 31 + test/profile/Linux/instrprof-comdat.test | 6 + test/profile/Linux/instrprof-cs.c | 35 + test/profile/Linux/instrprof-dir.c | 13 + test/profile/Linux/instrprof-dlopen.test | 34 + .../Linux/instrprof-dynamic-one-shared.test | 23 + .../Linux/instrprof-dynamic-two-shared.test | 24 + test/profile/Linux/instrprof-file_ex.test | 17 + test/profile/Linux/instrprof-merge-vp.c | 113 + .../Linux/instrprof-value-prof-warn.test | 8 + test/profile/Linux/lit.local.cfg | 40 + test/profile/gcc-flag-compatibility.test | 18 + test/profile/infinite_loop.c | 30 + test/profile/instrprof-basic.c | 74 + test/profile/instrprof-bufferio.c | 129 + test/profile/instrprof-darwin-dead-strip.c | 61 + .../instrprof-dlopen-dlclose-gcov.test | 6 + test/profile/instrprof-dlopen.test | 34 + test/profile/instrprof-dump.c | 62 + .../profile/instrprof-dynamic-one-shared.test | 23 + .../profile/instrprof-dynamic-two-shared.test | 24 + test/profile/instrprof-error.c | 9 + test/profile/instrprof-hostname.c | 14 + test/profile/instrprof-icall-promo.test | 17 + test/profile/instrprof-merge-match.test | 5 + test/profile/instrprof-merge.c | 96 + ...rof-override-filename-then-reset-default.c | 19 + .../instrprof-override-filename-with-env.c | 14 + test/profile/instrprof-override-filename.c | 24 + test/profile/instrprof-path.c | 39 + test/profile/instrprof-reset-counters.c | 19 + .../instrprof-set-filename-shared.test | 8 + ...nstrprof-set-filename-then-reset-default.c | 18 + test/profile/instrprof-set-filename.c | 57 + test/profile/instrprof-shared.test | 75 + test/profile/instrprof-value-prof-2.c | 150 + test/profile/instrprof-value-prof-evict.test | 16 + test/profile/instrprof-value-prof-reset.c | 47 + test/profile/instrprof-value-prof-shared.test | 52 + test/profile/instrprof-value-prof.c | 228 + test/profile/instrprof-value-prof.test | 21 + test/profile/instrprof-version-mismatch.c | 11 + test/profile/instrprof-visibility-kinds.inc | 36 + test/profile/instrprof-visibility.cpp | 89 + test/profile/instrprof-without-libc.c | 70 + .../instrprof-write-file-atexit-explicitly.c | 17 + test/profile/instrprof-write-file-only.c | 35 + test/profile/instrprof-write-file.c | 34 + test/profile/lit.cfg | 77 + test/profile/lit.site.cfg.in | 12 + test/profile/runtime_infinite.c | 36 + test/safestack/CMakeLists.txt | 29 + test/safestack/buffer-copy-vla.c | 26 + test/safestack/buffer-copy.c | 25 + test/safestack/canary.c | 38 + test/safestack/init.c | 9 + test/safestack/lit.cfg | 22 + test/safestack/lit.site.cfg.in | 7 + test/safestack/lto.c | 12 + test/safestack/overflow.c | 29 + test/safestack/pthread-cleanup.c | 31 + test/safestack/pthread.c | 42 + test/safestack/utils.h | 8 + test/sanitizer_common/CMakeLists.txt | 59 + .../TestCases/Darwin/abort_on_error.cc | 19 + .../TestCases/Darwin/lit.local.cfg | 9 + .../TestCases/Darwin/print-stack-trace.cc | 19 + .../TestCases/Linux/abort_on_error.cc | 23 + .../TestCases/Linux/aligned_alloc.c | 8 + .../TestCases/Linux/allow_user_segv.cc | 90 + .../TestCases/Linux/assert.cc | 27 + .../TestCases/Linux/clock_gettime.c | 11 + .../TestCases/Linux/closedir.c | 5 + .../TestCases/Linux/decorate_proc_maps.cc | 65 + .../TestCases/Linux/deepbind.cc | 12 + .../Linux/getpwnam_r_invalid_user.cc | 20 + .../TestCases/Linux/hard_rss_limit_mb_test.cc | 41 + .../TestCases/Linux/iconv_test.c | 31 + test/sanitizer_common/TestCases/Linux/ill.cc | 29 + .../TestCases/Linux/lit.local.cfg | 9 + .../TestCases/Linux/mlock_test.cc | 13 + .../TestCases/Linux/mprobe.cc | 42 + .../TestCases/Linux/new_delete_test.cc | 80 + .../TestCases/Linux/open_memstream.cc | 70 + .../TestCases/Linux/ptrace.cc | 127 + .../TestCases/Linux/recv_msg_trunc.cc | 36 + .../TestCases/Linux/sched_getparam.cc | 13 + .../TestCases/Linux/sem_init_glibc.cc | 62 + .../TestCases/Linux/signal_segv_handler.cc | 57 + .../TestCases/Linux/soft_rss_limit_mb_test.cc | 68 + .../Linux/sysconf_interceptor_bypass_test.cc | 27 + .../TestCases/Linux/timerfd.cc | 52 + .../Linux/unexpected_format_specifier_test.cc | 13 + .../Posix/dedup_token_length_test.cc | 34 + .../TestCases/Posix/dump_instruction_bytes.cc | 23 + .../TestCases/Posix/dump_registers.cc | 20 + test/sanitizer_common/TestCases/Posix/fpe.cc | 29 + .../TestCases/Posix/getpass.cc | 40 + .../TestCases/Posix/lit.local.cfg | 9 + .../sanitizer_set_death_callback_test.cc | 48 + .../Posix/sanitizer_set_report_fd_test.cc | 34 + .../TestCases/Posix/weak_hook_test.cc | 83 + test/sanitizer_common/TestCases/corelimit.cc | 16 + .../TestCases/fopen_nullptr.c | 6 + .../TestCases/get_module_and_offset_for_pc.cc | 65 + .../sanitizer_common/TestCases/malloc_hook.cc | 61 + .../TestCases/options-help.cc | 8 + .../TestCases/options-include.cc | 49 + .../TestCases/options-invalid.cc | 15 + .../TestCases/print-stack-trace.cc | 26 + test/sanitizer_common/TestCases/printf-ldbl.c | 13 + .../TestCases/pthread_mutexattr_get.cc | 19 + .../sanitizer_coverage_inline8bit_counter.cc | 43 + .../TestCases/sanitizer_coverage_no_prune.cc | 16 + .../sanitizer_coverage_stack_depth.cc | 32 + .../TestCases/sanitizer_coverage_symbolize.cc | 28 + .../sanitizer_coverage_trace_pc_guard-dso.cc | 74 + .../sanitizer_coverage_trace_pc_guard-init.cc | 73 + .../sanitizer_coverage_trace_pc_guard.cc | 41 + test/sanitizer_common/TestCases/scanf-ldbl.c | 13 + test/sanitizer_common/TestCases/strcasestr.c | 16 + test/sanitizer_common/TestCases/strcspn.c | 13 + test/sanitizer_common/TestCases/strnlen.c | 12 + test/sanitizer_common/TestCases/strpbrk.c | 14 + test/sanitizer_common/TestCases/strspn.c | 13 + test/sanitizer_common/TestCases/strstr.c | 12 + .../TestCases/symbolize_pc.cc | 40 + .../TestCases/symbolize_stack.cc | 28 + test/sanitizer_common/Unit/lit.site.cfg.in | 14 + .../android_commands/android_common.py | 46 + .../android_commands/android_compile.py | 36 + .../android_commands/android_run.py | 39 + .../ios_commands/iossim_compile.py | 32 + .../ios_commands/iossim_env.py | 17 + .../ios_commands/iossim_run.py | 18 + test/sanitizer_common/lit.common.cfg | 63 + test/sanitizer_common/lit.site.cfg.in | 14 + test/sanitizer_common/print_address.h | 21 + test/scudo/CMakeLists.txt | 41 + test/scudo/alignment.c | 23 + test/scudo/double-free.cpp | 45 + test/scudo/interface.cpp | 92 + test/scudo/lit.cfg | 61 + test/scudo/lit.site.cfg.in | 11 + test/scudo/malloc.cpp | 37 + test/scudo/memalign.c | 81 + test/scudo/mismatch.cpp | 47 + test/scudo/options.cpp | 25 + test/scudo/overflow.c | 39 + test/scudo/preinit.c | 40 + test/scudo/preload.cpp | 20 + test/scudo/quarantine.c | 124 + test/scudo/random_shuffle.cpp | 23 + test/scudo/realloc.cpp | 90 + test/scudo/rss.c | 56 + test/scudo/secondary.c | 53 + test/scudo/sized-delete.cpp | 41 + test/scudo/sizes.cpp | 73 + test/scudo/threads.c | 65 + test/scudo/tsd_destruction.c | 42 + test/scudo/valloc.c | 65 + test/tsan/CMakeLists.txt | 103 + test/tsan/Darwin/deadlock.mm | 47 + test/tsan/Darwin/debug_external.cc | 64 + test/tsan/Darwin/dispatch_main.mm | 38 + test/tsan/Darwin/dispatch_once_deadlock.mm | 41 + test/tsan/Darwin/dlopen.cc | 43 + test/tsan/Darwin/external-dups.cc | 58 + .../Darwin/external-ignore-noninstrumented.cc | 19 + test/tsan/Darwin/external-lib.cc | 68 + .../Darwin/external-noninstrumented-module.cc | 27 + test/tsan/Darwin/external-swift.cc | 92 + test/tsan/Darwin/external.cc | 105 + test/tsan/Darwin/gcd-after-null.mm | 23 + test/tsan/Darwin/gcd-after.mm | 41 + test/tsan/Darwin/gcd-apply-race.mm | 30 + test/tsan/Darwin/gcd-apply.mm | 48 + test/tsan/Darwin/gcd-async-norace.mm | 26 + test/tsan/Darwin/gcd-async-race.mm | 38 + test/tsan/Darwin/gcd-barrier-race.mm | 48 + test/tsan/Darwin/gcd-barrier.mm | 49 + test/tsan/Darwin/gcd-blocks.mm | 34 + test/tsan/Darwin/gcd-data.mm | 36 + test/tsan/Darwin/gcd-fd.mm | 60 + test/tsan/Darwin/gcd-groups-destructor.mm | 43 + test/tsan/Darwin/gcd-groups-leave.mm | 56 + test/tsan/Darwin/gcd-groups-norace.mm | 53 + test/tsan/Darwin/gcd-groups-stress.mm | 43 + test/tsan/Darwin/gcd-io-barrier-race.mm | 55 + test/tsan/Darwin/gcd-io-barrier.mm | 48 + test/tsan/Darwin/gcd-io-cleanup.mm | 56 + test/tsan/Darwin/gcd-io-race.mm | 56 + test/tsan/Darwin/gcd-io.mm | 117 + test/tsan/Darwin/gcd-once.mm | 55 + test/tsan/Darwin/gcd-semaphore-norace.mm | 29 + test/tsan/Darwin/gcd-serial-queue-norace.mm | 40 + test/tsan/Darwin/gcd-source-cancel.mm | 36 + test/tsan/Darwin/gcd-source-cancel2.mm | 38 + test/tsan/Darwin/gcd-source-event.mm | 35 + test/tsan/Darwin/gcd-source-event2.mm | 37 + test/tsan/Darwin/gcd-source-registration.mm | 33 + test/tsan/Darwin/gcd-source-registration2.mm | 35 + test/tsan/Darwin/gcd-source-serial.mm | 33 + test/tsan/Darwin/gcd-suspend.mm | 45 + test/tsan/Darwin/gcd-sync-norace.mm | 32 + test/tsan/Darwin/gcd-sync-race.mm | 44 + test/tsan/Darwin/gcd-target-queue-norace.mm | 41 + test/tsan/Darwin/ignore-noninstrumented.mm | 53 + test/tsan/Darwin/ignored-interceptors.mm | 55 + test/tsan/Darwin/libcxx-call-once.mm | 34 + test/tsan/Darwin/libcxx-future.mm | 30 + .../Darwin/libcxx-shared-ptr-recursive.mm | 36 + test/tsan/Darwin/libcxx-shared-ptr-stress.mm | 75 + test/tsan/Darwin/libcxx-shared-ptr.mm | 50 + test/tsan/Darwin/lit.local.cfg | 11 + test/tsan/Darwin/main_tid.mm | 46 + test/tsan/Darwin/malloc-stack-logging.cc | 24 + test/tsan/Darwin/malloc_size.mm | 57 + test/tsan/Darwin/norace-objcxx-run-time.mm | 113 + test/tsan/Darwin/objc-double-property.mm | 21 + test/tsan/Darwin/objc-race.mm | 55 + test/tsan/Darwin/objc-simple.mm | 13 + test/tsan/Darwin/osatomics-add.mm | 48 + test/tsan/Darwin/osatomics-bitops.mm | 34 + test/tsan/Darwin/osatomics-list.mm | 43 + test/tsan/Darwin/osspinlock-norace.cc | 34 + test/tsan/Darwin/realloc-zero.cc | 20 + test/tsan/Darwin/signals-blocked.cc | 75 + test/tsan/Darwin/symbolizer-atos.cc | 26 + test/tsan/Darwin/symbolizer-dladdr.cc | 27 + test/tsan/Darwin/workerthreads.mm | 43 + test/tsan/Darwin/xpc-cancel.mm | 39 + test/tsan/Darwin/xpc-race.mm | 92 + test/tsan/Darwin/xpc.mm | 76 + test/tsan/Linux/check_memcpy.cc | 17 + test/tsan/Linux/check_preinit.cc | 60 + test/tsan/Linux/double_race.cc | 52 + test/tsan/Linux/lit.local.cfg | 9 + test/tsan/Linux/mutex_robust.cc | 36 + test/tsan/Linux/mutex_robust2.cc | 41 + test/tsan/Linux/pie_no_aslr.cc | 6 + test/tsan/Linux/user_fopen.cc | 34 + test/tsan/Linux/user_malloc.cc | 35 + test/tsan/Unit/lit.site.cfg.in | 23 + test/tsan/aligned_vs_unaligned_race.cc | 35 + test/tsan/allocator_returns_null.cc | 124 + test/tsan/annotate_happens_before.cc | 57 + test/tsan/atexit.cc | 29 + test/tsan/atexit2.cc | 26 + test/tsan/atexit3.cc | 41 + test/tsan/atomic_free.cc | 31 + test/tsan/atomic_free2.cc | 20 + test/tsan/atomic_free3.cc | 28 + test/tsan/atomic_hle.cc | 25 + test/tsan/atomic_norace.cc | 62 + test/tsan/atomic_race.cc | 81 + test/tsan/atomic_stack.cc | 30 + test/tsan/atomic_store.cc | 49 + test/tsan/barrier.cc | 40 + test/tsan/bench.h | 59 + test/tsan/bench_acquire_only.cc | 22 + test/tsan/bench_acquire_release.cc | 21 + test/tsan/bench_local_mutex.cc | 30 + test/tsan/bench_mutex.cc | 31 + test/tsan/bench_release_only.cc | 26 + test/tsan/bench_rwmutex.cc | 28 + test/tsan/bench_shadow_flush.cc | 48 + test/tsan/bench_single_writer.cc | 26 + test/tsan/bench_ten_mutexes.cc | 29 + test/tsan/benign_race.cc | 39 + test/tsan/blacklist.cc | 30 + test/tsan/blacklist2.cc | 49 + test/tsan/cond.c | 53 + test/tsan/cond_cancel.c | 51 + test/tsan/cond_destruction.cc | 53 + test/tsan/cond_race.cc | 39 + test/tsan/cond_version.c | 47 + test/tsan/custom_mutex.h | 93 + test/tsan/custom_mutex0.cc | 31 + test/tsan/custom_mutex1.cc | 39 + test/tsan/custom_mutex2.cc | 34 + test/tsan/custom_mutex3.cc | 46 + test/tsan/custom_mutex4.cc | 33 + test/tsan/custom_mutex5.cc | 33 + test/tsan/deadlock_detector_stress_test.cc | 625 + test/tsan/debug_alloc_stack.cc | 84 + test/tsan/debug_locate.cc | 43 + test/tsan/debugging.cc | 109 + test/tsan/deep_stack1.cc | 57 + test/tsan/default_options.cc | 32 + test/tsan/deflake.bash | 17 + test/tsan/dl_iterate_phdr.cc | 57 + test/tsan/dlclose.cc | 56 + test/tsan/dtls.c | 62 + test/tsan/exceptions.cc | 185 + test/tsan/fd_close_norace.cc | 33 + test/tsan/fd_close_norace2.cc | 30 + test/tsan/fd_dup_norace.cc | 34 + test/tsan/fd_dup_norace2.cc | 60 + test/tsan/fd_dup_race.cc | 33 + test/tsan/fd_location.cc | 33 + test/tsan/fd_pipe_norace.cc | 33 + test/tsan/fd_pipe_race.cc | 37 + test/tsan/fd_socket_connect_norace.cc | 62 + test/tsan/fd_socket_norace.cc | 69 + test/tsan/fd_socketpair_norace.cc | 37 + test/tsan/fd_stdout_race.cc | 41 + test/tsan/fd_tid_recycled.cc | 54 + test/tsan/fork_atexit.cc | 37 + test/tsan/fork_deadlock.cc | 38 + test/tsan/fork_multithreaded.cc | 44 + test/tsan/fork_multithreaded3.cc | 40 + test/tsan/free_race.c | 47 + test/tsan/free_race.c.supp | 2 + test/tsan/free_race2.c | 26 + test/tsan/getline_nohang.cc | 39 + test/tsan/global_race.cc | 36 + test/tsan/global_race2.cc | 25 + test/tsan/global_race3.cc | 29 + test/tsan/halt_on_error.cc | 27 + test/tsan/heap_race.cc | 24 + test/tsan/ignore_free.cc | 34 + test/tsan/ignore_lib0.cc | 35 + test/tsan/ignore_lib0.cc.supp | 2 + test/tsan/ignore_lib1.cc | 47 + test/tsan/ignore_lib1.cc.supp | 2 + test/tsan/ignore_lib2.cc | 33 + test/tsan/ignore_lib2.cc.supp | 2 + test/tsan/ignore_lib3.cc | 36 + test/tsan/ignore_lib3.cc.supp | 2 + test/tsan/ignore_lib4.cc | 46 + test/tsan/ignore_lib5.cc | 78 + test/tsan/ignore_lib5.cc.supp | 2 + test/tsan/ignore_lib_lib.h | 25 + test/tsan/ignore_malloc.cc | 35 + test/tsan/ignore_race.cc | 31 + test/tsan/ignore_sync.cc | 30 + test/tsan/ignored-interceptors-mmap.cc | 61 + test/tsan/inlined_memcpy_race.cc | 37 + test/tsan/inlined_memcpy_race2.cc | 37 + test/tsan/interface_atomic_test.c | 16 + test/tsan/java.h | 27 + test/tsan/java_alloc.cc | 38 + test/tsan/java_finalizer.cc | 29 + test/tsan/java_find.cc | 69 + test/tsan/java_heap_init.cc | 28 + test/tsan/java_lock.cc | 37 + test/tsan/java_lock_move.cc | 43 + test/tsan/java_lock_rec.cc | 57 + test/tsan/java_lock_rec_race.cc | 51 + test/tsan/java_move_overlap.cc | 74 + test/tsan/java_move_overlap_race.cc | 55 + test/tsan/java_race.cc | 28 + test/tsan/java_race_move.cc | 35 + test/tsan/java_race_pc.cc | 40 + test/tsan/java_rwlock.cc | 37 + test/tsan/java_symbolization.cc | 44 + test/tsan/java_volatile.cc | 42 + test/tsan/large_malloc_meta.cc | 28 + test/tsan/libcxx/lit.local.cfg | 12 + test/tsan/libcxx/std_shared_ptr.cc | 24 + test/tsan/lit.cfg | 89 + test/tsan/lit.site.cfg.in | 15 + test/tsan/load_shared_lib.cc | 74 + test/tsan/longjmp.cc | 23 + test/tsan/longjmp2.cc | 25 + test/tsan/longjmp3.cc | 49 + test/tsan/longjmp4.cc | 52 + test/tsan/lots_of_threads.c | 30 + test/tsan/malloc_overflow.cc | 23 + test/tsan/malloc_stack.cc | 26 + test/tsan/map32bit.cc | 47 + test/tsan/memcmp_race.cc | 42 + test/tsan/memcpy_race.cc | 41 + test/tsan/mmap_large.cc | 33 + test/tsan/mmap_stress.cc | 67 + test/tsan/mop1.c | 40 + test/tsan/mop_with_offset.cc | 35 + test/tsan/mop_with_offset2.cc | 35 + test/tsan/must_deadlock.cc | 50 + test/tsan/mutex_annotations.cc | 49 + test/tsan/mutex_bad_read_lock.cc | 19 + test/tsan/mutex_bad_read_unlock.cc | 20 + test/tsan/mutex_bad_unlock.cc | 18 + test/tsan/mutex_cycle2.c | 35 + test/tsan/mutex_cycle_long.c | 42 + test/tsan/mutex_destroy_locked.cc | 22 + test/tsan/mutex_double_lock.cc | 29 + test/tsan/mutex_lock_destroyed.cc | 25 + test/tsan/mutexset1.cc | 37 + test/tsan/mutexset2.cc | 37 + test/tsan/mutexset3.cc | 45 + test/tsan/mutexset4.cc | 45 + test/tsan/mutexset5.cc | 46 + test/tsan/mutexset6.cc | 53 + test/tsan/mutexset7.cc | 40 + test/tsan/mutexset8.cc | 39 + test/tsan/pie_test.cc | 6 + test/tsan/printf-1.c | 16 + test/tsan/pthread_atfork_deadlock.c | 33 + test/tsan/pthread_key.cc | 39 + test/tsan/race_on_barrier.c | 34 + test/tsan/race_on_barrier2.c | 35 + test/tsan/race_on_heap.cc | 48 + test/tsan/race_on_mutex.c | 40 + test/tsan/race_on_mutex2.c | 23 + test/tsan/race_on_puts.cc | 30 + test/tsan/race_on_read.cc | 45 + test/tsan/race_on_speculative_load.cc | 30 + test/tsan/race_on_write.cc | 38 + test/tsan/race_stress.cc | 25 + test/tsan/race_top_suppression.cc | 29 + test/tsan/race_top_suppression1.cc | 32 + test/tsan/race_with_finished_thread.cc | 42 + .../real_deadlock_detector_stress_test.cc | 187 + test/tsan/restore_stack.cc | 50 + test/tsan/setuid.c | 32 + test/tsan/setuid2.c | 27 + test/tsan/signal_block.cc | 60 + test/tsan/signal_cond.cc | 53 + test/tsan/signal_errno.cc | 52 + test/tsan/signal_longjmp.cc | 80 + test/tsan/signal_malloc.cc | 24 + test/tsan/signal_pause.cc | 35 + test/tsan/signal_recursive.cc | 126 + test/tsan/signal_reset.cc | 75 + test/tsan/signal_sync.cc | 56 + test/tsan/signal_sync2.cc | 77 + test/tsan/signal_thread.cc | 53 + test/tsan/signal_write.cc | 27 + test/tsan/sigsuspend.cc | 44 + test/tsan/simple_race.c | 29 + test/tsan/simple_race.cc | 29 + test/tsan/simple_stack.c | 85 + test/tsan/simple_stack2.cc | 53 + test/tsan/sleep_sync.cc | 32 + test/tsan/sleep_sync2.cc | 24 + test/tsan/stack_race.cc | 22 + test/tsan/stack_race2.cc | 29 + test/tsan/stack_sync_reuse.cc | 67 + test/tsan/static_init1.cc | 27 + test/tsan/static_init2.cc | 33 + test/tsan/static_init3.cc | 47 + test/tsan/static_init4.cc | 37 + test/tsan/static_init5.cc | 42 + test/tsan/static_init6.cc | 42 + test/tsan/strerror_r.cc | 30 + test/tsan/sunrpc.cc | 25 + test/tsan/suppress_same_address.cc | 30 + test/tsan/suppress_same_stacks.cc | 27 + test/tsan/suppressions_global.cc | 29 + test/tsan/suppressions_global.cc.supp | 2 + test/tsan/suppressions_race.cc | 31 + test/tsan/suppressions_race.cc.supp | 2 + test/tsan/suppressions_race2.cc | 31 + test/tsan/suppressions_race2.cc.supp | 2 + test/tsan/test.h | 91 + test/tsan/thread_detach.c | 20 + test/tsan/thread_detach2.c | 28 + test/tsan/thread_end_with_ignore.cc | 24 + test/tsan/thread_end_with_ignore2.cc | 12 + test/tsan/thread_end_with_ignore3.cc | 22 + test/tsan/thread_leak.c | 17 + test/tsan/thread_leak2.c | 17 + test/tsan/thread_leak3.c | 19 + test/tsan/thread_leak4.c | 18 + test/tsan/thread_leak5.c | 22 + test/tsan/thread_name.cc | 51 + test/tsan/thread_name2.cc | 44 + test/tsan/tiny_race.c | 22 + test/tsan/tls_race.cc | 24 + test/tsan/tls_race2.cc | 31 + test/tsan/tsan-vs-gvn.cc | 38 + test/tsan/unaligned_norace.cc | 84 + test/tsan/unaligned_race.cc | 129 + test/tsan/vfork.cc | 51 + test/tsan/virtual_inheritance_compile_bug.cc | 15 + test/tsan/vptr_benign_race.cc | 59 + test/tsan/vptr_harmful_race.cc | 51 + test/tsan/vptr_harmful_race2.cc | 51 + test/tsan/vptr_harmful_race3.cc | 53 + test/tsan/vptr_harmful_race4.cc | 34 + test/tsan/write_in_reader_lock.cc | 36 + test/ubsan/CMakeLists.txt | 74 + test/ubsan/TestCases/Float/cast-overflow.cpp | 157 + test/ubsan/TestCases/Integer/add-overflow.cpp | 32 + test/ubsan/TestCases/Integer/div-overflow.cpp | 10 + test/ubsan/TestCases/Integer/div-zero.cpp | 15 + .../TestCases/Integer/incdec-overflow.cpp | 16 + test/ubsan/TestCases/Integer/mul-overflow.cpp | 14 + .../TestCases/Integer/negate-overflow.cpp | 14 + test/ubsan/TestCases/Integer/no-recover.cpp | 22 + test/ubsan/TestCases/Integer/shift.cpp | 45 + test/ubsan/TestCases/Integer/sub-overflow.cpp | 31 + test/ubsan/TestCases/Integer/summary.cpp | 13 + test/ubsan/TestCases/Integer/suppressions.cpp | 37 + .../ubsan/TestCases/Integer/uadd-overflow.cpp | 32 + .../TestCases/Integer/uincdec-overflow.cpp | 16 + .../ubsan/TestCases/Integer/umul-overflow.cpp | 19 + .../ubsan/TestCases/Integer/usub-overflow.cpp | 31 + .../Misc/Inputs/no-interception-dso.c | 3 + .../Misc/Inputs/returns-unexpectedly.c | 1 + test/ubsan/TestCases/Misc/Linux/lit.local.cfg | 9 + .../TestCases/Misc/Linux/print_stack_trace.cc | 23 + .../TestCases/Misc/Linux/ubsan_options.cc | 18 + test/ubsan/TestCases/Misc/bool.cpp | 13 + test/ubsan/TestCases/Misc/bool.m | 14 + test/ubsan/TestCases/Misc/bounds.cpp | 31 + test/ubsan/TestCases/Misc/builtins.cpp | 35 + test/ubsan/TestCases/Misc/coverage-levels.cc | 46 + test/ubsan/TestCases/Misc/deduplication.cpp | 26 + test/ubsan/TestCases/Misc/enum.cpp | 21 + test/ubsan/TestCases/Misc/log-path_test.cc | 36 + test/ubsan/TestCases/Misc/missing_return.cpp | 12 + test/ubsan/TestCases/Misc/no-interception.cpp | 20 + test/ubsan/TestCases/Misc/nonnull-arg.cpp | 61 + test/ubsan/TestCases/Misc/nonnull.cpp | 42 + test/ubsan/TestCases/Misc/nullability.c | 62 + test/ubsan/TestCases/Misc/unreachable.cpp | 25 + test/ubsan/TestCases/Misc/vla.c | 11 + .../TestCases/Pointer/index-overflow.cpp | 19 + .../Pointer/unsigned-index-expression.cpp | 20 + .../TestCases/TypeCheck/Function/function.cpp | 33 + .../TypeCheck/Function/lit.local.cfg | 3 + .../TestCases/TypeCheck/Linux/PR33221.cpp | 50 + .../TestCases/TypeCheck/Linux/lit.local.cfg | 9 + test/ubsan/TestCases/TypeCheck/PR33221.cpp | 29 + test/ubsan/TestCases/TypeCheck/misaligned.cpp | 100 + test/ubsan/TestCases/TypeCheck/null.cpp | 58 + .../vptr-corrupted-vtable-itanium.cpp | 41 + .../TypeCheck/vptr-non-unique-typeinfo.cpp | 26 + .../vptr-virtual-base-construction.cpp | 14 + .../TestCases/TypeCheck/vptr-virtual-base.cpp | 19 + test/ubsan/TestCases/TypeCheck/vptr.cpp | 252 + test/ubsan/lit.common.cfg | 76 + test/ubsan/lit.site.cfg.in | 15 + test/ubsan_minimal/CMakeLists.txt | 26 + .../TestCases/recover-dedup-limit.cpp | 41 + .../ubsan_minimal/TestCases/recover-dedup.cpp | 39 + .../TestCases/test-darwin-interface.c | 16 + .../ubsan_minimal/TestCases/uadd-overflow.cpp | 10 + test/ubsan_minimal/lit.common.cfg | 40 + test/ubsan_minimal/lit.site.cfg.in | 11 + test/xray/CMakeLists.txt | 42 + .../Linux/always-never-instrument.cc | 23 + .../xray/TestCases/Linux/arg1-arg0-logging.cc | 39 + test/xray/TestCases/Linux/arg1-logger.cc | 45 + .../Linux/arg1-logging-implicit-this.cc | 31 + .../TestCases/Linux/argv0-log-file-name.cc | 16 + test/xray/TestCases/Linux/basic-filtering.cc | 51 + .../Linux/common-trampoline-alignment.cc | 57 + test/xray/TestCases/Linux/coverage-sample.cc | 91 + .../Linux/custom-event-handler-alignment.cc | 42 + .../TestCases/Linux/custom-event-logging.cc | 42 + test/xray/TestCases/Linux/fdr-mode.cc | 103 + .../xray/TestCases/Linux/fdr-single-thread.cc | 38 + test/xray/TestCases/Linux/fdr-thread-order.cc | 67 + .../xray/TestCases/Linux/fixedsize-logging.cc | 22 + test/xray/TestCases/Linux/func-id-utils.cc | 44 + test/xray/TestCases/Linux/logging-modes.cc | 59 + .../TestCases/Linux/optional-inmemory-log.cc | 23 + .../TestCases/Linux/patching-unpatching.cc | 49 + test/xray/TestCases/Linux/pic_test.cc | 38 + test/xray/TestCases/Linux/quiet-start.cc | 26 + test/xray/Unit/lit.site.cfg.in | 16 + test/xray/lit.cfg | 50 + test/xray/lit.site.cfg.in | 20 + unittests/CMakeLists.txt | 6 + unittests/lit.common.unit.cfg | 46 + unittests/lit.common.unit.configured.in | 25 + unittests/lit_unittest_cfg_utils.py | 4 + www/content.css | 25 + www/index.html | 143 + www/menu.css | 39 + www/menu.html.incl | 19 + 2853 files changed, 433661 insertions(+) create mode 100644 .arcconfig create mode 100644 .gitignore create mode 100644 CMakeLists.txt create mode 100644 CODE_OWNERS.TXT create mode 100644 CREDITS.TXT create mode 100644 LICENSE.TXT create mode 100644 README.txt create mode 100644 cmake/Modules/AddCompilerRT.cmake create mode 100644 cmake/Modules/BuiltinTests.cmake create mode 100644 cmake/Modules/CompilerRTCompile.cmake create mode 100644 cmake/Modules/CompilerRTDarwinUtils.cmake create mode 100644 cmake/Modules/CompilerRTLink.cmake create mode 100644 cmake/Modules/CompilerRTUtils.cmake create mode 100644 cmake/Modules/HandleCompilerRT.cmake create mode 100644 cmake/Modules/SanitizerUtils.cmake create mode 100644 cmake/base-config-ix.cmake create mode 100644 cmake/builtin-config-ix.cmake create mode 100644 cmake/caches/Apple.cmake create mode 100644 cmake/config-ix.cmake create mode 100644 docs/TestingGuide.rst create mode 100644 include/CMakeLists.txt create mode 100644 include/sanitizer/allocator_interface.h create mode 100644 include/sanitizer/asan_interface.h create mode 100644 include/sanitizer/common_interface_defs.h create mode 100644 include/sanitizer/coverage_interface.h create mode 100644 include/sanitizer/dfsan_interface.h create mode 100644 include/sanitizer/esan_interface.h create mode 100644 include/sanitizer/hwasan_interface.h create mode 100644 include/sanitizer/linux_syscall_hooks.h create mode 100644 include/sanitizer/lsan_interface.h create mode 100644 include/sanitizer/msan_interface.h create mode 100644 include/sanitizer/scudo_interface.h create mode 100644 include/sanitizer/tsan_interface.h create mode 100644 include/sanitizer/tsan_interface_atomic.h create mode 100644 include/xray/xray_interface.h create mode 100644 include/xray/xray_log_interface.h create mode 100644 include/xray/xray_records.h create mode 100644 lib/BlocksRuntime/Block.h create mode 100644 lib/BlocksRuntime/Block_private.h create mode 100644 lib/BlocksRuntime/data.c create mode 100644 lib/BlocksRuntime/runtime.c create mode 100644 lib/CMakeLists.txt create mode 100644 lib/asan/.clang-format create mode 100644 lib/asan/CMakeLists.txt create mode 100644 lib/asan/README.txt create mode 100644 lib/asan/asan.syms.extra create mode 100644 lib/asan/asan_activation.cc create mode 100644 lib/asan/asan_activation.h create mode 100644 lib/asan/asan_activation_flags.inc create mode 100644 lib/asan/asan_allocator.cc create mode 100644 lib/asan/asan_allocator.h create mode 100644 lib/asan/asan_blacklist.txt create mode 100644 lib/asan/asan_debugging.cc create mode 100644 lib/asan/asan_descriptions.cc create mode 100644 lib/asan/asan_descriptions.h create mode 100644 lib/asan/asan_errors.cc create mode 100644 lib/asan/asan_errors.h create mode 100644 lib/asan/asan_fake_stack.cc create mode 100644 lib/asan/asan_fake_stack.h create mode 100644 lib/asan/asan_flags.cc create mode 100644 lib/asan/asan_flags.h create mode 100644 lib/asan/asan_flags.inc create mode 100644 lib/asan/asan_fuchsia.cc create mode 100644 lib/asan/asan_globals.cc create mode 100644 lib/asan/asan_globals_win.cc create mode 100644 lib/asan/asan_init_version.h create mode 100644 lib/asan/asan_interceptors.cc create mode 100644 lib/asan/asan_interceptors.h create mode 100644 lib/asan/asan_interceptors_memintrinsics.cc create mode 100644 lib/asan/asan_interceptors_memintrinsics.h create mode 100644 lib/asan/asan_interface.inc create mode 100644 lib/asan/asan_interface_internal.h create mode 100644 lib/asan/asan_internal.h create mode 100644 lib/asan/asan_linux.cc create mode 100644 lib/asan/asan_lock.h create mode 100644 lib/asan/asan_mac.cc create mode 100644 lib/asan/asan_malloc_linux.cc create mode 100644 lib/asan/asan_malloc_mac.cc create mode 100644 lib/asan/asan_malloc_win.cc create mode 100644 lib/asan/asan_mapping.h create mode 100644 lib/asan/asan_memory_profile.cc create mode 100644 lib/asan/asan_new_delete.cc create mode 100644 lib/asan/asan_poisoning.cc create mode 100644 lib/asan/asan_poisoning.h create mode 100644 lib/asan/asan_posix.cc create mode 100644 lib/asan/asan_preinit.cc create mode 100644 lib/asan/asan_premap_shadow.cc create mode 100644 lib/asan/asan_premap_shadow.h create mode 100644 lib/asan/asan_report.cc create mode 100644 lib/asan/asan_report.h create mode 100644 lib/asan/asan_rtl.cc create mode 100644 lib/asan/asan_scariness_score.h create mode 100644 lib/asan/asan_shadow_setup.cc create mode 100644 lib/asan/asan_stack.cc create mode 100644 lib/asan/asan_stack.h create mode 100644 lib/asan/asan_stats.cc create mode 100644 lib/asan/asan_stats.h create mode 100644 lib/asan/asan_suppressions.cc create mode 100644 lib/asan/asan_suppressions.h create mode 100644 lib/asan/asan_thread.cc create mode 100644 lib/asan/asan_thread.h create mode 100644 lib/asan/asan_win.cc create mode 100644 lib/asan/asan_win_dll_thunk.cc create mode 100644 lib/asan/asan_win_dynamic_runtime_thunk.cc create mode 100644 lib/asan/asan_win_weak_interception.cc create mode 100644 lib/asan/scripts/CMakeLists.txt create mode 100755 lib/asan/scripts/asan_device_setup create mode 100755 lib/asan/scripts/asan_symbolize.py create mode 100644 lib/asan/tests/CMakeLists.txt create mode 100644 lib/asan/tests/asan_asm_test.cc create mode 100644 lib/asan/tests/asan_benchmarks_test.cc create mode 100644 lib/asan/tests/asan_exceptions_test.cc create mode 100644 lib/asan/tests/asan_fake_stack_test.cc create mode 100644 lib/asan/tests/asan_globals_test.cc create mode 100644 lib/asan/tests/asan_interface_test.cc create mode 100644 lib/asan/tests/asan_internal_interface_test.cc create mode 100644 lib/asan/tests/asan_mac_test.cc create mode 100644 lib/asan/tests/asan_mac_test.h create mode 100644 lib/asan/tests/asan_mac_test_helpers.mm create mode 100644 lib/asan/tests/asan_mem_test.cc create mode 100644 lib/asan/tests/asan_noinst_test.cc create mode 100644 lib/asan/tests/asan_oob_test.cc create mode 100644 lib/asan/tests/asan_racy_double_free_test.cc create mode 100644 lib/asan/tests/asan_str_test.cc create mode 100644 lib/asan/tests/asan_test.cc create mode 100644 lib/asan/tests/asan_test.ignore create mode 100644 lib/asan/tests/asan_test_config.h create mode 100644 lib/asan/tests/asan_test_main.cc create mode 100644 lib/asan/tests/asan_test_utils.h create mode 100644 lib/asan/weak_symbols.txt create mode 100644 lib/builtins/CMakeLists.txt create mode 100644 lib/builtins/Darwin-excludes/10.4.txt create mode 100644 lib/builtins/Darwin-excludes/CMakeLists.txt create mode 100644 lib/builtins/Darwin-excludes/README.TXT create mode 100644 lib/builtins/Darwin-excludes/ios-armv7.txt create mode 100644 lib/builtins/Darwin-excludes/ios-armv7s.txt create mode 100644 lib/builtins/Darwin-excludes/ios.txt create mode 100644 lib/builtins/Darwin-excludes/ios6-armv7.txt create mode 100644 lib/builtins/Darwin-excludes/ios6-armv7s.txt create mode 100644 lib/builtins/Darwin-excludes/ios7-arm64.txt create mode 100644 lib/builtins/Darwin-excludes/iossim-i386.txt create mode 100644 lib/builtins/Darwin-excludes/iossim-x86_64.txt create mode 100644 lib/builtins/Darwin-excludes/iossim.txt create mode 100644 lib/builtins/Darwin-excludes/osx-i386.txt create mode 100644 lib/builtins/Darwin-excludes/osx.txt create mode 100644 lib/builtins/README.txt create mode 100644 lib/builtins/aarch64/chkstk.S create mode 100644 lib/builtins/absvdi2.c create mode 100644 lib/builtins/absvsi2.c create mode 100644 lib/builtins/absvti2.c create mode 100644 lib/builtins/adddf3.c create mode 100644 lib/builtins/addsf3.c create mode 100644 lib/builtins/addtf3.c create mode 100644 lib/builtins/addvdi3.c create mode 100644 lib/builtins/addvsi3.c create mode 100644 lib/builtins/addvti3.c create mode 100644 lib/builtins/apple_versioning.c create mode 100644 lib/builtins/arm/adddf3vfp.S create mode 100644 lib/builtins/arm/addsf3.S create mode 100644 lib/builtins/arm/addsf3vfp.S create mode 100644 lib/builtins/arm/aeabi_cdcmp.S create mode 100644 lib/builtins/arm/aeabi_cdcmpeq_check_nan.c create mode 100644 lib/builtins/arm/aeabi_cfcmp.S create mode 100644 lib/builtins/arm/aeabi_cfcmpeq_check_nan.c create mode 100644 lib/builtins/arm/aeabi_dcmp.S create mode 100644 lib/builtins/arm/aeabi_div0.c create mode 100644 lib/builtins/arm/aeabi_drsub.c create mode 100644 lib/builtins/arm/aeabi_fcmp.S create mode 100644 lib/builtins/arm/aeabi_frsub.c create mode 100644 lib/builtins/arm/aeabi_idivmod.S create mode 100644 lib/builtins/arm/aeabi_ldivmod.S create mode 100644 lib/builtins/arm/aeabi_memcmp.S create mode 100644 lib/builtins/arm/aeabi_memcpy.S create mode 100644 lib/builtins/arm/aeabi_memmove.S create mode 100644 lib/builtins/arm/aeabi_memset.S create mode 100644 lib/builtins/arm/aeabi_uidivmod.S create mode 100644 lib/builtins/arm/aeabi_uldivmod.S create mode 100644 lib/builtins/arm/bswapdi2.S create mode 100644 lib/builtins/arm/bswapsi2.S create mode 100644 lib/builtins/arm/clzdi2.S create mode 100644 lib/builtins/arm/clzsi2.S create mode 100644 lib/builtins/arm/comparesf2.S create mode 100644 lib/builtins/arm/divdf3vfp.S create mode 100644 lib/builtins/arm/divmodsi4.S create mode 100644 lib/builtins/arm/divsf3vfp.S create mode 100644 lib/builtins/arm/divsi3.S create mode 100644 lib/builtins/arm/eqdf2vfp.S create mode 100644 lib/builtins/arm/eqsf2vfp.S create mode 100644 lib/builtins/arm/extendsfdf2vfp.S create mode 100644 lib/builtins/arm/fixdfsivfp.S create mode 100644 lib/builtins/arm/fixsfsivfp.S create mode 100644 lib/builtins/arm/fixunsdfsivfp.S create mode 100644 lib/builtins/arm/fixunssfsivfp.S create mode 100644 lib/builtins/arm/floatsidfvfp.S create mode 100644 lib/builtins/arm/floatsisfvfp.S create mode 100644 lib/builtins/arm/floatunssidfvfp.S create mode 100644 lib/builtins/arm/floatunssisfvfp.S create mode 100644 lib/builtins/arm/gedf2vfp.S create mode 100644 lib/builtins/arm/gesf2vfp.S create mode 100644 lib/builtins/arm/gtdf2vfp.S create mode 100644 lib/builtins/arm/gtsf2vfp.S create mode 100644 lib/builtins/arm/ledf2vfp.S create mode 100644 lib/builtins/arm/lesf2vfp.S create mode 100644 lib/builtins/arm/ltdf2vfp.S create mode 100644 lib/builtins/arm/ltsf2vfp.S create mode 100644 lib/builtins/arm/modsi3.S create mode 100644 lib/builtins/arm/muldf3vfp.S create mode 100644 lib/builtins/arm/mulsf3vfp.S create mode 100644 lib/builtins/arm/nedf2vfp.S create mode 100644 lib/builtins/arm/negdf2vfp.S create mode 100644 lib/builtins/arm/negsf2vfp.S create mode 100644 lib/builtins/arm/nesf2vfp.S create mode 100644 lib/builtins/arm/restore_vfp_d8_d15_regs.S create mode 100644 lib/builtins/arm/save_vfp_d8_d15_regs.S create mode 100644 lib/builtins/arm/softfloat-alias.list create mode 100644 lib/builtins/arm/subdf3vfp.S create mode 100644 lib/builtins/arm/subsf3vfp.S create mode 100644 lib/builtins/arm/switch16.S create mode 100644 lib/builtins/arm/switch32.S create mode 100644 lib/builtins/arm/switch8.S create mode 100644 lib/builtins/arm/switchu8.S create mode 100644 lib/builtins/arm/sync-ops.h create mode 100644 lib/builtins/arm/sync_fetch_and_add_4.S create mode 100644 lib/builtins/arm/sync_fetch_and_add_8.S create mode 100644 lib/builtins/arm/sync_fetch_and_and_4.S create mode 100644 lib/builtins/arm/sync_fetch_and_and_8.S create mode 100644 lib/builtins/arm/sync_fetch_and_max_4.S create mode 100644 lib/builtins/arm/sync_fetch_and_max_8.S create mode 100644 lib/builtins/arm/sync_fetch_and_min_4.S create mode 100644 lib/builtins/arm/sync_fetch_and_min_8.S create mode 100644 lib/builtins/arm/sync_fetch_and_nand_4.S create mode 100644 lib/builtins/arm/sync_fetch_and_nand_8.S create mode 100644 lib/builtins/arm/sync_fetch_and_or_4.S create mode 100644 lib/builtins/arm/sync_fetch_and_or_8.S create mode 100644 lib/builtins/arm/sync_fetch_and_sub_4.S create mode 100644 lib/builtins/arm/sync_fetch_and_sub_8.S create mode 100644 lib/builtins/arm/sync_fetch_and_umax_4.S create mode 100644 lib/builtins/arm/sync_fetch_and_umax_8.S create mode 100644 lib/builtins/arm/sync_fetch_and_umin_4.S create mode 100644 lib/builtins/arm/sync_fetch_and_umin_8.S create mode 100644 lib/builtins/arm/sync_fetch_and_xor_4.S create mode 100644 lib/builtins/arm/sync_fetch_and_xor_8.S create mode 100644 lib/builtins/arm/sync_synchronize.S create mode 100644 lib/builtins/arm/truncdfsf2vfp.S create mode 100644 lib/builtins/arm/udivmodsi4.S create mode 100644 lib/builtins/arm/udivsi3.S create mode 100644 lib/builtins/arm/umodsi3.S create mode 100644 lib/builtins/arm/unorddf2vfp.S create mode 100644 lib/builtins/arm/unordsf2vfp.S create mode 100644 lib/builtins/ashldi3.c create mode 100644 lib/builtins/ashlti3.c create mode 100644 lib/builtins/ashrdi3.c create mode 100644 lib/builtins/ashrti3.c create mode 100644 lib/builtins/assembly.h create mode 100644 lib/builtins/atomic.c create mode 100644 lib/builtins/atomic_flag_clear.c create mode 100644 lib/builtins/atomic_flag_clear_explicit.c create mode 100644 lib/builtins/atomic_flag_test_and_set.c create mode 100644 lib/builtins/atomic_flag_test_and_set_explicit.c create mode 100644 lib/builtins/atomic_signal_fence.c create mode 100644 lib/builtins/atomic_thread_fence.c create mode 100644 lib/builtins/bswapdi2.c create mode 100644 lib/builtins/bswapsi2.c create mode 100644 lib/builtins/clear_cache.c create mode 100644 lib/builtins/clzdi2.c create mode 100644 lib/builtins/clzsi2.c create mode 100644 lib/builtins/clzti2.c create mode 100644 lib/builtins/cmpdi2.c create mode 100644 lib/builtins/cmpti2.c create mode 100644 lib/builtins/comparedf2.c create mode 100644 lib/builtins/comparesf2.c create mode 100644 lib/builtins/comparetf2.c create mode 100644 lib/builtins/cpu_model.c create mode 100644 lib/builtins/ctzdi2.c create mode 100644 lib/builtins/ctzsi2.c create mode 100644 lib/builtins/ctzti2.c create mode 100644 lib/builtins/divdc3.c create mode 100644 lib/builtins/divdf3.c create mode 100644 lib/builtins/divdi3.c create mode 100644 lib/builtins/divmoddi4.c create mode 100644 lib/builtins/divmodsi4.c create mode 100644 lib/builtins/divsc3.c create mode 100644 lib/builtins/divsf3.c create mode 100644 lib/builtins/divsi3.c create mode 100644 lib/builtins/divtc3.c create mode 100644 lib/builtins/divtf3.c create mode 100644 lib/builtins/divti3.c create mode 100644 lib/builtins/divxc3.c create mode 100644 lib/builtins/emutls.c create mode 100644 lib/builtins/enable_execute_stack.c create mode 100644 lib/builtins/eprintf.c create mode 100644 lib/builtins/extenddftf2.c create mode 100644 lib/builtins/extendhfsf2.c create mode 100644 lib/builtins/extendsfdf2.c create mode 100644 lib/builtins/extendsftf2.c create mode 100644 lib/builtins/ffsdi2.c create mode 100644 lib/builtins/ffssi2.c create mode 100644 lib/builtins/ffsti2.c create mode 100644 lib/builtins/fixdfdi.c create mode 100644 lib/builtins/fixdfsi.c create mode 100644 lib/builtins/fixdfti.c create mode 100644 lib/builtins/fixsfdi.c create mode 100644 lib/builtins/fixsfsi.c create mode 100644 lib/builtins/fixsfti.c create mode 100644 lib/builtins/fixtfdi.c create mode 100644 lib/builtins/fixtfsi.c create mode 100644 lib/builtins/fixtfti.c create mode 100644 lib/builtins/fixunsdfdi.c create mode 100644 lib/builtins/fixunsdfsi.c create mode 100644 lib/builtins/fixunsdfti.c create mode 100644 lib/builtins/fixunssfdi.c create mode 100644 lib/builtins/fixunssfsi.c create mode 100644 lib/builtins/fixunssfti.c create mode 100644 lib/builtins/fixunstfdi.c create mode 100644 lib/builtins/fixunstfsi.c create mode 100644 lib/builtins/fixunstfti.c create mode 100644 lib/builtins/fixunsxfdi.c create mode 100644 lib/builtins/fixunsxfsi.c create mode 100644 lib/builtins/fixunsxfti.c create mode 100644 lib/builtins/fixxfdi.c create mode 100644 lib/builtins/fixxfti.c create mode 100644 lib/builtins/floatdidf.c create mode 100644 lib/builtins/floatdisf.c create mode 100644 lib/builtins/floatditf.c create mode 100644 lib/builtins/floatdixf.c create mode 100644 lib/builtins/floatsidf.c create mode 100644 lib/builtins/floatsisf.c create mode 100644 lib/builtins/floatsitf.c create mode 100644 lib/builtins/floattidf.c create mode 100644 lib/builtins/floattisf.c create mode 100644 lib/builtins/floattitf.c create mode 100644 lib/builtins/floattixf.c create mode 100644 lib/builtins/floatundidf.c create mode 100644 lib/builtins/floatundisf.c create mode 100644 lib/builtins/floatunditf.c create mode 100644 lib/builtins/floatundixf.c create mode 100644 lib/builtins/floatunsidf.c create mode 100644 lib/builtins/floatunsisf.c create mode 100644 lib/builtins/floatunsitf.c create mode 100644 lib/builtins/floatuntidf.c create mode 100644 lib/builtins/floatuntisf.c create mode 100644 lib/builtins/floatuntitf.c create mode 100644 lib/builtins/floatuntixf.c create mode 100644 lib/builtins/fp_add_impl.inc create mode 100644 lib/builtins/fp_extend.h create mode 100644 lib/builtins/fp_extend_impl.inc create mode 100644 lib/builtins/fp_fixint_impl.inc create mode 100644 lib/builtins/fp_fixuint_impl.inc create mode 100644 lib/builtins/fp_lib.h create mode 100644 lib/builtins/fp_mul_impl.inc create mode 100644 lib/builtins/fp_trunc.h create mode 100644 lib/builtins/fp_trunc_impl.inc create mode 100644 lib/builtins/gcc_personality_v0.c create mode 100644 lib/builtins/i386/ashldi3.S create mode 100644 lib/builtins/i386/ashrdi3.S create mode 100644 lib/builtins/i386/chkstk.S create mode 100644 lib/builtins/i386/chkstk2.S create mode 100644 lib/builtins/i386/divdi3.S create mode 100644 lib/builtins/i386/floatdidf.S create mode 100644 lib/builtins/i386/floatdisf.S create mode 100644 lib/builtins/i386/floatdixf.S create mode 100644 lib/builtins/i386/floatundidf.S create mode 100644 lib/builtins/i386/floatundisf.S create mode 100644 lib/builtins/i386/floatundixf.S create mode 100644 lib/builtins/i386/lshrdi3.S create mode 100644 lib/builtins/i386/moddi3.S create mode 100644 lib/builtins/i386/muldi3.S create mode 100644 lib/builtins/i386/udivdi3.S create mode 100644 lib/builtins/i386/umoddi3.S create mode 100644 lib/builtins/int_endianness.h create mode 100644 lib/builtins/int_lib.h create mode 100644 lib/builtins/int_math.h create mode 100644 lib/builtins/int_types.h create mode 100644 lib/builtins/int_util.c create mode 100644 lib/builtins/int_util.h create mode 100644 lib/builtins/lshrdi3.c create mode 100644 lib/builtins/lshrti3.c create mode 100644 lib/builtins/macho_embedded/CMakeLists.txt create mode 100644 lib/builtins/macho_embedded/arm.txt create mode 100644 lib/builtins/macho_embedded/common.txt create mode 100644 lib/builtins/macho_embedded/i386.txt create mode 100644 lib/builtins/macho_embedded/thumb2-64.txt create mode 100644 lib/builtins/macho_embedded/thumb2.txt create mode 100644 lib/builtins/mingw_fixfloat.c create mode 100644 lib/builtins/moddi3.c create mode 100644 lib/builtins/modsi3.c create mode 100644 lib/builtins/modti3.c create mode 100644 lib/builtins/muldc3.c create mode 100644 lib/builtins/muldf3.c create mode 100644 lib/builtins/muldi3.c create mode 100644 lib/builtins/mulodi4.c create mode 100644 lib/builtins/mulosi4.c create mode 100644 lib/builtins/muloti4.c create mode 100644 lib/builtins/mulsc3.c create mode 100644 lib/builtins/mulsf3.c create mode 100644 lib/builtins/multc3.c create mode 100644 lib/builtins/multf3.c create mode 100644 lib/builtins/multi3.c create mode 100644 lib/builtins/mulvdi3.c create mode 100644 lib/builtins/mulvsi3.c create mode 100644 lib/builtins/mulvti3.c create mode 100644 lib/builtins/mulxc3.c create mode 100644 lib/builtins/negdf2.c create mode 100644 lib/builtins/negdi2.c create mode 100644 lib/builtins/negsf2.c create mode 100644 lib/builtins/negti2.c create mode 100644 lib/builtins/negvdi2.c create mode 100644 lib/builtins/negvsi2.c create mode 100644 lib/builtins/negvti2.c create mode 100644 lib/builtins/os_version_check.c create mode 100644 lib/builtins/paritydi2.c create mode 100644 lib/builtins/paritysi2.c create mode 100644 lib/builtins/parityti2.c create mode 100644 lib/builtins/popcountdi2.c create mode 100644 lib/builtins/popcountsi2.c create mode 100644 lib/builtins/popcountti2.c create mode 100644 lib/builtins/powidf2.c create mode 100644 lib/builtins/powisf2.c create mode 100644 lib/builtins/powitf2.c create mode 100644 lib/builtins/powixf2.c create mode 100644 lib/builtins/ppc/DD.h create mode 100644 lib/builtins/ppc/divtc3.c create mode 100644 lib/builtins/ppc/fixtfdi.c create mode 100644 lib/builtins/ppc/fixunstfdi.c create mode 100644 lib/builtins/ppc/floatditf.c create mode 100644 lib/builtins/ppc/floatunditf.c create mode 100644 lib/builtins/ppc/gcc_qadd.c create mode 100644 lib/builtins/ppc/gcc_qdiv.c create mode 100644 lib/builtins/ppc/gcc_qmul.c create mode 100644 lib/builtins/ppc/gcc_qsub.c create mode 100644 lib/builtins/ppc/multc3.c create mode 100644 lib/builtins/ppc/restFP.S create mode 100644 lib/builtins/ppc/saveFP.S create mode 100644 lib/builtins/subdf3.c create mode 100644 lib/builtins/subsf3.c create mode 100644 lib/builtins/subtf3.c create mode 100644 lib/builtins/subvdi3.c create mode 100644 lib/builtins/subvsi3.c create mode 100644 lib/builtins/subvti3.c create mode 100644 lib/builtins/trampoline_setup.c create mode 100644 lib/builtins/truncdfhf2.c create mode 100644 lib/builtins/truncdfsf2.c create mode 100644 lib/builtins/truncsfhf2.c create mode 100644 lib/builtins/trunctfdf2.c create mode 100644 lib/builtins/trunctfsf2.c create mode 100644 lib/builtins/ucmpdi2.c create mode 100644 lib/builtins/ucmpti2.c create mode 100644 lib/builtins/udivdi3.c create mode 100644 lib/builtins/udivmoddi4.c create mode 100644 lib/builtins/udivmodsi4.c create mode 100644 lib/builtins/udivmodti4.c create mode 100644 lib/builtins/udivsi3.c create mode 100644 lib/builtins/udivti3.c create mode 100644 lib/builtins/umoddi3.c create mode 100644 lib/builtins/umodsi3.c create mode 100644 lib/builtins/umodti3.c create mode 100644 lib/builtins/unwind-ehabi-helpers.h create mode 100644 lib/builtins/x86_64/chkstk.S create mode 100644 lib/builtins/x86_64/chkstk2.S create mode 100644 lib/builtins/x86_64/floatdidf.c create mode 100644 lib/builtins/x86_64/floatdisf.c create mode 100644 lib/builtins/x86_64/floatdixf.c create mode 100644 lib/builtins/x86_64/floatundidf.S create mode 100644 lib/builtins/x86_64/floatundisf.S create mode 100644 lib/builtins/x86_64/floatundixf.S create mode 100644 lib/cfi/CMakeLists.txt create mode 100644 lib/cfi/cfi.cc create mode 100644 lib/cfi/cfi_blacklist.txt create mode 100644 lib/dfsan/.clang-format create mode 100644 lib/dfsan/CMakeLists.txt create mode 100644 lib/dfsan/dfsan.cc create mode 100644 lib/dfsan/dfsan.h create mode 100644 lib/dfsan/dfsan.syms.extra create mode 100644 lib/dfsan/dfsan_custom.cc create mode 100644 lib/dfsan/dfsan_flags.inc create mode 100644 lib/dfsan/dfsan_interceptors.cc create mode 100644 lib/dfsan/dfsan_platform.h create mode 100644 lib/dfsan/done_abilist.txt create mode 100644 lib/dfsan/libc_ubuntu1404_abilist.txt create mode 100755 lib/dfsan/scripts/build-libc-list.py create mode 100755 lib/dfsan/scripts/check_custom_wrappers.sh create mode 100644 lib/esan/CMakeLists.txt create mode 100644 lib/esan/cache_frag.cpp create mode 100644 lib/esan/cache_frag.h create mode 100644 lib/esan/esan.cpp create mode 100644 lib/esan/esan.h create mode 100644 lib/esan/esan.syms.extra create mode 100644 lib/esan/esan_circular_buffer.h create mode 100644 lib/esan/esan_flags.cpp create mode 100644 lib/esan/esan_flags.h create mode 100644 lib/esan/esan_flags.inc create mode 100644 lib/esan/esan_hashtable.h create mode 100644 lib/esan/esan_interceptors.cpp create mode 100644 lib/esan/esan_interface.cpp create mode 100644 lib/esan/esan_interface_internal.h create mode 100644 lib/esan/esan_linux.cpp create mode 100644 lib/esan/esan_shadow.h create mode 100644 lib/esan/esan_sideline.h create mode 100644 lib/esan/esan_sideline_linux.cpp create mode 100644 lib/esan/working_set.cpp create mode 100644 lib/esan/working_set.h create mode 100644 lib/esan/working_set_posix.cpp create mode 100644 lib/fuzzer/CMakeLists.txt create mode 100644 lib/fuzzer/FuzzerClangCounters.cpp create mode 100644 lib/fuzzer/FuzzerCommand.h create mode 100644 lib/fuzzer/FuzzerCorpus.h create mode 100644 lib/fuzzer/FuzzerCrossOver.cpp create mode 100644 lib/fuzzer/FuzzerDefs.h create mode 100644 lib/fuzzer/FuzzerDictionary.h create mode 100644 lib/fuzzer/FuzzerDriver.cpp create mode 100644 lib/fuzzer/FuzzerExtFunctions.def create mode 100644 lib/fuzzer/FuzzerExtFunctions.h create mode 100644 lib/fuzzer/FuzzerExtFunctionsDlsym.cpp create mode 100644 lib/fuzzer/FuzzerExtFunctionsDlsymWin.cpp create mode 100644 lib/fuzzer/FuzzerExtFunctionsWeak.cpp create mode 100644 lib/fuzzer/FuzzerExtFunctionsWeakAlias.cpp create mode 100644 lib/fuzzer/FuzzerExtraCounters.cpp create mode 100644 lib/fuzzer/FuzzerFlags.def create mode 100644 lib/fuzzer/FuzzerIO.cpp create mode 100644 lib/fuzzer/FuzzerIO.h create mode 100644 lib/fuzzer/FuzzerIOPosix.cpp create mode 100644 lib/fuzzer/FuzzerIOWindows.cpp create mode 100644 lib/fuzzer/FuzzerInterface.h create mode 100644 lib/fuzzer/FuzzerInternal.h create mode 100644 lib/fuzzer/FuzzerLoop.cpp create mode 100644 lib/fuzzer/FuzzerMain.cpp create mode 100644 lib/fuzzer/FuzzerMerge.cpp create mode 100644 lib/fuzzer/FuzzerMerge.h create mode 100644 lib/fuzzer/FuzzerMutate.cpp create mode 100644 lib/fuzzer/FuzzerMutate.h create mode 100644 lib/fuzzer/FuzzerOptions.h create mode 100644 lib/fuzzer/FuzzerRandom.h create mode 100644 lib/fuzzer/FuzzerSHA1.cpp create mode 100644 lib/fuzzer/FuzzerSHA1.h create mode 100644 lib/fuzzer/FuzzerShmem.h create mode 100644 lib/fuzzer/FuzzerShmemFuchsia.cpp create mode 100644 lib/fuzzer/FuzzerShmemPosix.cpp create mode 100644 lib/fuzzer/FuzzerShmemWindows.cpp create mode 100644 lib/fuzzer/FuzzerTracePC.cpp create mode 100644 lib/fuzzer/FuzzerTracePC.h create mode 100644 lib/fuzzer/FuzzerUtil.cpp create mode 100644 lib/fuzzer/FuzzerUtil.h create mode 100644 lib/fuzzer/FuzzerUtilDarwin.cpp create mode 100644 lib/fuzzer/FuzzerUtilFuchsia.cpp create mode 100644 lib/fuzzer/FuzzerUtilLinux.cpp create mode 100644 lib/fuzzer/FuzzerUtilPosix.cpp create mode 100644 lib/fuzzer/FuzzerUtilWindows.cpp create mode 100644 lib/fuzzer/FuzzerValueBitMap.h create mode 100644 lib/fuzzer/README.txt create mode 100644 lib/fuzzer/afl/afl_driver.cpp create mode 100755 lib/fuzzer/build.sh create mode 100755 lib/fuzzer/scripts/unbalanced_allocs.py create mode 100644 lib/fuzzer/standalone/StandaloneFuzzTargetMain.c create mode 100644 lib/fuzzer/tests/CMakeLists.txt create mode 100644 lib/fuzzer/tests/FuzzerUnittest.cpp create mode 100644 lib/hwasan/.clang-format create mode 100644 lib/hwasan/CMakeLists.txt create mode 100644 lib/hwasan/hwasan.cc create mode 100644 lib/hwasan/hwasan.h create mode 100644 lib/hwasan/hwasan.syms.extra create mode 100644 lib/hwasan/hwasan_allocator.cc create mode 100644 lib/hwasan/hwasan_allocator.h create mode 100644 lib/hwasan/hwasan_blacklist.txt create mode 100644 lib/hwasan/hwasan_flags.h create mode 100644 lib/hwasan/hwasan_flags.inc create mode 100644 lib/hwasan/hwasan_interceptors.cc create mode 100644 lib/hwasan/hwasan_interface_internal.h create mode 100644 lib/hwasan/hwasan_linux.cc create mode 100644 lib/hwasan/hwasan_new_delete.cc create mode 100644 lib/hwasan/hwasan_poisoning.cc create mode 100644 lib/hwasan/hwasan_poisoning.h create mode 100644 lib/hwasan/hwasan_report.cc create mode 100644 lib/hwasan/hwasan_thread.cc create mode 100644 lib/hwasan/hwasan_thread.h create mode 100644 lib/interception/.clang-format create mode 100644 lib/interception/CMakeLists.txt create mode 100644 lib/interception/interception.h create mode 100644 lib/interception/interception_linux.cc create mode 100644 lib/interception/interception_linux.h create mode 100644 lib/interception/interception_mac.cc create mode 100644 lib/interception/interception_mac.h create mode 100644 lib/interception/interception_type_test.cc create mode 100644 lib/interception/interception_win.cc create mode 100644 lib/interception/interception_win.h create mode 100644 lib/interception/tests/CMakeLists.txt create mode 100644 lib/interception/tests/interception_linux_test.cc create mode 100644 lib/interception/tests/interception_test_main.cc create mode 100644 lib/interception/tests/interception_win_test.cc create mode 100644 lib/lsan/.clang-format create mode 100644 lib/lsan/CMakeLists.txt create mode 100644 lib/lsan/lsan.cc create mode 100644 lib/lsan/lsan.h create mode 100644 lib/lsan/lsan_allocator.cc create mode 100644 lib/lsan/lsan_allocator.h create mode 100644 lib/lsan/lsan_common.cc create mode 100644 lib/lsan/lsan_common.h create mode 100644 lib/lsan/lsan_common_linux.cc create mode 100644 lib/lsan/lsan_common_mac.cc create mode 100644 lib/lsan/lsan_flags.inc create mode 100644 lib/lsan/lsan_interceptors.cc create mode 100644 lib/lsan/lsan_linux.cc create mode 100644 lib/lsan/lsan_mac.cc create mode 100644 lib/lsan/lsan_malloc_mac.cc create mode 100644 lib/lsan/lsan_preinit.cc create mode 100644 lib/lsan/lsan_thread.cc create mode 100644 lib/lsan/lsan_thread.h create mode 100644 lib/lsan/weak_symbols.txt create mode 100644 lib/msan/.clang-format create mode 100644 lib/msan/CMakeLists.txt create mode 100644 lib/msan/msan.cc create mode 100644 lib/msan/msan.h create mode 100644 lib/msan/msan.syms.extra create mode 100644 lib/msan/msan_allocator.cc create mode 100644 lib/msan/msan_allocator.h create mode 100644 lib/msan/msan_blacklist.txt create mode 100644 lib/msan/msan_chained_origin_depot.cc create mode 100644 lib/msan/msan_chained_origin_depot.h create mode 100644 lib/msan/msan_flags.h create mode 100644 lib/msan/msan_flags.inc create mode 100644 lib/msan/msan_interceptors.cc create mode 100644 lib/msan/msan_interface_internal.h create mode 100644 lib/msan/msan_linux.cc create mode 100644 lib/msan/msan_new_delete.cc create mode 100644 lib/msan/msan_origin.h create mode 100644 lib/msan/msan_poisoning.cc create mode 100644 lib/msan/msan_poisoning.h create mode 100644 lib/msan/msan_report.cc create mode 100644 lib/msan/msan_thread.cc create mode 100644 lib/msan/msan_thread.h create mode 100644 lib/msan/tests/CMakeLists.txt create mode 100644 lib/msan/tests/msan_loadable.cc create mode 100644 lib/msan/tests/msan_test.cc create mode 100644 lib/msan/tests/msan_test_config.h create mode 100644 lib/msan/tests/msan_test_main.cc create mode 100644 lib/profile/CMakeLists.txt create mode 100644 lib/profile/GCDAProfiling.c create mode 100644 lib/profile/InstrProfData.inc create mode 100644 lib/profile/InstrProfiling.c create mode 100644 lib/profile/InstrProfiling.h create mode 100644 lib/profile/InstrProfilingBuffer.c create mode 100644 lib/profile/InstrProfilingFile.c create mode 100644 lib/profile/InstrProfilingInternal.h create mode 100644 lib/profile/InstrProfilingMerge.c create mode 100644 lib/profile/InstrProfilingMergeFile.c create mode 100644 lib/profile/InstrProfilingNameVar.c create mode 100644 lib/profile/InstrProfilingPlatformDarwin.c create mode 100644 lib/profile/InstrProfilingPlatformLinux.c create mode 100644 lib/profile/InstrProfilingPlatformOther.c create mode 100644 lib/profile/InstrProfilingPort.h create mode 100644 lib/profile/InstrProfilingRuntime.cc create mode 100644 lib/profile/InstrProfilingUtil.c create mode 100644 lib/profile/InstrProfilingUtil.h create mode 100644 lib/profile/InstrProfilingValue.c create mode 100644 lib/profile/InstrProfilingWriter.c create mode 100644 lib/profile/WindowsMMap.c create mode 100644 lib/profile/WindowsMMap.h create mode 100644 lib/safestack/.clang-format create mode 100644 lib/safestack/CMakeLists.txt create mode 100644 lib/safestack/safestack.cc create mode 100644 lib/sanitizer_common/.clang-format create mode 100644 lib/sanitizer_common/.clang-tidy create mode 100644 lib/sanitizer_common/CMakeLists.txt create mode 100644 lib/sanitizer_common/sancov_begin.S create mode 100644 lib/sanitizer_common/sancov_end.S create mode 100644 lib/sanitizer_common/sancov_flags.cc create mode 100644 lib/sanitizer_common/sancov_flags.h create mode 100644 lib/sanitizer_common/sancov_flags.inc create mode 100644 lib/sanitizer_common/sanitizer_addrhashmap.h create mode 100644 lib/sanitizer_common/sanitizer_allocator.cc create mode 100644 lib/sanitizer_common/sanitizer_allocator.h create mode 100644 lib/sanitizer_common/sanitizer_allocator_bytemap.h create mode 100644 lib/sanitizer_common/sanitizer_allocator_checks.cc create mode 100644 lib/sanitizer_common/sanitizer_allocator_checks.h create mode 100644 lib/sanitizer_common/sanitizer_allocator_combined.h create mode 100644 lib/sanitizer_common/sanitizer_allocator_interface.h create mode 100644 lib/sanitizer_common/sanitizer_allocator_internal.h create mode 100644 lib/sanitizer_common/sanitizer_allocator_local_cache.h create mode 100644 lib/sanitizer_common/sanitizer_allocator_primary32.h create mode 100644 lib/sanitizer_common/sanitizer_allocator_primary64.h create mode 100644 lib/sanitizer_common/sanitizer_allocator_secondary.h create mode 100644 lib/sanitizer_common/sanitizer_allocator_size_class_map.h create mode 100644 lib/sanitizer_common/sanitizer_allocator_stats.h create mode 100644 lib/sanitizer_common/sanitizer_asm.h create mode 100644 lib/sanitizer_common/sanitizer_atomic.h create mode 100644 lib/sanitizer_common/sanitizer_atomic_clang.h create mode 100644 lib/sanitizer_common/sanitizer_atomic_clang_mips.h create mode 100644 lib/sanitizer_common/sanitizer_atomic_clang_other.h create mode 100644 lib/sanitizer_common/sanitizer_atomic_clang_x86.h create mode 100644 lib/sanitizer_common/sanitizer_atomic_msvc.h create mode 100644 lib/sanitizer_common/sanitizer_bitvector.h create mode 100644 lib/sanitizer_common/sanitizer_bvgraph.h create mode 100644 lib/sanitizer_common/sanitizer_common.cc create mode 100644 lib/sanitizer_common/sanitizer_common.h create mode 100644 lib/sanitizer_common/sanitizer_common_interceptors.inc create mode 100644 lib/sanitizer_common/sanitizer_common_interceptors_format.inc create mode 100644 lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc create mode 100644 lib/sanitizer_common/sanitizer_common_interface.inc create mode 100644 lib/sanitizer_common/sanitizer_common_interface_posix.inc create mode 100644 lib/sanitizer_common/sanitizer_common_libcdep.cc create mode 100644 lib/sanitizer_common/sanitizer_common_nolibc.cc create mode 100644 lib/sanitizer_common/sanitizer_common_syscalls.inc create mode 100644 lib/sanitizer_common/sanitizer_coverage_fuchsia.cc create mode 100644 lib/sanitizer_common/sanitizer_coverage_interface.inc create mode 100644 lib/sanitizer_common/sanitizer_coverage_libcdep_new.cc create mode 100644 lib/sanitizer_common/sanitizer_coverage_win_dll_thunk.cc create mode 100644 lib/sanitizer_common/sanitizer_coverage_win_dynamic_runtime_thunk.cc create mode 100644 lib/sanitizer_common/sanitizer_coverage_win_sections.cc create mode 100644 lib/sanitizer_common/sanitizer_coverage_win_weak_interception.cc create mode 100644 lib/sanitizer_common/sanitizer_dbghelp.h create mode 100644 lib/sanitizer_common/sanitizer_deadlock_detector.h create mode 100644 lib/sanitizer_common/sanitizer_deadlock_detector1.cc create mode 100644 lib/sanitizer_common/sanitizer_deadlock_detector2.cc create mode 100644 lib/sanitizer_common/sanitizer_deadlock_detector_interface.h create mode 100644 lib/sanitizer_common/sanitizer_errno.cc create mode 100644 lib/sanitizer_common/sanitizer_errno.h create mode 100644 lib/sanitizer_common/sanitizer_errno_codes.h create mode 100644 lib/sanitizer_common/sanitizer_file.cc create mode 100644 lib/sanitizer_common/sanitizer_file.h create mode 100644 lib/sanitizer_common/sanitizer_flag_parser.cc create mode 100644 lib/sanitizer_common/sanitizer_flag_parser.h create mode 100644 lib/sanitizer_common/sanitizer_flags.cc create mode 100644 lib/sanitizer_common/sanitizer_flags.h create mode 100644 lib/sanitizer_common/sanitizer_flags.inc create mode 100644 lib/sanitizer_common/sanitizer_freebsd.h create mode 100644 lib/sanitizer_common/sanitizer_fuchsia.cc create mode 100644 lib/sanitizer_common/sanitizer_fuchsia.h create mode 100644 lib/sanitizer_common/sanitizer_getauxval.h create mode 100644 lib/sanitizer_common/sanitizer_interface_internal.h create mode 100644 lib/sanitizer_common/sanitizer_internal_defs.h create mode 100644 lib/sanitizer_common/sanitizer_lfstack.h create mode 100644 lib/sanitizer_common/sanitizer_libc.cc create mode 100644 lib/sanitizer_common/sanitizer_libc.h create mode 100644 lib/sanitizer_common/sanitizer_libignore.cc create mode 100644 lib/sanitizer_common/sanitizer_libignore.h create mode 100644 lib/sanitizer_common/sanitizer_linux.cc create mode 100644 lib/sanitizer_common/sanitizer_linux.h create mode 100644 lib/sanitizer_common/sanitizer_linux_libcdep.cc create mode 100644 lib/sanitizer_common/sanitizer_linux_mips64.S create mode 100644 lib/sanitizer_common/sanitizer_linux_s390.cc create mode 100644 lib/sanitizer_common/sanitizer_linux_x86_64.S create mode 100644 lib/sanitizer_common/sanitizer_list.h create mode 100644 lib/sanitizer_common/sanitizer_mac.cc create mode 100644 lib/sanitizer_common/sanitizer_mac.h create mode 100644 lib/sanitizer_common/sanitizer_mac_libcdep.cc create mode 100644 lib/sanitizer_common/sanitizer_malloc_mac.inc create mode 100644 lib/sanitizer_common/sanitizer_mutex.h create mode 100644 lib/sanitizer_common/sanitizer_persistent_allocator.cc create mode 100644 lib/sanitizer_common/sanitizer_persistent_allocator.h create mode 100644 lib/sanitizer_common/sanitizer_placement_new.h create mode 100644 lib/sanitizer_common/sanitizer_platform.h create mode 100644 lib/sanitizer_common/sanitizer_platform_interceptors.h create mode 100644 lib/sanitizer_common/sanitizer_platform_limits_linux.cc create mode 100644 lib/sanitizer_common/sanitizer_platform_limits_netbsd.cc create mode 100644 lib/sanitizer_common/sanitizer_platform_limits_netbsd.h create mode 100644 lib/sanitizer_common/sanitizer_platform_limits_posix.cc create mode 100644 lib/sanitizer_common/sanitizer_platform_limits_posix.h create mode 100644 lib/sanitizer_common/sanitizer_platform_limits_solaris.cc create mode 100644 lib/sanitizer_common/sanitizer_platform_limits_solaris.h create mode 100644 lib/sanitizer_common/sanitizer_posix.cc create mode 100644 lib/sanitizer_common/sanitizer_posix.h create mode 100644 lib/sanitizer_common/sanitizer_posix_libcdep.cc create mode 100644 lib/sanitizer_common/sanitizer_printf.cc create mode 100644 lib/sanitizer_common/sanitizer_procmaps.h create mode 100644 lib/sanitizer_common/sanitizer_procmaps_common.cc create mode 100644 lib/sanitizer_common/sanitizer_procmaps_freebsd.cc create mode 100644 lib/sanitizer_common/sanitizer_procmaps_linux.cc create mode 100644 lib/sanitizer_common/sanitizer_procmaps_mac.cc create mode 100644 lib/sanitizer_common/sanitizer_procmaps_solaris.cc create mode 100644 lib/sanitizer_common/sanitizer_quarantine.h create mode 100644 lib/sanitizer_common/sanitizer_report_decorator.h create mode 100644 lib/sanitizer_common/sanitizer_signal_interceptors.inc create mode 100644 lib/sanitizer_common/sanitizer_solaris.cc create mode 100644 lib/sanitizer_common/sanitizer_stackdepot.cc create mode 100644 lib/sanitizer_common/sanitizer_stackdepot.h create mode 100644 lib/sanitizer_common/sanitizer_stackdepotbase.h create mode 100644 lib/sanitizer_common/sanitizer_stacktrace.cc create mode 100644 lib/sanitizer_common/sanitizer_stacktrace.h create mode 100644 lib/sanitizer_common/sanitizer_stacktrace_libcdep.cc create mode 100644 lib/sanitizer_common/sanitizer_stacktrace_printer.cc create mode 100644 lib/sanitizer_common/sanitizer_stacktrace_printer.h create mode 100644 lib/sanitizer_common/sanitizer_stoptheworld.h create mode 100644 lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc create mode 100644 lib/sanitizer_common/sanitizer_stoptheworld_mac.cc create mode 100644 lib/sanitizer_common/sanitizer_suppressions.cc create mode 100644 lib/sanitizer_common/sanitizer_suppressions.h create mode 100644 lib/sanitizer_common/sanitizer_symbolizer.cc create mode 100644 lib/sanitizer_common/sanitizer_symbolizer.h create mode 100644 lib/sanitizer_common/sanitizer_symbolizer_fuchsia.cc create mode 100644 lib/sanitizer_common/sanitizer_symbolizer_internal.h create mode 100644 lib/sanitizer_common/sanitizer_symbolizer_libbacktrace.cc create mode 100644 lib/sanitizer_common/sanitizer_symbolizer_libbacktrace.h create mode 100644 lib/sanitizer_common/sanitizer_symbolizer_libcdep.cc create mode 100644 lib/sanitizer_common/sanitizer_symbolizer_mac.cc create mode 100644 lib/sanitizer_common/sanitizer_symbolizer_mac.h create mode 100644 lib/sanitizer_common/sanitizer_symbolizer_posix_libcdep.cc create mode 100644 lib/sanitizer_common/sanitizer_symbolizer_win.cc create mode 100644 lib/sanitizer_common/sanitizer_syscall_generic.inc create mode 100644 lib/sanitizer_common/sanitizer_syscall_linux_aarch64.inc create mode 100644 lib/sanitizer_common/sanitizer_syscall_linux_arm.inc create mode 100644 lib/sanitizer_common/sanitizer_syscall_linux_x86_64.inc create mode 100644 lib/sanitizer_common/sanitizer_termination.cc create mode 100644 lib/sanitizer_common/sanitizer_thread_registry.cc create mode 100644 lib/sanitizer_common/sanitizer_thread_registry.h create mode 100644 lib/sanitizer_common/sanitizer_tls_get_addr.cc create mode 100644 lib/sanitizer_common/sanitizer_tls_get_addr.h create mode 100644 lib/sanitizer_common/sanitizer_unwind_linux_libcdep.cc create mode 100644 lib/sanitizer_common/sanitizer_vector.h create mode 100644 lib/sanitizer_common/sanitizer_win.cc create mode 100644 lib/sanitizer_common/sanitizer_win.h create mode 100644 lib/sanitizer_common/sanitizer_win_defs.h create mode 100644 lib/sanitizer_common/sanitizer_win_dll_thunk.cc create mode 100644 lib/sanitizer_common/sanitizer_win_dll_thunk.h create mode 100644 lib/sanitizer_common/sanitizer_win_dynamic_runtime_thunk.cc create mode 100644 lib/sanitizer_common/sanitizer_win_weak_interception.cc create mode 100644 lib/sanitizer_common/sanitizer_win_weak_interception.h create mode 100755 lib/sanitizer_common/scripts/check_lint.sh create mode 100755 lib/sanitizer_common/scripts/cpplint.py create mode 100755 lib/sanitizer_common/scripts/gen_dynamic_list.py create mode 100755 lib/sanitizer_common/scripts/litlint.py create mode 100755 lib/sanitizer_common/scripts/litlint_test.py create mode 100755 lib/sanitizer_common/scripts/sancov.py create mode 100644 lib/sanitizer_common/symbolizer/sanitizer_symbolize.cc create mode 100644 lib/sanitizer_common/symbolizer/sanitizer_wrappers.cc create mode 100755 lib/sanitizer_common/symbolizer/scripts/ar_to_bc.sh create mode 100755 lib/sanitizer_common/symbolizer/scripts/build_symbolizer.sh create mode 100644 lib/sanitizer_common/symbolizer/scripts/global_symbols.txt create mode 100644 lib/sanitizer_common/tests/CMakeLists.txt create mode 100644 lib/sanitizer_common/tests/malloc_stress_transfer_test.cc create mode 100644 lib/sanitizer_common/tests/sanitizer_allocator_test.cc create mode 100644 lib/sanitizer_common/tests/sanitizer_allocator_testlib.cc create mode 100644 lib/sanitizer_common/tests/sanitizer_atomic_test.cc create mode 100644 lib/sanitizer_common/tests/sanitizer_bitvector_test.cc create mode 100644 lib/sanitizer_common/tests/sanitizer_bvgraph_test.cc create mode 100644 lib/sanitizer_common/tests/sanitizer_common_test.cc create mode 100644 lib/sanitizer_common/tests/sanitizer_deadlock_detector_test.cc create mode 100644 lib/sanitizer_common/tests/sanitizer_flags_test.cc create mode 100644 lib/sanitizer_common/tests/sanitizer_format_interceptor_test.cc create mode 100644 lib/sanitizer_common/tests/sanitizer_ioctl_test.cc create mode 100644 lib/sanitizer_common/tests/sanitizer_libc_test.cc create mode 100644 lib/sanitizer_common/tests/sanitizer_linux_test.cc create mode 100644 lib/sanitizer_common/tests/sanitizer_list_test.cc create mode 100644 lib/sanitizer_common/tests/sanitizer_mutex_test.cc create mode 100644 lib/sanitizer_common/tests/sanitizer_nolibc_test.cc create mode 100644 lib/sanitizer_common/tests/sanitizer_nolibc_test_main.cc create mode 100644 lib/sanitizer_common/tests/sanitizer_posix_test.cc create mode 100644 lib/sanitizer_common/tests/sanitizer_printf_test.cc create mode 100644 lib/sanitizer_common/tests/sanitizer_procmaps_test.cc create mode 100644 lib/sanitizer_common/tests/sanitizer_pthread_wrappers.h create mode 100644 lib/sanitizer_common/tests/sanitizer_quarantine_test.cc create mode 100644 lib/sanitizer_common/tests/sanitizer_stackdepot_test.cc create mode 100644 lib/sanitizer_common/tests/sanitizer_stacktrace_printer_test.cc create mode 100644 lib/sanitizer_common/tests/sanitizer_stacktrace_test.cc create mode 100644 lib/sanitizer_common/tests/sanitizer_stoptheworld_test.cc create mode 100644 lib/sanitizer_common/tests/sanitizer_stoptheworld_testlib.cc create mode 100644 lib/sanitizer_common/tests/sanitizer_suppressions_test.cc create mode 100644 lib/sanitizer_common/tests/sanitizer_symbolizer_test.cc create mode 100644 lib/sanitizer_common/tests/sanitizer_test_config.h create mode 100644 lib/sanitizer_common/tests/sanitizer_test_main.cc create mode 100644 lib/sanitizer_common/tests/sanitizer_test_utils.h create mode 100644 lib/sanitizer_common/tests/sanitizer_thread_registry_test.cc create mode 100644 lib/sanitizer_common/tests/sanitizer_vector_test.cc create mode 100644 lib/sanitizer_common/tests/standalone_malloc_test.cc create mode 100644 lib/sanitizer_common/weak_symbols.txt create mode 100644 lib/scudo/CMakeLists.txt create mode 100644 lib/scudo/scudo_allocator.cpp create mode 100644 lib/scudo/scudo_allocator.h create mode 100644 lib/scudo/scudo_allocator_combined.h create mode 100644 lib/scudo/scudo_allocator_secondary.h create mode 100644 lib/scudo/scudo_crc32.cpp create mode 100644 lib/scudo/scudo_crc32.h create mode 100644 lib/scudo/scudo_flags.cpp create mode 100644 lib/scudo/scudo_flags.h create mode 100644 lib/scudo/scudo_flags.inc create mode 100644 lib/scudo/scudo_interceptors.cpp create mode 100644 lib/scudo/scudo_interface_internal.h create mode 100644 lib/scudo/scudo_new_delete.cpp create mode 100644 lib/scudo/scudo_platform.h create mode 100644 lib/scudo/scudo_termination.cpp create mode 100644 lib/scudo/scudo_tsd.h create mode 100644 lib/scudo/scudo_tsd_exclusive.cpp create mode 100644 lib/scudo/scudo_tsd_exclusive.inc create mode 100644 lib/scudo/scudo_tsd_shared.cpp create mode 100644 lib/scudo/scudo_tsd_shared.inc create mode 100644 lib/scudo/scudo_utils.cpp create mode 100644 lib/scudo/scudo_utils.h create mode 100644 lib/stats/CMakeLists.txt create mode 100644 lib/stats/stats.cc create mode 100644 lib/stats/stats.h create mode 100644 lib/stats/stats_client.cc create mode 100644 lib/tsan/.clang-format create mode 100644 lib/tsan/CMakeLists.txt create mode 100755 lib/tsan/analyze_libtsan.sh create mode 100644 lib/tsan/benchmarks/mini_bench_local.cc create mode 100644 lib/tsan/benchmarks/mini_bench_shared.cc create mode 100644 lib/tsan/benchmarks/start_many_threads.cc create mode 100644 lib/tsan/benchmarks/vts_many_threads_bench.cc create mode 100755 lib/tsan/check_analyze.sh create mode 100755 lib/tsan/check_cmake.sh create mode 100644 lib/tsan/dd/CMakeLists.txt create mode 100644 lib/tsan/dd/dd_interceptors.cc create mode 100644 lib/tsan/dd/dd_rtl.cc create mode 100644 lib/tsan/dd/dd_rtl.h create mode 100644 lib/tsan/go/build.bat create mode 100755 lib/tsan/go/buildgo.sh create mode 100644 lib/tsan/go/test.c create mode 100644 lib/tsan/go/tsan_go.cc create mode 100644 lib/tsan/rtl/tsan.syms.extra create mode 100644 lib/tsan/rtl/tsan_clock.cc create mode 100644 lib/tsan/rtl/tsan_clock.h create mode 100644 lib/tsan/rtl/tsan_debugging.cc create mode 100644 lib/tsan/rtl/tsan_defs.h create mode 100644 lib/tsan/rtl/tsan_dense_alloc.h create mode 100644 lib/tsan/rtl/tsan_external.cc create mode 100644 lib/tsan/rtl/tsan_fd.cc create mode 100644 lib/tsan/rtl/tsan_fd.h create mode 100644 lib/tsan/rtl/tsan_flags.cc create mode 100644 lib/tsan/rtl/tsan_flags.h create mode 100644 lib/tsan/rtl/tsan_flags.inc create mode 100644 lib/tsan/rtl/tsan_ignoreset.cc create mode 100644 lib/tsan/rtl/tsan_ignoreset.h create mode 100644 lib/tsan/rtl/tsan_interceptors.cc create mode 100644 lib/tsan/rtl/tsan_interceptors.h create mode 100644 lib/tsan/rtl/tsan_interceptors_mac.cc create mode 100644 lib/tsan/rtl/tsan_interface.cc create mode 100644 lib/tsan/rtl/tsan_interface.h create mode 100644 lib/tsan/rtl/tsan_interface_ann.cc create mode 100644 lib/tsan/rtl/tsan_interface_ann.h create mode 100644 lib/tsan/rtl/tsan_interface_atomic.cc create mode 100644 lib/tsan/rtl/tsan_interface_inl.h create mode 100644 lib/tsan/rtl/tsan_interface_java.cc create mode 100644 lib/tsan/rtl/tsan_interface_java.h create mode 100644 lib/tsan/rtl/tsan_libdispatch_mac.cc create mode 100644 lib/tsan/rtl/tsan_malloc_mac.cc create mode 100644 lib/tsan/rtl/tsan_md5.cc create mode 100644 lib/tsan/rtl/tsan_mman.cc create mode 100644 lib/tsan/rtl/tsan_mman.h create mode 100644 lib/tsan/rtl/tsan_mutex.cc create mode 100644 lib/tsan/rtl/tsan_mutex.h create mode 100644 lib/tsan/rtl/tsan_mutexset.cc create mode 100644 lib/tsan/rtl/tsan_mutexset.h create mode 100644 lib/tsan/rtl/tsan_new_delete.cc create mode 100644 lib/tsan/rtl/tsan_platform.h create mode 100644 lib/tsan/rtl/tsan_platform_linux.cc create mode 100644 lib/tsan/rtl/tsan_platform_mac.cc create mode 100644 lib/tsan/rtl/tsan_platform_posix.cc create mode 100644 lib/tsan/rtl/tsan_platform_windows.cc create mode 100644 lib/tsan/rtl/tsan_ppc_regs.h create mode 100644 lib/tsan/rtl/tsan_preinit.cc create mode 100644 lib/tsan/rtl/tsan_report.cc create mode 100644 lib/tsan/rtl/tsan_report.h create mode 100644 lib/tsan/rtl/tsan_rtl.cc create mode 100644 lib/tsan/rtl/tsan_rtl.h create mode 100644 lib/tsan/rtl/tsan_rtl_aarch64.S create mode 100644 lib/tsan/rtl/tsan_rtl_amd64.S create mode 100644 lib/tsan/rtl/tsan_rtl_mips64.S create mode 100644 lib/tsan/rtl/tsan_rtl_mutex.cc create mode 100644 lib/tsan/rtl/tsan_rtl_ppc64.S create mode 100644 lib/tsan/rtl/tsan_rtl_proc.cc create mode 100644 lib/tsan/rtl/tsan_rtl_report.cc create mode 100644 lib/tsan/rtl/tsan_rtl_thread.cc create mode 100644 lib/tsan/rtl/tsan_stack_trace.cc create mode 100644 lib/tsan/rtl/tsan_stack_trace.h create mode 100644 lib/tsan/rtl/tsan_stat.cc create mode 100644 lib/tsan/rtl/tsan_stat.h create mode 100644 lib/tsan/rtl/tsan_suppressions.cc create mode 100644 lib/tsan/rtl/tsan_suppressions.h create mode 100644 lib/tsan/rtl/tsan_symbolize.cc create mode 100644 lib/tsan/rtl/tsan_symbolize.h create mode 100644 lib/tsan/rtl/tsan_sync.cc create mode 100644 lib/tsan/rtl/tsan_sync.h create mode 100644 lib/tsan/rtl/tsan_trace.h create mode 100644 lib/tsan/rtl/tsan_update_shadow_word_inl.h create mode 100644 lib/tsan/tests/CMakeLists.txt create mode 100644 lib/tsan/tests/rtl/CMakeLists.txt create mode 100644 lib/tsan/tests/rtl/tsan_bench.cc create mode 100644 lib/tsan/tests/rtl/tsan_mop.cc create mode 100644 lib/tsan/tests/rtl/tsan_mutex.cc create mode 100644 lib/tsan/tests/rtl/tsan_posix.cc create mode 100644 lib/tsan/tests/rtl/tsan_posix_util.h create mode 100644 lib/tsan/tests/rtl/tsan_string.cc create mode 100644 lib/tsan/tests/rtl/tsan_test.cc create mode 100644 lib/tsan/tests/rtl/tsan_test_util.h create mode 100644 lib/tsan/tests/rtl/tsan_test_util_posix.cc create mode 100644 lib/tsan/tests/rtl/tsan_thread.cc create mode 100644 lib/tsan/tests/unit/CMakeLists.txt create mode 100644 lib/tsan/tests/unit/tsan_clock_test.cc create mode 100644 lib/tsan/tests/unit/tsan_dense_alloc_test.cc create mode 100644 lib/tsan/tests/unit/tsan_flags_test.cc create mode 100644 lib/tsan/tests/unit/tsan_mman_test.cc create mode 100644 lib/tsan/tests/unit/tsan_mutex_test.cc create mode 100644 lib/tsan/tests/unit/tsan_mutexset_test.cc create mode 100644 lib/tsan/tests/unit/tsan_shadow_test.cc create mode 100644 lib/tsan/tests/unit/tsan_stack_test.cc create mode 100644 lib/tsan/tests/unit/tsan_sync_test.cc create mode 100644 lib/tsan/tests/unit/tsan_unit_test_main.cc create mode 100644 lib/ubsan/CMakeLists.txt create mode 100644 lib/ubsan/ubsan.syms.extra create mode 100644 lib/ubsan/ubsan_checks.inc create mode 100644 lib/ubsan/ubsan_diag.cc create mode 100644 lib/ubsan/ubsan_diag.h create mode 100644 lib/ubsan/ubsan_diag_standalone.cc create mode 100644 lib/ubsan/ubsan_flags.cc create mode 100644 lib/ubsan/ubsan_flags.h create mode 100644 lib/ubsan/ubsan_flags.inc create mode 100644 lib/ubsan/ubsan_handlers.cc create mode 100644 lib/ubsan/ubsan_handlers.h create mode 100644 lib/ubsan/ubsan_handlers_cxx.cc create mode 100644 lib/ubsan/ubsan_handlers_cxx.h create mode 100644 lib/ubsan/ubsan_init.cc create mode 100644 lib/ubsan/ubsan_init.h create mode 100644 lib/ubsan/ubsan_init_standalone.cc create mode 100644 lib/ubsan/ubsan_interface.inc create mode 100644 lib/ubsan/ubsan_platform.h create mode 100644 lib/ubsan/ubsan_signals_standalone.cc create mode 100644 lib/ubsan/ubsan_signals_standalone.h create mode 100644 lib/ubsan/ubsan_type_hash.cc create mode 100644 lib/ubsan/ubsan_type_hash.h create mode 100644 lib/ubsan/ubsan_type_hash_itanium.cc create mode 100644 lib/ubsan/ubsan_type_hash_win.cc create mode 100644 lib/ubsan/ubsan_value.cc create mode 100644 lib/ubsan/ubsan_value.h create mode 100644 lib/ubsan/ubsan_win_dll_thunk.cc create mode 100644 lib/ubsan/ubsan_win_dynamic_runtime_thunk.cc create mode 100644 lib/ubsan/ubsan_win_weak_interception.cc create mode 100644 lib/ubsan/weak_symbols.txt create mode 100644 lib/ubsan_minimal/CMakeLists.txt create mode 100644 lib/ubsan_minimal/ubsan.syms.extra create mode 100644 lib/ubsan_minimal/ubsan_minimal_handlers.cc create mode 100644 lib/xray/CMakeLists.txt create mode 100644 lib/xray/tests/CMakeLists.txt create mode 100644 lib/xray/tests/unit/CMakeLists.txt create mode 100644 lib/xray/tests/unit/buffer_queue_test.cc create mode 100644 lib/xray/tests/unit/fdr_logging_test.cc create mode 100644 lib/xray/tests/unit/xray_unit_test_main.cc create mode 100644 lib/xray/weak_symbols.txt create mode 100644 lib/xray/xray_AArch64.cc create mode 100644 lib/xray/xray_always_instrument.txt create mode 100644 lib/xray/xray_arm.cc create mode 100644 lib/xray/xray_buffer_queue.cc create mode 100644 lib/xray/xray_buffer_queue.h create mode 100644 lib/xray/xray_defs.h create mode 100644 lib/xray/xray_fdr_log_records.h create mode 100644 lib/xray/xray_fdr_logging.cc create mode 100644 lib/xray/xray_fdr_logging.h create mode 100644 lib/xray/xray_fdr_logging_impl.h create mode 100644 lib/xray/xray_flags.cc create mode 100644 lib/xray/xray_flags.h create mode 100644 lib/xray/xray_flags.inc create mode 100644 lib/xray/xray_init.cc create mode 100644 lib/xray/xray_inmemory_log.cc create mode 100644 lib/xray/xray_inmemory_log.h create mode 100644 lib/xray/xray_interface.cc create mode 100644 lib/xray/xray_interface_internal.h create mode 100644 lib/xray/xray_log_interface.cc create mode 100644 lib/xray/xray_mips.cc create mode 100644 lib/xray/xray_mips64.cc create mode 100644 lib/xray/xray_never_instrument.txt create mode 100644 lib/xray/xray_powerpc64.cc create mode 100644 lib/xray/xray_powerpc64.inc create mode 100644 lib/xray/xray_trampoline_AArch64.S create mode 100644 lib/xray/xray_trampoline_arm.S create mode 100644 lib/xray/xray_trampoline_mips.S create mode 100644 lib/xray/xray_trampoline_mips64.S create mode 100644 lib/xray/xray_trampoline_powerpc64.cc create mode 100644 lib/xray/xray_trampoline_powerpc64_asm.S create mode 100644 lib/xray/xray_trampoline_x86_64.S create mode 100644 lib/xray/xray_tsc.h create mode 100644 lib/xray/xray_utils.cc create mode 100644 lib/xray/xray_utils.h create mode 100644 lib/xray/xray_x86_64.cc create mode 100644 lib/xray/xray_x86_64.inc create mode 100644 test/BlocksRuntime/block-static.c create mode 100644 test/BlocksRuntime/blockimport.c create mode 100644 test/BlocksRuntime/byrefaccess.c create mode 100644 test/BlocksRuntime/byrefcopy.c create mode 100644 test/BlocksRuntime/byrefcopycopy.c create mode 100644 test/BlocksRuntime/byrefcopyinner.c create mode 100644 test/BlocksRuntime/byrefcopyint.c create mode 100644 test/BlocksRuntime/byrefcopystack.c create mode 100644 test/BlocksRuntime/byrefsanity.c create mode 100644 test/BlocksRuntime/byrefstruct.c create mode 100644 test/BlocksRuntime/c99.c create mode 100644 test/BlocksRuntime/cast.c create mode 100644 test/BlocksRuntime/constassign.c create mode 100644 test/BlocksRuntime/copy-block-literal-rdar6439600.c create mode 100644 test/BlocksRuntime/copyconstructor.C create mode 100644 test/BlocksRuntime/copynull.c create mode 100644 test/BlocksRuntime/dispatch_async.c create mode 100644 test/BlocksRuntime/dispatch_call_Block_with_release.c create mode 100644 test/BlocksRuntime/fail.c create mode 100644 test/BlocksRuntime/flagsisa.c create mode 100644 test/BlocksRuntime/globalexpression.c create mode 100644 test/BlocksRuntime/goto.c create mode 100644 test/BlocksRuntime/hasdescriptor.c create mode 100644 test/BlocksRuntime/josh.C create mode 100644 test/BlocksRuntime/k-and-r.c create mode 100644 test/BlocksRuntime/large-struct.c create mode 100644 test/BlocksRuntime/localisglobal.c create mode 100644 test/BlocksRuntime/macro.c create mode 100644 test/BlocksRuntime/makefile create mode 100644 test/BlocksRuntime/modglobal.c create mode 100644 test/BlocksRuntime/nestedimport.c create mode 100644 test/BlocksRuntime/nullblockisa.c create mode 100644 test/BlocksRuntime/objectRRGC.c create mode 100644 test/BlocksRuntime/objectassign.c create mode 100644 test/BlocksRuntime/orbars.c create mode 100644 test/BlocksRuntime/rdar6396238.c create mode 100644 test/BlocksRuntime/rdar6405500.c create mode 100644 test/BlocksRuntime/rdar6414583.c create mode 100644 test/BlocksRuntime/recursive-block.c create mode 100644 test/BlocksRuntime/recursive-test.c create mode 100644 test/BlocksRuntime/recursiveassign.c create mode 100644 test/BlocksRuntime/reference.C create mode 100644 test/BlocksRuntime/rettypepromotion.c create mode 100644 test/BlocksRuntime/returnfunctionptr.c create mode 100644 test/BlocksRuntime/shorthandexpression.c create mode 100644 test/BlocksRuntime/sizeof.c create mode 100644 test/BlocksRuntime/small-struct.c create mode 100644 test/BlocksRuntime/structmember.c create mode 100644 test/BlocksRuntime/testfilerunner.h create mode 100644 test/BlocksRuntime/testfilerunner.m create mode 100644 test/BlocksRuntime/varargs-bad-assign.c create mode 100644 test/BlocksRuntime/varargs.c create mode 100644 test/BlocksRuntime/variadic.c create mode 100644 test/BlocksRuntime/voidarg.c create mode 100644 test/CMakeLists.txt create mode 100644 test/asan/CMakeLists.txt create mode 100644 test/asan/TestCases/Android/lit.local.cfg create mode 100644 test/asan/TestCases/Darwin/abort_on_error.cc create mode 100644 test/asan/TestCases/Darwin/address-range-limit.mm create mode 100644 test/asan/TestCases/Darwin/asan_gen_prefixes.cc create mode 100644 test/asan/TestCases/Darwin/atos-symbolizer-dyld-root-path.cc create mode 100644 test/asan/TestCases/Darwin/atos-symbolizer.cc create mode 100644 test/asan/TestCases/Darwin/crashlog-stacktraces.c create mode 100644 test/asan/TestCases/Darwin/cstring_literals_regtest.mm create mode 100644 test/asan/TestCases/Darwin/cstring_section.c create mode 100644 test/asan/TestCases/Darwin/dead-strip.c create mode 100644 test/asan/TestCases/Darwin/dladdr-demangling.cc create mode 100644 test/asan/TestCases/Darwin/dump_registers.cc create mode 100644 test/asan/TestCases/Darwin/dyld_insert_libraries_reexec.cc create mode 100644 test/asan/TestCases/Darwin/dyld_insert_libraries_remove.cc create mode 100644 test/asan/TestCases/Darwin/empty-section.cc create mode 100644 test/asan/TestCases/Darwin/fclose.c create mode 100644 test/asan/TestCases/Darwin/getpwnam.c create mode 100644 test/asan/TestCases/Darwin/haswell-symbolication.cc create mode 100644 test/asan/TestCases/Darwin/interface_symbols_darwin.cc create mode 100644 test/asan/TestCases/Darwin/linked-only.cc create mode 100644 test/asan/TestCases/Darwin/lit.local.cfg create mode 100644 test/asan/TestCases/Darwin/malloc_destroy_zone.cc create mode 100644 test/asan/TestCases/Darwin/malloc_set_zone_name-mprotect.cc create mode 100644 test/asan/TestCases/Darwin/malloc_size_crash.mm create mode 100644 test/asan/TestCases/Darwin/malloc_zone-protected.cc create mode 100644 test/asan/TestCases/Darwin/mixing-global-constructors.cc create mode 100644 test/asan/TestCases/Darwin/nil-return-struct.mm create mode 100644 test/asan/TestCases/Darwin/objc-odr.mm create mode 100644 test/asan/TestCases/Darwin/odr-lto.cc create mode 100644 test/asan/TestCases/Darwin/reexec-insert-libraries-env.cc create mode 100644 test/asan/TestCases/Darwin/sandbox-symbolizer.cc create mode 100644 test/asan/TestCases/Darwin/scribble.cc create mode 100644 test/asan/TestCases/Darwin/segv_read_write.c create mode 100644 test/asan/TestCases/Darwin/suppressions-darwin.cc create mode 100644 test/asan/TestCases/Darwin/suppressions-function.cc create mode 100644 test/asan/TestCases/Darwin/suppressions-sandbox.cc create mode 100644 test/asan/TestCases/Darwin/unset-insert-libraries-on-exec.cc create mode 100644 test/asan/TestCases/Darwin/uuid.cc create mode 100644 test/asan/TestCases/Helpers/blacklist-extra.cc create mode 100644 test/asan/TestCases/Helpers/echo-env.cc create mode 100644 test/asan/TestCases/Helpers/init-order-atexit-extra.cc create mode 100644 test/asan/TestCases/Helpers/initialization-blacklist-extra.cc create mode 100644 test/asan/TestCases/Helpers/initialization-blacklist-extra2.cc create mode 100644 test/asan/TestCases/Helpers/initialization-blacklist.txt create mode 100644 test/asan/TestCases/Helpers/initialization-bug-extra.cc create mode 100644 test/asan/TestCases/Helpers/initialization-bug-extra2.cc create mode 100644 test/asan/TestCases/Helpers/initialization-constexpr-extra.cc create mode 100644 test/asan/TestCases/Helpers/initialization-nobug-extra.cc create mode 100644 test/asan/TestCases/Helpers/lit.local.cfg create mode 100644 test/asan/TestCases/Helpers/underflow.cc create mode 100644 test/asan/TestCases/Linux/abort_on_error.cc create mode 100644 test/asan/TestCases/Linux/activation-options.cc create mode 100644 test/asan/TestCases/Linux/aligned_delete_test.cc create mode 100644 test/asan/TestCases/Linux/allocator_oom_test.cc create mode 100644 test/asan/TestCases/Linux/asan-asm-stacktrace-test.cc create mode 100644 test/asan/TestCases/Linux/asan_default_suppressions.cc create mode 100644 test/asan/TestCases/Linux/asan_dlopen_test.cc create mode 100644 test/asan/TestCases/Linux/asan_prelink_test.cc create mode 100644 test/asan/TestCases/Linux/asan_preload_test-1.cc create mode 100644 test/asan/TestCases/Linux/asan_preload_test-2.cc create mode 100644 test/asan/TestCases/Linux/asan_preload_test-3.cc create mode 100644 test/asan/TestCases/Linux/asan_rt_confict_test-1.cc create mode 100644 test/asan/TestCases/Linux/asan_rt_confict_test-2.cc create mode 100644 test/asan/TestCases/Linux/auto_memory_profile_test.cc create mode 100644 test/asan/TestCases/Linux/calloc-preload.c create mode 100644 test/asan/TestCases/Linux/clang_gcc_abi.cc create mode 100644 test/asan/TestCases/Linux/clone_test.cc create mode 100644 test/asan/TestCases/Linux/coverage-missing.cc create mode 100644 test/asan/TestCases/Linux/cuda_test.cc create mode 100644 test/asan/TestCases/Linux/function-sections-are-bad.cc create mode 100644 test/asan/TestCases/Linux/global-overflow-bfd.cc create mode 100644 test/asan/TestCases/Linux/global-overflow-lld.cc create mode 100644 test/asan/TestCases/Linux/globals-gc-sections-lld.cc create mode 100644 test/asan/TestCases/Linux/init-order-dlopen.cc create mode 100644 test/asan/TestCases/Linux/init_fini_sections.cc create mode 100644 test/asan/TestCases/Linux/initialization-bug-any-order.cc create mode 100644 test/asan/TestCases/Linux/interception_malloc_test.cc create mode 100644 test/asan/TestCases/Linux/interception_readdir_r_test.cc create mode 100644 test/asan/TestCases/Linux/interception_test.cc create mode 100644 test/asan/TestCases/Linux/interface_symbols_linux.cc create mode 100644 test/asan/TestCases/Linux/kernel-area.cc create mode 100644 test/asan/TestCases/Linux/leak.cc create mode 100644 test/asan/TestCases/Linux/leak_check_segv.cc create mode 100644 test/asan/TestCases/Linux/lit.local.cfg create mode 100644 test/asan/TestCases/Linux/local_alias.cc create mode 100644 test/asan/TestCases/Linux/longjmp_chk.c create mode 100644 test/asan/TestCases/Linux/malloc-in-qsort.cc create mode 100644 test/asan/TestCases/Linux/malloc_delete_mismatch.cc create mode 100644 test/asan/TestCases/Linux/memmem_test.cc create mode 100644 test/asan/TestCases/Linux/mincore.cc create mode 100644 test/asan/TestCases/Linux/new_delete_mismatch.cc create mode 100644 test/asan/TestCases/Linux/nohugepage_test.cc create mode 100644 test/asan/TestCases/Linux/odr-violation.cc create mode 100644 test/asan/TestCases/Linux/odr_c_test.c create mode 100644 test/asan/TestCases/Linux/overflow-in-qsort.cc create mode 100644 test/asan/TestCases/Linux/preinit_test.cc create mode 100644 test/asan/TestCases/Linux/preinstalled_signal.cc create mode 100644 test/asan/TestCases/Linux/print_memory_profile_test.cc create mode 100644 test/asan/TestCases/Linux/printf-fortify-1.c create mode 100644 test/asan/TestCases/Linux/printf-fortify-2.c create mode 100644 test/asan/TestCases/Linux/printf-fortify-3.c create mode 100644 test/asan/TestCases/Linux/printf-fortify-4.c create mode 100644 test/asan/TestCases/Linux/printf-fortify-5.c create mode 100644 test/asan/TestCases/Linux/pthread_create_from_constructor.cc create mode 100644 test/asan/TestCases/Linux/pthread_create_version.cc create mode 100644 test/asan/TestCases/Linux/ptrace.cc create mode 100644 test/asan/TestCases/Linux/pvalloc-overflow.cc create mode 100644 test/asan/TestCases/Linux/quarantine_size_mb.cc create mode 100644 test/asan/TestCases/Linux/read_binary_name_regtest.c create mode 100644 test/asan/TestCases/Linux/recoverable-lsan.cc create mode 100644 test/asan/TestCases/Linux/recvfrom.cc create mode 100644 test/asan/TestCases/Linux/release_to_os_test.cc create mode 100644 test/asan/TestCases/Linux/rlimit_mmap_test.cc create mode 100644 test/asan/TestCases/Linux/sanbox_read_proc_self_maps_test.cc create mode 100644 test/asan/TestCases/Linux/segv_read_write.c create mode 100644 test/asan/TestCases/Linux/shmctl.cc create mode 100644 test/asan/TestCases/Linux/signal_during_stop_the_world.cc create mode 100644 test/asan/TestCases/Linux/sized_delete_test.cc create mode 100644 test/asan/TestCases/Linux/stack-overflow-recovery-mode.cc create mode 100644 test/asan/TestCases/Linux/stack-overflow-sigbus.cc create mode 100644 test/asan/TestCases/Linux/stack-trace-dlclose.cc create mode 100644 test/asan/TestCases/Linux/static_tls.cc create mode 100644 test/asan/TestCases/Linux/stress_dtls.c create mode 100644 test/asan/TestCases/Linux/swapcontext_annotation.cc create mode 100644 test/asan/TestCases/Linux/swapcontext_test.cc create mode 100644 test/asan/TestCases/Linux/syscalls.cc create mode 100644 test/asan/TestCases/Linux/textdomain.c create mode 100644 test/asan/TestCases/Linux/thread_local_quarantine_pthread_join.cc create mode 100644 test/asan/TestCases/Linux/thread_local_quarantine_size_kb.cc create mode 100644 test/asan/TestCases/Linux/uar_signals.cc create mode 100644 test/asan/TestCases/Linux/unpoison_tls.cc create mode 100644 test/asan/TestCases/Posix/asan-sigbus.cpp create mode 100644 test/asan/TestCases/Posix/asan-symbolize-bad-path.cc create mode 100644 test/asan/TestCases/Posix/asan-symbolize-sanity-test.cc create mode 100644 test/asan/TestCases/Posix/asprintf.cc create mode 100644 test/asan/TestCases/Posix/assign_large_valloc_to_global.cc create mode 100644 test/asan/TestCases/Posix/closed-fds.cc create mode 100644 test/asan/TestCases/Posix/concurrent_overflow.cc create mode 100644 test/asan/TestCases/Posix/coverage-fork.cc create mode 100644 test/asan/TestCases/Posix/coverage-module-unloaded.cc create mode 100644 test/asan/TestCases/Posix/coverage-reset.cc create mode 100644 test/asan/TestCases/Posix/coverage.cc create mode 100644 test/asan/TestCases/Posix/current_allocated_bytes.cc create mode 100644 test/asan/TestCases/Posix/deep_call_stack.cc create mode 100644 test/asan/TestCases/Posix/deep_thread_stack.cc create mode 100644 test/asan/TestCases/Posix/dlclose-test.cc create mode 100644 test/asan/TestCases/Posix/fread_fwrite.cc create mode 100644 test/asan/TestCases/Posix/free_hook_realloc.cc create mode 100644 test/asan/TestCases/Posix/freopen.cc create mode 100644 test/asan/TestCases/Posix/gc-test.cc create mode 100644 test/asan/TestCases/Posix/glob.cc create mode 100644 test/asan/TestCases/Posix/glob_test_root/aa create mode 100644 test/asan/TestCases/Posix/glob_test_root/ab create mode 100644 test/asan/TestCases/Posix/glob_test_root/ba create mode 100644 test/asan/TestCases/Posix/global-registration.c create mode 100644 test/asan/TestCases/Posix/halt_on_error-signals.c create mode 100644 test/asan/TestCases/Posix/halt_on_error-torture.cc create mode 100644 test/asan/TestCases/Posix/halt_on_error_suppress_equal_pcs.cc create mode 100644 test/asan/TestCases/Posix/handle_abort_on_error.cc create mode 100644 test/asan/TestCases/Posix/init-order-pthread-create.cc create mode 100644 test/asan/TestCases/Posix/interception-in-shared-lib-test.cc create mode 100644 test/asan/TestCases/Posix/invalid-pointer-pairs-threads.cc create mode 100644 test/asan/TestCases/Posix/ioctl.cc create mode 100644 test/asan/TestCases/Posix/large_allocator_unpoisons_on_free.cc create mode 100644 test/asan/TestCases/Posix/lit.local.cfg create mode 100644 test/asan/TestCases/Posix/log_path_fork_test.cc.disabled create mode 100644 test/asan/TestCases/Posix/mmap_limit_mb.cc create mode 100644 test/asan/TestCases/Posix/new_array_cookie_test.cc create mode 100644 test/asan/TestCases/Posix/new_array_cookie_uaf_test.cc create mode 100644 test/asan/TestCases/Posix/new_array_cookie_with_new_from_class.cc create mode 100644 test/asan/TestCases/Posix/no_asan_gen_globals.c create mode 100644 test/asan/TestCases/Posix/print_cmdline.cc create mode 100644 test/asan/TestCases/Posix/readv.cc create mode 100644 test/asan/TestCases/Posix/shared-lib-test.cc create mode 100644 test/asan/TestCases/Posix/stack-overflow.cc create mode 100644 test/asan/TestCases/Posix/stack-use-after-return.cc create mode 100644 test/asan/TestCases/Posix/start-deactivated.cc create mode 100644 test/asan/TestCases/Posix/strchr.c create mode 100644 test/asan/TestCases/Posix/strerror_r_test.cc create mode 100644 test/asan/TestCases/Posix/strndup_oob_test.cc create mode 100644 test/asan/TestCases/Posix/strndup_oob_test2.cc create mode 100644 test/asan/TestCases/Posix/tsd_dtor_leak.cc create mode 100644 test/asan/TestCases/Posix/wait.cc create mode 100644 test/asan/TestCases/Posix/wait3.cc create mode 100644 test/asan/TestCases/Posix/wait4.cc create mode 100644 test/asan/TestCases/Posix/waitid.cc create mode 100644 test/asan/TestCases/Windows/aligned_mallocs.cc create mode 100644 test/asan/TestCases/Windows/allocators_sanity.cc create mode 100644 test/asan/TestCases/Windows/beginthreadex.cc create mode 100644 test/asan/TestCases/Windows/bind_io_completion_callback.cc create mode 100644 test/asan/TestCases/Windows/bitfield.cc create mode 100644 test/asan/TestCases/Windows/bitfield_uaf.cc create mode 100644 test/asan/TestCases/Windows/calloc_left_oob.cc create mode 100644 test/asan/TestCases/Windows/calloc_right_oob.cc create mode 100644 test/asan/TestCases/Windows/calloc_uaf.cc create mode 100644 test/asan/TestCases/Windows/coverage-basic.cc create mode 100644 test/asan/TestCases/Windows/coverage-dll-stdio.cc create mode 100644 test/asan/TestCases/Windows/crash_read_write.cc create mode 100644 test/asan/TestCases/Windows/crt_initializers.cc create mode 100644 test/asan/TestCases/Windows/delay_dbghelp.cc create mode 100644 test/asan/TestCases/Windows/demangled_names.cc create mode 100644 test/asan/TestCases/Windows/dll_aligned_mallocs.cc create mode 100644 test/asan/TestCases/Windows/dll_allocators_sanity.cc create mode 100644 test/asan/TestCases/Windows/dll_and_lib.cc create mode 100644 test/asan/TestCases/Windows/dll_cerr.cc create mode 100644 test/asan/TestCases/Windows/dll_control_c.cc create mode 100644 test/asan/TestCases/Windows/dll_global_dead_strip.c create mode 100644 test/asan/TestCases/Windows/dll_heap_allocation.cc create mode 100644 test/asan/TestCases/Windows/dll_host.cc create mode 100644 test/asan/TestCases/Windows/dll_intercept_memchr.cc create mode 100644 test/asan/TestCases/Windows/dll_intercept_memcpy.cc create mode 100644 test/asan/TestCases/Windows/dll_intercept_memcpy_indirect.cc create mode 100644 test/asan/TestCases/Windows/dll_intercept_memset.cc create mode 100644 test/asan/TestCases/Windows/dll_intercept_strlen.cc create mode 100644 test/asan/TestCases/Windows/dll_large_function.cc create mode 100644 test/asan/TestCases/Windows/dll_malloc_left_oob.cc create mode 100644 test/asan/TestCases/Windows/dll_malloc_uaf.cc create mode 100644 test/asan/TestCases/Windows/dll_noreturn.cc create mode 100644 test/asan/TestCases/Windows/dll_null_deref.cc create mode 100644 test/asan/TestCases/Windows/dll_operator_array_new_left_oob.cc create mode 100644 test/asan/TestCases/Windows/dll_operator_array_new_with_dtor_left_oob.cc create mode 100644 test/asan/TestCases/Windows/dll_poison_unpoison.cc create mode 100644 test/asan/TestCases/Windows/dll_report_globals_symbolization_at_startup.cc create mode 100644 test/asan/TestCases/Windows/dll_seh.cc create mode 100644 test/asan/TestCases/Windows/dll_stack_use_after_return.cc create mode 100644 test/asan/TestCases/Windows/dll_thread_stack_array_left_oob.cc create mode 100644 test/asan/TestCases/Windows/double_free.cc create mode 100644 test/asan/TestCases/Windows/double_operator_delete.cc create mode 100644 test/asan/TestCases/Windows/free_hook_realloc.cc create mode 100644 test/asan/TestCases/Windows/fuse-lld.cc create mode 100644 test/asan/TestCases/Windows/global_const_string.cc create mode 100644 test/asan/TestCases/Windows/global_const_string_oob.cc create mode 100644 test/asan/TestCases/Windows/global_dead_strip.c create mode 100644 test/asan/TestCases/Windows/hello_world.cc create mode 100644 test/asan/TestCases/Windows/intercept_memcpy.cc create mode 100644 test/asan/TestCases/Windows/intercept_strdup.cc create mode 100644 test/asan/TestCases/Windows/intercept_strlen.cc create mode 100644 test/asan/TestCases/Windows/interface_symbols_windows.cc create mode 100644 test/asan/TestCases/Windows/iostream_sbo.cc create mode 100644 test/asan/TestCases/Windows/lit.local.cfg create mode 100644 test/asan/TestCases/Windows/longjmp.cc create mode 100644 test/asan/TestCases/Windows/malloc_left_oob.cc create mode 100644 test/asan/TestCases/Windows/malloc_right_oob.cc create mode 100644 test/asan/TestCases/Windows/malloc_uaf.cc create mode 100644 test/asan/TestCases/Windows/null_deref.cc create mode 100644 test/asan/TestCases/Windows/null_deref_multiple_dlls.cc create mode 100644 test/asan/TestCases/Windows/oom.cc create mode 100644 test/asan/TestCases/Windows/operator_array_new_left_oob.cc create mode 100644 test/asan/TestCases/Windows/operator_array_new_right_oob.cc create mode 100644 test/asan/TestCases/Windows/operator_array_new_uaf.cc create mode 100644 test/asan/TestCases/Windows/operator_array_new_with_dtor_left_oob.cc create mode 100644 test/asan/TestCases/Windows/operator_delete_wrong_argument.cc create mode 100644 test/asan/TestCases/Windows/operator_new_left_oob.cc create mode 100644 test/asan/TestCases/Windows/operator_new_right_oob.cc create mode 100644 test/asan/TestCases/Windows/operator_new_uaf.cc create mode 100644 test/asan/TestCases/Windows/queue_user_work_item.cc create mode 100644 test/asan/TestCases/Windows/queue_user_work_item_report.cc create mode 100644 test/asan/TestCases/Windows/realloc_left_oob.cc create mode 100644 test/asan/TestCases/Windows/realloc_right_oob.cc create mode 100644 test/asan/TestCases/Windows/realloc_uaf.cc create mode 100644 test/asan/TestCases/Windows/report_after_syminitialize.cc create mode 100644 test/asan/TestCases/Windows/report_globals_reload_dll.cc create mode 100644 test/asan/TestCases/Windows/report_globals_vs_freelibrary.cc create mode 100644 test/asan/TestCases/Windows/seh.cc create mode 100644 test/asan/TestCases/Windows/shadow_conflict_32.cc create mode 100644 test/asan/TestCases/Windows/shadow_mapping_failure.cc create mode 100644 test/asan/TestCases/Windows/stack_array_left_oob.cc create mode 100644 test/asan/TestCases/Windows/stack_array_right_oob.cc create mode 100644 test/asan/TestCases/Windows/stack_array_sanity.cc create mode 100644 test/asan/TestCases/Windows/stack_use_after_return.cc create mode 100644 test/asan/TestCases/Windows/symbols_path.cc create mode 100644 test/asan/TestCases/Windows/thread_simple.cc create mode 100644 test/asan/TestCases/Windows/thread_stack_array_left_oob.cc create mode 100644 test/asan/TestCases/Windows/thread_stack_array_right_oob.cc create mode 100644 test/asan/TestCases/Windows/thread_stack_reuse.cc create mode 100644 test/asan/TestCases/Windows/thread_stress.cc create mode 100644 test/asan/TestCases/Windows/thread_suspended.cc create mode 100644 test/asan/TestCases/Windows/tls_init.cc create mode 100644 test/asan/TestCases/Windows/unsymbolized.cc create mode 100644 test/asan/TestCases/Windows/use_after_realloc.cc create mode 100644 test/asan/TestCases/Windows/use_after_return_linkage.cc create mode 100644 test/asan/TestCases/Windows/windows_h.cc create mode 100644 test/asan/TestCases/Windows/wrong_downcast_on_heap.cc create mode 100644 test/asan/TestCases/Windows/wrong_downcast_on_stack.cc create mode 100644 test/asan/TestCases/alloca_big_alignment.cc create mode 100644 test/asan/TestCases/alloca_constant_size.cc create mode 100644 test/asan/TestCases/alloca_detect_custom_size_.cc create mode 100644 test/asan/TestCases/alloca_instruments_all_paddings.cc create mode 100644 test/asan/TestCases/alloca_loop_unpoisoning.cc create mode 100644 test/asan/TestCases/alloca_overflow_partial.cc create mode 100644 test/asan/TestCases/alloca_overflow_right.cc create mode 100644 test/asan/TestCases/alloca_safe_access.cc create mode 100644 test/asan/TestCases/alloca_underflow_left.cc create mode 100644 test/asan/TestCases/alloca_vla_interact.cc create mode 100644 test/asan/TestCases/allocator_returns_null.cc create mode 100644 test/asan/TestCases/asan_and_llvm_coverage_test.cc create mode 100644 test/asan/TestCases/asan_options-help.cc create mode 100644 test/asan/TestCases/atexit_stats.cc create mode 100644 test/asan/TestCases/atoi_strict.c create mode 100644 test/asan/TestCases/atol_strict.c create mode 100644 test/asan/TestCases/atoll_strict.c create mode 100644 test/asan/TestCases/blacklist.cc create mode 100644 test/asan/TestCases/contiguous_container.cc create mode 100644 test/asan/TestCases/contiguous_container_crash.cc create mode 100644 test/asan/TestCases/coverage-and-lsan.cc create mode 100644 test/asan/TestCases/coverage-disabled.cc create mode 100644 test/asan/TestCases/coverage-trace-pc.cc create mode 100644 test/asan/TestCases/debug_double_free.cc create mode 100644 test/asan/TestCases/debug_locate.cc create mode 100644 test/asan/TestCases/debug_mapping.cc create mode 100644 test/asan/TestCases/debug_ppc64_mapping.cc create mode 100644 test/asan/TestCases/debug_report.cc create mode 100644 test/asan/TestCases/debug_stacks.cc create mode 100644 test/asan/TestCases/deep_stack_uaf.cc create mode 100644 test/asan/TestCases/deep_tail_call.cc create mode 100644 test/asan/TestCases/default_blacklist.cc create mode 100644 test/asan/TestCases/default_options.cc create mode 100644 test/asan/TestCases/describe_address.cc create mode 100644 test/asan/TestCases/double-free.cc create mode 100644 test/asan/TestCases/error_report_callback.cc create mode 100644 test/asan/TestCases/exitcode.cc create mode 100644 test/asan/TestCases/force_inline_opt0.cc create mode 100644 test/asan/TestCases/frexp_interceptor.cc create mode 100644 test/asan/TestCases/global-address.cpp create mode 100644 test/asan/TestCases/global-demangle.cc create mode 100644 test/asan/TestCases/global-location.cc create mode 100644 test/asan/TestCases/global-overflow.cc create mode 100644 test/asan/TestCases/global-underflow.cc create mode 100644 test/asan/TestCases/halt_on_error-1.c create mode 100644 test/asan/TestCases/heap-overflow-large.cc create mode 100644 test/asan/TestCases/heap-overflow.cc create mode 100644 test/asan/TestCases/heavy_uar_test.cc create mode 100644 test/asan/TestCases/huge_negative_hea_oob.cc create mode 100644 test/asan/TestCases/ill.cc create mode 100644 test/asan/TestCases/init-order-atexit.cc create mode 100644 test/asan/TestCases/initialization-blacklist.cc create mode 100644 test/asan/TestCases/initialization-bug.cc create mode 100644 test/asan/TestCases/initialization-constexpr.cc create mode 100644 test/asan/TestCases/initialization-nobug.cc create mode 100644 test/asan/TestCases/inline.cc create mode 100644 test/asan/TestCases/interception_failure_test.cc create mode 100644 test/asan/TestCases/interface_test.cc create mode 100644 test/asan/TestCases/intra-object-overflow.cc create mode 100644 test/asan/TestCases/invalid-free.cc create mode 100644 test/asan/TestCases/invalid-pointer-pairs-compare-errors.cc create mode 100644 test/asan/TestCases/invalid-pointer-pairs-compare-success.cc create mode 100644 test/asan/TestCases/invalid-pointer-pairs-subtract-errors.cc create mode 100644 test/asan/TestCases/invalid-pointer-pairs-subtract-success.cc create mode 100644 test/asan/TestCases/invalid-pointer-pairs.cc create mode 100644 test/asan/TestCases/large_func_test.cc create mode 100644 test/asan/TestCases/log-path_test.cc create mode 100644 test/asan/TestCases/longjmp.cc create mode 100644 test/asan/TestCases/lsan_annotations.cc create mode 100644 test/asan/TestCases/malloc-no-intercept.c create mode 100644 test/asan/TestCases/malloc_context_size.cc create mode 100644 test/asan/TestCases/malloc_fill.cc create mode 100644 test/asan/TestCases/max_redzone.cc create mode 100644 test/asan/TestCases/memcmp_strict_test.cc create mode 100644 test/asan/TestCases/memcmp_test.cc create mode 100644 test/asan/TestCases/memset_test.cc create mode 100644 test/asan/TestCases/non-executable-pc.cpp create mode 100644 test/asan/TestCases/null_deref.cc create mode 100644 test/asan/TestCases/on_error_callback.cc create mode 100644 test/asan/TestCases/partial_right.cc create mode 100644 test/asan/TestCases/pass-object-byval.cc create mode 100644 test/asan/TestCases/pass-struct-byval-uar.cc create mode 100644 test/asan/TestCases/pass-struct-byval.cc create mode 100644 test/asan/TestCases/poison_partial.cc create mode 100644 test/asan/TestCases/pr33372.cc create mode 100644 test/asan/TestCases/print_summary.cc create mode 100644 test/asan/TestCases/printf-1.c create mode 100644 test/asan/TestCases/printf-2.c create mode 100644 test/asan/TestCases/printf-3.c create mode 100644 test/asan/TestCases/printf-4.c create mode 100644 test/asan/TestCases/printf-5.c create mode 100644 test/asan/TestCases/printf-m.c create mode 100644 test/asan/TestCases/realloc.cc create mode 100644 test/asan/TestCases/sanity_check_pure_c.c create mode 100644 test/asan/TestCases/scariness_score_test.cc create mode 100644 test/asan/TestCases/set_shadow_test.c create mode 100644 test/asan/TestCases/sleep_after_init.c create mode 100644 test/asan/TestCases/sleep_before_dying.c create mode 100644 test/asan/TestCases/small_memcpy_test.cc create mode 100644 test/asan/TestCases/speculative_load.cc create mode 100644 test/asan/TestCases/speculative_load2.cc create mode 100644 test/asan/TestCases/stack-buffer-overflow-with-position.cc create mode 100644 test/asan/TestCases/stack-buffer-overflow.cc create mode 100644 test/asan/TestCases/stack-frame-demangle.cc create mode 100644 test/asan/TestCases/stack-oob-frames.cc create mode 100644 test/asan/TestCases/strcasestr-1.c create mode 100644 test/asan/TestCases/strcasestr-2.c create mode 100644 test/asan/TestCases/strcasestr_strict.c create mode 100644 test/asan/TestCases/strcat_strict.c create mode 100644 test/asan/TestCases/strchr_strict.c create mode 100644 test/asan/TestCases/strcmp_strict.c create mode 100644 test/asan/TestCases/strcspn-1.c create mode 100644 test/asan/TestCases/strcspn-2.c create mode 100644 test/asan/TestCases/strcspn_strict.c create mode 100644 test/asan/TestCases/strdup_oob_test.cc create mode 100644 test/asan/TestCases/strip_path_prefix.c create mode 100644 test/asan/TestCases/strncasecmp_strict.c create mode 100644 test/asan/TestCases/strncat_strict.c create mode 100644 test/asan/TestCases/strncmp_strict.c create mode 100644 test/asan/TestCases/strncpy-overflow.cc create mode 100644 test/asan/TestCases/strpbrk-1.c create mode 100644 test/asan/TestCases/strpbrk-2.c create mode 100644 test/asan/TestCases/strpbrk_strict.c create mode 100644 test/asan/TestCases/strspn-1.c create mode 100644 test/asan/TestCases/strspn-2.c create mode 100644 test/asan/TestCases/strspn_strict.c create mode 100644 test/asan/TestCases/strstr-1.c create mode 100644 test/asan/TestCases/strstr-2.c create mode 100644 test/asan/TestCases/strstr_strict.c create mode 100644 test/asan/TestCases/strtok.c create mode 100644 test/asan/TestCases/strtol_strict.c create mode 100644 test/asan/TestCases/strtoll_strict.c create mode 100644 test/asan/TestCases/suppressions-exec-relative-location.cc create mode 100644 test/asan/TestCases/suppressions-function.cc create mode 100644 test/asan/TestCases/suppressions-interceptor.cc create mode 100644 test/asan/TestCases/suppressions-library.cc create mode 100644 test/asan/TestCases/throw_call_test.cc create mode 100644 test/asan/TestCases/throw_catch.cc create mode 100644 test/asan/TestCases/throw_invoke_test.cc create mode 100644 test/asan/TestCases/time_interceptor.cc create mode 100644 test/asan/TestCases/uar_and_exceptions.cc create mode 100644 test/asan/TestCases/unaligned_loads_and_stores.cc create mode 100644 test/asan/TestCases/use-after-delete.cc create mode 100644 test/asan/TestCases/use-after-free-right.cc create mode 100644 test/asan/TestCases/use-after-free.cc create mode 100644 test/asan/TestCases/use-after-poison.cc create mode 100644 test/asan/TestCases/use-after-scope-capture.cc create mode 100644 test/asan/TestCases/use-after-scope-conversion.cc create mode 100644 test/asan/TestCases/use-after-scope-dtor-order.cc create mode 100644 test/asan/TestCases/use-after-scope-goto.cc create mode 100644 test/asan/TestCases/use-after-scope-if.cc create mode 100644 test/asan/TestCases/use-after-scope-inlined.cc create mode 100644 test/asan/TestCases/use-after-scope-loop-bug.cc create mode 100644 test/asan/TestCases/use-after-scope-loop-removed.cc create mode 100644 test/asan/TestCases/use-after-scope-loop.cc create mode 100644 test/asan/TestCases/use-after-scope-nobug.cc create mode 100644 test/asan/TestCases/use-after-scope-temp.cc create mode 100644 test/asan/TestCases/use-after-scope-temp2.cc create mode 100644 test/asan/TestCases/use-after-scope-types.cc create mode 100644 test/asan/TestCases/use-after-scope.cc create mode 100644 test/asan/TestCases/verbose-log-path_test.cc create mode 100644 test/asan/TestCases/vla_chrome_testcase.cc create mode 100644 test/asan/TestCases/vla_condition_overflow.cc create mode 100644 test/asan/TestCases/vla_loop_overfow.cc create mode 100644 test/asan/TestCases/zero_page_pc.cc create mode 100644 test/asan/Unit/lit.site.cfg.in create mode 100644 test/asan/lit.cfg create mode 100644 test/asan/lit.site.cfg.in create mode 100644 test/builtins/CMakeLists.txt create mode 100644 test/builtins/TestCases/Darwin/lit.local.cfg create mode 100644 test/builtins/TestCases/Darwin/os_version_check_test.c create mode 100644 test/builtins/TestCases/Darwin/os_version_check_test_no_core_foundation.c create mode 100644 test/builtins/Unit/absvdi2_test.c create mode 100644 test/builtins/Unit/absvsi2_test.c create mode 100644 test/builtins/Unit/absvti2_test.c create mode 100644 test/builtins/Unit/adddf3vfp_test.c create mode 100644 test/builtins/Unit/addsf3vfp_test.c create mode 100644 test/builtins/Unit/addtf3_test.c create mode 100644 test/builtins/Unit/addvdi3_test.c create mode 100644 test/builtins/Unit/addvsi3_test.c create mode 100644 test/builtins/Unit/addvti3_test.c create mode 100644 test/builtins/Unit/arm/aeabi_cdcmpeq_test.c create mode 100644 test/builtins/Unit/arm/aeabi_cdcmple_test.c create mode 100644 test/builtins/Unit/arm/aeabi_cfcmpeq_test.c create mode 100644 test/builtins/Unit/arm/aeabi_cfcmple_test.c create mode 100644 test/builtins/Unit/arm/aeabi_drsub_test.c create mode 100644 test/builtins/Unit/arm/aeabi_frsub_test.c create mode 100644 test/builtins/Unit/arm/aeabi_idivmod_test.c create mode 100644 test/builtins/Unit/arm/aeabi_uidivmod_test.c create mode 100644 test/builtins/Unit/arm/aeabi_uldivmod_test.c create mode 100644 test/builtins/Unit/arm/call_apsr.S create mode 100644 test/builtins/Unit/arm/call_apsr.h create mode 100644 test/builtins/Unit/ashldi3_test.c create mode 100644 test/builtins/Unit/ashlti3_test.c create mode 100644 test/builtins/Unit/ashrdi3_test.c create mode 100644 test/builtins/Unit/ashrti3_test.c create mode 100644 test/builtins/Unit/bswapdi2_test.c create mode 100644 test/builtins/Unit/bswapsi2_test.c create mode 100644 test/builtins/Unit/clear_cache_test.c create mode 100644 test/builtins/Unit/clzdi2_test.c create mode 100644 test/builtins/Unit/clzsi2_test.c create mode 100644 test/builtins/Unit/clzti2_test.c create mode 100644 test/builtins/Unit/cmpdi2_test.c create mode 100644 test/builtins/Unit/cmpti2_test.c create mode 100644 test/builtins/Unit/comparedf2_test.c create mode 100644 test/builtins/Unit/comparesf2_test.c create mode 100644 test/builtins/Unit/cpu_model_test.c create mode 100644 test/builtins/Unit/ctzdi2_test.c create mode 100644 test/builtins/Unit/ctzsi2_test.c create mode 100644 test/builtins/Unit/ctzti2_test.c create mode 100644 test/builtins/Unit/divdc3_test.c create mode 100644 test/builtins/Unit/divdf3vfp_test.c create mode 100644 test/builtins/Unit/divdi3_test.c create mode 100644 test/builtins/Unit/divmodsi4_test.c create mode 100644 test/builtins/Unit/divsc3_test.c create mode 100644 test/builtins/Unit/divsf3vfp_test.c create mode 100644 test/builtins/Unit/divsi3_test.c create mode 100644 test/builtins/Unit/divtc3_test.c create mode 100644 test/builtins/Unit/divtf3_test.c create mode 100644 test/builtins/Unit/divti3_test.c create mode 100644 test/builtins/Unit/divxc3_test.c create mode 100644 test/builtins/Unit/enable_execute_stack_test.c create mode 100644 test/builtins/Unit/endianness.h create mode 100644 test/builtins/Unit/eqdf2vfp_test.c create mode 100644 test/builtins/Unit/eqsf2vfp_test.c create mode 100644 test/builtins/Unit/eqtf2_test.c create mode 100644 test/builtins/Unit/extebdsfdf2vfp_test.c create mode 100644 test/builtins/Unit/extenddftf2_test.c create mode 100644 test/builtins/Unit/extendhfsf2_test.c create mode 100644 test/builtins/Unit/extendsftf2_test.c create mode 100644 test/builtins/Unit/ffsdi2_test.c create mode 100644 test/builtins/Unit/ffssi2_test.c create mode 100644 test/builtins/Unit/ffsti2_test.c create mode 100644 test/builtins/Unit/fixdfdi_test.c create mode 100644 test/builtins/Unit/fixdfsivfp_test.c create mode 100644 test/builtins/Unit/fixdfti_test.c create mode 100644 test/builtins/Unit/fixsfdi_test.c create mode 100644 test/builtins/Unit/fixsfsivfp_test.c create mode 100644 test/builtins/Unit/fixsfti_test.c create mode 100644 test/builtins/Unit/fixtfdi_test.c create mode 100644 test/builtins/Unit/fixtfsi_test.c create mode 100644 test/builtins/Unit/fixtfti_test.c create mode 100644 test/builtins/Unit/fixunsdfdi_test.c create mode 100644 test/builtins/Unit/fixunsdfsi_test.c create mode 100644 test/builtins/Unit/fixunsdfsivfp_test.c create mode 100644 test/builtins/Unit/fixunsdfti_test.c create mode 100644 test/builtins/Unit/fixunssfdi_test.c create mode 100644 test/builtins/Unit/fixunssfsi_test.c create mode 100644 test/builtins/Unit/fixunssfsivfp_test.c create mode 100644 test/builtins/Unit/fixunssfti_test.c create mode 100644 test/builtins/Unit/fixunstfdi_test.c create mode 100644 test/builtins/Unit/fixunstfsi_test.c create mode 100644 test/builtins/Unit/fixunstfti_test.c create mode 100644 test/builtins/Unit/fixunsxfdi_test.c create mode 100644 test/builtins/Unit/fixunsxfsi_test.c create mode 100644 test/builtins/Unit/fixunsxfti_test.c create mode 100644 test/builtins/Unit/fixxfdi_test.c create mode 100644 test/builtins/Unit/fixxfti_test.c create mode 100644 test/builtins/Unit/floatdidf_test.c create mode 100644 test/builtins/Unit/floatdisf_test.c create mode 100644 test/builtins/Unit/floatditf_test.c create mode 100644 test/builtins/Unit/floatdixf_test.c create mode 100644 test/builtins/Unit/floatsidfvfp_test.c create mode 100644 test/builtins/Unit/floatsisfvfp_test.c create mode 100644 test/builtins/Unit/floatsitf_test.c create mode 100644 test/builtins/Unit/floattidf_test.c create mode 100644 test/builtins/Unit/floattisf_test.c create mode 100644 test/builtins/Unit/floattitf_test.c create mode 100644 test/builtins/Unit/floattixf_test.c create mode 100644 test/builtins/Unit/floatundidf_test.c create mode 100644 test/builtins/Unit/floatundisf_test.c create mode 100644 test/builtins/Unit/floatunditf_test.c create mode 100644 test/builtins/Unit/floatundixf_test.c create mode 100644 test/builtins/Unit/floatunsitf_test.c create mode 100644 test/builtins/Unit/floatunssidfvfp_test.c create mode 100644 test/builtins/Unit/floatunssisfvfp_test.c create mode 100644 test/builtins/Unit/floatuntidf_test.c create mode 100644 test/builtins/Unit/floatuntisf_test.c create mode 100644 test/builtins/Unit/floatuntitf_test.c create mode 100644 test/builtins/Unit/floatuntixf_test.c create mode 100644 test/builtins/Unit/fp_test.h create mode 100644 test/builtins/Unit/gcc_personality_test.c create mode 100644 test/builtins/Unit/gcc_personality_test_helper.cxx create mode 100644 test/builtins/Unit/gedf2vfp_test.c create mode 100644 test/builtins/Unit/gesf2vfp_test.c create mode 100644 test/builtins/Unit/getf2_test.c create mode 100644 test/builtins/Unit/gtdf2vfp_test.c create mode 100644 test/builtins/Unit/gtsf2vfp_test.c create mode 100644 test/builtins/Unit/gttf2_test.c create mode 100644 test/builtins/Unit/ledf2vfp_test.c create mode 100644 test/builtins/Unit/lesf2vfp_test.c create mode 100644 test/builtins/Unit/letf2_test.c create mode 100644 test/builtins/Unit/lit.cfg create mode 100644 test/builtins/Unit/lit.site.cfg.in create mode 100644 test/builtins/Unit/lshrdi3_test.c create mode 100644 test/builtins/Unit/lshrti3_test.c create mode 100644 test/builtins/Unit/ltdf2vfp_test.c create mode 100644 test/builtins/Unit/ltsf2vfp_test.c create mode 100644 test/builtins/Unit/lttf2_test.c create mode 100644 test/builtins/Unit/moddi3_test.c create mode 100644 test/builtins/Unit/modsi3_test.c create mode 100644 test/builtins/Unit/modti3_test.c create mode 100644 test/builtins/Unit/muldc3_test.c create mode 100644 test/builtins/Unit/muldf3vfp_test.c create mode 100644 test/builtins/Unit/muldi3_test.c create mode 100644 test/builtins/Unit/mulodi4_test.c create mode 100644 test/builtins/Unit/mulosi4_test.c create mode 100644 test/builtins/Unit/muloti4_test.c create mode 100644 test/builtins/Unit/mulsc3_test.c create mode 100644 test/builtins/Unit/mulsf3vfp_test.c create mode 100644 test/builtins/Unit/multc3_test.c create mode 100644 test/builtins/Unit/multf3_test.c create mode 100644 test/builtins/Unit/multi3_test.c create mode 100644 test/builtins/Unit/mulvdi3_test.c create mode 100644 test/builtins/Unit/mulvsi3_test.c create mode 100644 test/builtins/Unit/mulvti3_test.c create mode 100644 test/builtins/Unit/mulxc3_test.c create mode 100644 test/builtins/Unit/nedf2vfp_test.c create mode 100644 test/builtins/Unit/negdf2vfp_test.c create mode 100644 test/builtins/Unit/negdi2_test.c create mode 100644 test/builtins/Unit/negsf2vfp_test.c create mode 100644 test/builtins/Unit/negti2_test.c create mode 100644 test/builtins/Unit/negvdi2_test.c create mode 100644 test/builtins/Unit/negvsi2_test.c create mode 100644 test/builtins/Unit/negvti2_test.c create mode 100644 test/builtins/Unit/nesf2vfp_test.c create mode 100644 test/builtins/Unit/netf2_test.c create mode 100644 test/builtins/Unit/paritydi2_test.c create mode 100644 test/builtins/Unit/paritysi2_test.c create mode 100644 test/builtins/Unit/parityti2_test.c create mode 100644 test/builtins/Unit/popcountdi2_test.c create mode 100644 test/builtins/Unit/popcountsi2_test.c create mode 100644 test/builtins/Unit/popcountti2_test.c create mode 100644 test/builtins/Unit/powidf2_test.c create mode 100644 test/builtins/Unit/powisf2_test.c create mode 100644 test/builtins/Unit/powitf2_test.c create mode 100644 test/builtins/Unit/powixf2_test.c create mode 100644 test/builtins/Unit/ppc/DD.h create mode 100644 test/builtins/Unit/ppc/fixtfdi_test.c create mode 100644 test/builtins/Unit/ppc/floatditf_test.c create mode 100644 test/builtins/Unit/ppc/floatditf_test.h create mode 100644 test/builtins/Unit/ppc/floatunditf_test.c create mode 100644 test/builtins/Unit/ppc/floatunditf_test.h create mode 100644 test/builtins/Unit/ppc/qadd_test.c create mode 100644 test/builtins/Unit/ppc/qdiv_test.c create mode 100644 test/builtins/Unit/ppc/qmul_test.c create mode 100644 test/builtins/Unit/ppc/qsub_test.c create mode 100755 test/builtins/Unit/ppc/test create mode 100644 test/builtins/Unit/subdf3vfp_test.c create mode 100644 test/builtins/Unit/subsf3vfp_test.c create mode 100644 test/builtins/Unit/subtf3_test.c create mode 100644 test/builtins/Unit/subvdi3_test.c create mode 100644 test/builtins/Unit/subvsi3_test.c create mode 100644 test/builtins/Unit/subvti3_test.c create mode 100755 test/builtins/Unit/test create mode 100644 test/builtins/Unit/trampoline_setup_test.c create mode 100644 test/builtins/Unit/truncdfhf2_test.c create mode 100644 test/builtins/Unit/truncdfsf2_test.c create mode 100644 test/builtins/Unit/truncdfsf2vfp_test.c create mode 100644 test/builtins/Unit/truncsfhf2_test.c create mode 100644 test/builtins/Unit/trunctfdf2_test.c create mode 100644 test/builtins/Unit/trunctfsf2_test.c create mode 100644 test/builtins/Unit/ucmpdi2_test.c create mode 100644 test/builtins/Unit/ucmpti2_test.c create mode 100644 test/builtins/Unit/udivdi3_test.c create mode 100644 test/builtins/Unit/udivmoddi4_test.c create mode 100644 test/builtins/Unit/udivmodsi4_test.c create mode 100644 test/builtins/Unit/udivmodti4_test.c create mode 100644 test/builtins/Unit/udivsi3_test.c create mode 100644 test/builtins/Unit/udivti3_test.c create mode 100644 test/builtins/Unit/umoddi3_test.c create mode 100644 test/builtins/Unit/umodsi3_test.c create mode 100644 test/builtins/Unit/umodti3_test.c create mode 100644 test/builtins/Unit/unorddf2vfp_test.c create mode 100644 test/builtins/Unit/unordsf2vfp_test.c create mode 100644 test/builtins/Unit/unordtf2_test.c create mode 100644 test/builtins/lit.cfg create mode 100644 test/builtins/lit.site.cfg.in create mode 100644 test/builtins/timing/ashldi3.c create mode 100644 test/builtins/timing/ashrdi3.c create mode 100644 test/builtins/timing/divdi3.c create mode 100644 test/builtins/timing/floatdidf.c create mode 100644 test/builtins/timing/floatdisf.c create mode 100644 test/builtins/timing/floatdixf.c create mode 100644 test/builtins/timing/floatundidf.c create mode 100644 test/builtins/timing/floatundisf.c create mode 100644 test/builtins/timing/floatundixf.c create mode 100644 test/builtins/timing/lshrdi3.c create mode 100644 test/builtins/timing/moddi3.c create mode 100644 test/builtins/timing/modsi3.c create mode 100644 test/builtins/timing/muldi3.c create mode 100644 test/builtins/timing/negdi2.c create mode 100755 test/builtins/timing/time create mode 100644 test/builtins/timing/timing.h create mode 100644 test/builtins/timing/udivdi3.c create mode 100644 test/builtins/timing/umoddi3.c create mode 100644 test/cfi/CMakeLists.txt create mode 100644 test/cfi/README.txt create mode 100644 test/cfi/anon-namespace.cpp create mode 100644 test/cfi/bad-cast.cpp create mode 100644 test/cfi/bad-split.cpp create mode 100644 test/cfi/base-derived-destructor.cpp create mode 100644 test/cfi/create-derivers.test create mode 100644 test/cfi/cross-dso/icall/diag.cpp create mode 100644 test/cfi/cross-dso/icall/dlopen.cpp create mode 100644 test/cfi/cross-dso/icall/icall-from-dso.cpp create mode 100644 test/cfi/cross-dso/icall/icall.cpp create mode 100644 test/cfi/cross-dso/icall/lit.local.cfg create mode 100644 test/cfi/cross-dso/lit.local.cfg create mode 100644 test/cfi/cross-dso/shadow_is_read_only.cpp create mode 100644 test/cfi/cross-dso/simple-fail.cpp create mode 100644 test/cfi/cross-dso/simple-pass.cpp create mode 100644 test/cfi/cross-dso/stats.cpp create mode 100644 test/cfi/cross-dso/target_out_of_bounds.cpp create mode 100644 test/cfi/cross-dso/util/cfi_stubs.h create mode 100644 test/cfi/icall/bad-signature.c create mode 100644 test/cfi/icall/external-call.c create mode 100644 test/cfi/icall/lit.local.cfg create mode 100644 test/cfi/icall/weak.c create mode 100644 test/cfi/icall/wrong-signature-mixed-lto.c create mode 100644 test/cfi/lit.cfg create mode 100644 test/cfi/lit.site.cfg.in create mode 100644 test/cfi/multiple-inheritance.cpp create mode 100644 test/cfi/nvcall.cpp create mode 100644 test/cfi/overwrite.cpp create mode 100644 test/cfi/sibling.cpp create mode 100644 test/cfi/simple-fail.cpp create mode 100644 test/cfi/simple-pass.cpp create mode 100644 test/cfi/stats.cpp create mode 100644 test/cfi/target_uninstrumented.cpp create mode 100644 test/cfi/two-vcalls.cpp create mode 100644 test/cfi/utils.h create mode 100644 test/cfi/vdtor.cpp create mode 100644 test/cfi/vtable-may-alias.cpp create mode 100644 test/dfsan/CMakeLists.txt create mode 100644 test/dfsan/Inputs/flags_abilist.txt create mode 100644 test/dfsan/basic.c create mode 100644 test/dfsan/custom.cc create mode 100644 test/dfsan/dump_labels.c create mode 100644 test/dfsan/flags.c create mode 100644 test/dfsan/fncall.c create mode 100644 test/dfsan/label_count.c create mode 100644 test/dfsan/lit.cfg create mode 100644 test/dfsan/lit.site.cfg.in create mode 100644 test/dfsan/propagate.c create mode 100644 test/dfsan/vararg.c create mode 100644 test/dfsan/write_callback.c create mode 100644 test/esan/CMakeLists.txt create mode 100644 test/esan/TestCases/large-stack-linux.c create mode 100644 test/esan/TestCases/libc-intercept.c create mode 100644 test/esan/TestCases/mmap-shadow-conflict.c create mode 100644 test/esan/TestCases/struct-simple.cpp create mode 100644 test/esan/TestCases/verbose-simple.c create mode 100644 test/esan/TestCases/workingset-early-fault.c create mode 100644 test/esan/TestCases/workingset-memset.cpp create mode 100644 test/esan/TestCases/workingset-midreport.cpp create mode 100644 test/esan/TestCases/workingset-samples.cpp create mode 100644 test/esan/TestCases/workingset-signal-posix.cpp create mode 100644 test/esan/TestCases/workingset-simple.cpp create mode 100644 test/esan/Unit/circular_buffer.cpp create mode 100644 test/esan/Unit/hashtable.cpp create mode 100644 test/esan/lit.cfg create mode 100644 test/esan/lit.site.cfg.in create mode 100644 test/fuzzer/AFLDriverTest.cpp create mode 100644 test/fuzzer/AbsNegAndConstant64Test.cpp create mode 100644 test/fuzzer/AbsNegAndConstantTest.cpp create mode 100644 test/fuzzer/AccumulateAllocationsTest.cpp create mode 100644 test/fuzzer/BadStrcmpTest.cpp create mode 100644 test/fuzzer/BogusInitializeTest.cpp create mode 100644 test/fuzzer/BufferOverflowOnInput.cpp create mode 100644 test/fuzzer/CMakeLists.txt create mode 100644 test/fuzzer/CallerCalleeTest.cpp create mode 100644 test/fuzzer/CleanseTest.cpp create mode 100644 test/fuzzer/CounterTest.cpp create mode 100644 test/fuzzer/CustomCrossOverAndMutateTest.cpp create mode 100644 test/fuzzer/CustomCrossOverTest.cpp create mode 100644 test/fuzzer/CustomMutatorTest.cpp create mode 100644 test/fuzzer/CxxStringEqTest.cpp create mode 100644 test/fuzzer/DSO1.cpp create mode 100644 test/fuzzer/DSO2.cpp create mode 100644 test/fuzzer/DSOTestExtra.cpp create mode 100644 test/fuzzer/DSOTestMain.cpp create mode 100644 test/fuzzer/DeepRecursionTest.cpp create mode 100644 test/fuzzer/DivTest.cpp create mode 100644 test/fuzzer/EmptyTest.cpp create mode 100644 test/fuzzer/EquivalenceATest.cpp create mode 100644 test/fuzzer/EquivalenceBTest.cpp create mode 100644 test/fuzzer/FlagsTest.cpp create mode 100644 test/fuzzer/FourIndependentBranchesTest.cpp create mode 100644 test/fuzzer/FullCoverageSetTest.cpp create mode 100644 test/fuzzer/GcSectionsTest.cpp create mode 100644 test/fuzzer/InitializeTest.cpp create mode 100644 test/fuzzer/LargeTest.cpp create mode 100644 test/fuzzer/LeakTest.cpp create mode 100644 test/fuzzer/LeakTimeoutTest.cpp create mode 100644 test/fuzzer/LoadTest.cpp create mode 100644 test/fuzzer/Memcmp64BytesTest.cpp create mode 100644 test/fuzzer/MemcmpTest.cpp create mode 100644 test/fuzzer/NotinstrumentedTest.cpp create mode 100644 test/fuzzer/NthRunCrashTest.cpp create mode 100644 test/fuzzer/NullDerefOnEmptyTest.cpp create mode 100644 test/fuzzer/NullDerefTest.cpp create mode 100644 test/fuzzer/OneHugeAllocTest.cpp create mode 100644 test/fuzzer/OutOfMemorySingleLargeMallocTest.cpp create mode 100644 test/fuzzer/OutOfMemoryTest.cpp create mode 100644 test/fuzzer/OverwriteInputTest.cpp create mode 100644 test/fuzzer/PrintFuncTest.cpp create mode 100644 test/fuzzer/RepeatedBytesTest.cpp create mode 100644 test/fuzzer/RepeatedMemcmp.cpp create mode 100644 test/fuzzer/ShrinkControlFlowSimpleTest.cpp create mode 100644 test/fuzzer/ShrinkControlFlowTest.cpp create mode 100644 test/fuzzer/ShrinkValueProfileTest.cpp create mode 100644 test/fuzzer/SignedIntOverflowTest.cpp create mode 100644 test/fuzzer/SimpleCmpTest.cpp create mode 100644 test/fuzzer/SimpleDictionaryTest.cpp create mode 100644 test/fuzzer/SimpleHashTest.cpp create mode 100644 test/fuzzer/SimpleTest.cpp create mode 100644 test/fuzzer/SimpleThreadedTest.cpp create mode 100644 test/fuzzer/SingleByteInputTest.cpp create mode 100644 test/fuzzer/SingleMemcmpTest.cpp create mode 100644 test/fuzzer/SingleStrcmpTest.cpp create mode 100644 test/fuzzer/SingleStrncmpTest.cpp create mode 100644 test/fuzzer/SleepOneSecondTest.cpp create mode 100644 test/fuzzer/SpamyTest.cpp create mode 100644 test/fuzzer/StrcmpTest.cpp create mode 100644 test/fuzzer/StrncmpOOBTest.cpp create mode 100644 test/fuzzer/StrncmpTest.cpp create mode 100644 test/fuzzer/StrstrTest.cpp create mode 100644 test/fuzzer/SwapCmpTest.cpp create mode 100644 test/fuzzer/Switch2Test.cpp create mode 100644 test/fuzzer/SwitchTest.cpp create mode 100644 test/fuzzer/TableLookupTest.cpp create mode 100644 test/fuzzer/ThreadedLeakTest.cpp create mode 100644 test/fuzzer/ThreadedTest.cpp create mode 100644 test/fuzzer/TimeoutEmptyTest.cpp create mode 100644 test/fuzzer/TimeoutTest.cpp create mode 100644 test/fuzzer/TraceMallocTest.cpp create mode 100644 test/fuzzer/TraceMallocThreadedTest.cpp create mode 100644 test/fuzzer/TwoDifferentBugsTest.cpp create mode 100644 test/fuzzer/afl-driver-extra-stats.test create mode 100644 test/fuzzer/afl-driver-stderr.test create mode 100644 test/fuzzer/afl-driver.test create mode 100644 test/fuzzer/bad-strcmp.test create mode 100644 test/fuzzer/caller-callee.test create mode 100644 test/fuzzer/cleanse.test create mode 100644 test/fuzzer/coverage.test create mode 100644 test/fuzzer/cxxstring.test create mode 100644 test/fuzzer/deep-recursion.test create mode 100644 test/fuzzer/dict1.txt create mode 100644 test/fuzzer/disable-leaks.test create mode 100644 test/fuzzer/dump_coverage.test create mode 100644 test/fuzzer/equivalence-signals.test create mode 100644 test/fuzzer/equivalence.test create mode 100644 test/fuzzer/exit-report.test create mode 100644 test/fuzzer/exit_on_src_pos.test create mode 100644 test/fuzzer/extra-counters.test create mode 100644 test/fuzzer/fprofile-instr-generate.test create mode 100644 test/fuzzer/fuzzer-customcrossover.test create mode 100644 test/fuzzer/fuzzer-customcrossoverandmutate.test create mode 100644 test/fuzzer/fuzzer-custommutator.test create mode 100644 test/fuzzer/fuzzer-dict.test create mode 100644 test/fuzzer/fuzzer-dirs.test create mode 100644 test/fuzzer/fuzzer-fdmask.test create mode 100644 test/fuzzer/fuzzer-finalstats.test create mode 100644 test/fuzzer/fuzzer-flags.test create mode 100644 test/fuzzer/fuzzer-leak.test create mode 100644 test/fuzzer/fuzzer-oom-with-profile.test create mode 100644 test/fuzzer/fuzzer-oom.test create mode 100644 test/fuzzer/fuzzer-printcovpcs.test create mode 100644 test/fuzzer/fuzzer-runs.test create mode 100644 test/fuzzer/fuzzer-seed.test create mode 100644 test/fuzzer/fuzzer-segv.test create mode 100644 test/fuzzer/fuzzer-singleinputs.test create mode 100644 test/fuzzer/fuzzer-threaded.test create mode 100644 test/fuzzer/fuzzer-timeout.test create mode 100644 test/fuzzer/fuzzer-ubsan.test create mode 100644 test/fuzzer/fuzzer.test create mode 100644 test/fuzzer/gc-sections.test create mode 100644 test/fuzzer/hi.txt create mode 100644 test/fuzzer/inline-8bit-counters.test create mode 100644 test/fuzzer/lit.cfg create mode 100644 test/fuzzer/lit.site.cfg.in create mode 100644 test/fuzzer/max-number-of-runs.test create mode 100644 test/fuzzer/memcmp.test create mode 100644 test/fuzzer/memcmp64.test create mode 100644 test/fuzzer/merge-control-file.test create mode 100644 test/fuzzer/merge-posix.test create mode 100644 test/fuzzer/merge-sigusr.test create mode 100644 test/fuzzer/merge-summary.test create mode 100644 test/fuzzer/merge.test create mode 100644 test/fuzzer/minimize_crash.test create mode 100644 test/fuzzer/minimize_two_crashes.test create mode 100644 test/fuzzer/overwrite-input.test create mode 100644 test/fuzzer/print-func.test create mode 100644 test/fuzzer/recommended-dictionary.test create mode 100644 test/fuzzer/reduce_inputs.test create mode 100644 test/fuzzer/repeated-bytes.test create mode 100644 test/fuzzer/shrink.test create mode 100644 test/fuzzer/sigusr.test create mode 100644 test/fuzzer/simple-cmp.test create mode 100644 test/fuzzer/standalone.test create mode 100644 test/fuzzer/strcmp.test create mode 100644 test/fuzzer/strncmp.test create mode 100644 test/fuzzer/strstr.test create mode 100644 test/fuzzer/swap-cmp.test create mode 100644 test/fuzzer/trace-malloc-2.test create mode 100644 test/fuzzer/trace-malloc-threaded.test create mode 100644 test/fuzzer/trace-malloc-unbalanced.test create mode 100644 test/fuzzer/trace-malloc.test create mode 100644 test/fuzzer/trace-pc.test create mode 100644 test/fuzzer/ulimit.test create mode 100644 test/fuzzer/unit/lit.site.cfg.in create mode 100644 test/fuzzer/value-profile-cmp.test create mode 100644 test/fuzzer/value-profile-cmp2.test create mode 100644 test/fuzzer/value-profile-cmp3.test create mode 100644 test/fuzzer/value-profile-cmp4.test create mode 100644 test/fuzzer/value-profile-div.test create mode 100644 test/fuzzer/value-profile-load.test create mode 100644 test/fuzzer/value-profile-mem.test create mode 100644 test/fuzzer/value-profile-set.test create mode 100644 test/fuzzer/value-profile-strcmp.test create mode 100644 test/fuzzer/value-profile-strncmp.test create mode 100644 test/fuzzer/value-profile-switch.test create mode 100644 test/hwasan/CMakeLists.txt create mode 100644 test/hwasan/TestCases/halt-on-error.cc create mode 100644 test/hwasan/TestCases/use-after-free.cc create mode 100644 test/hwasan/lit.cfg create mode 100644 test/hwasan/lit.site.cfg.in create mode 100644 test/interception/CMakeLists.txt create mode 100644 test/interception/Unit/lit.site.cfg.in create mode 100644 test/lit.common.cfg create mode 100644 test/lit.common.configured.in create mode 100644 test/lsan/CMakeLists.txt create mode 100644 test/lsan/TestCases/Darwin/dispatch.mm create mode 100644 test/lsan/TestCases/Darwin/lit.local.cfg create mode 100644 test/lsan/TestCases/Linux/cleanup_in_tsd_destructor.c create mode 100644 test/lsan/TestCases/Linux/disabler_in_tsd_destructor.c create mode 100644 test/lsan/TestCases/Linux/fork.cc create mode 100644 test/lsan/TestCases/Linux/fork_threaded.cc create mode 100644 test/lsan/TestCases/Linux/guard-page.c create mode 100644 test/lsan/TestCases/Linux/lit.local.cfg create mode 100644 test/lsan/TestCases/Linux/use_tls_dynamic.cc create mode 100644 test/lsan/TestCases/Linux/use_tls_pthread_specific_dynamic.cc create mode 100644 test/lsan/TestCases/Linux/use_tls_pthread_specific_static.cc create mode 100644 test/lsan/TestCases/Linux/use_tls_static.cc create mode 100644 test/lsan/TestCases/allocator_returns_null.cc create mode 100644 test/lsan/TestCases/default_options.cc create mode 100644 test/lsan/TestCases/disabler.c create mode 100644 test/lsan/TestCases/disabler.cc create mode 100644 test/lsan/TestCases/do_leak_check_override.cc create mode 100644 test/lsan/TestCases/high_allocator_contention.cc create mode 100644 test/lsan/TestCases/ignore_object.c create mode 100644 test/lsan/TestCases/ignore_object_errors.cc create mode 100644 test/lsan/TestCases/large_allocation_leak.cc create mode 100644 test/lsan/TestCases/leak_check_at_exit.cc create mode 100644 test/lsan/TestCases/leak_check_before_thread_started.cc create mode 100644 test/lsan/TestCases/link_turned_off.cc create mode 100644 test/lsan/TestCases/many_tls_keys.cc create mode 100644 test/lsan/TestCases/new_array_with_dtor_0.cc create mode 100644 test/lsan/TestCases/pointer_to_self.cc create mode 100644 test/lsan/TestCases/print_suppressions.cc create mode 100644 test/lsan/TestCases/recoverable_leak_check.cc create mode 100644 test/lsan/TestCases/register_root_region.cc create mode 100644 test/lsan/TestCases/sanity_check_pure_c.c create mode 100644 test/lsan/TestCases/stale_stack_leak.cc create mode 100644 test/lsan/TestCases/strace_test.cc create mode 100644 test/lsan/TestCases/suppressions_default.cc create mode 100644 test/lsan/TestCases/suppressions_file.cc create mode 100644 test/lsan/TestCases/swapcontext.cc create mode 100644 test/lsan/TestCases/use_after_return.cc create mode 100644 test/lsan/TestCases/use_globals_initialized.cc create mode 100644 test/lsan/TestCases/use_globals_uninitialized.cc create mode 100644 test/lsan/TestCases/use_poisoned_asan.cc create mode 100644 test/lsan/TestCases/use_registers.cc create mode 100644 test/lsan/TestCases/use_stacks.cc create mode 100644 test/lsan/TestCases/use_stacks_threaded.cc create mode 100644 test/lsan/TestCases/use_unaligned.cc create mode 100644 test/lsan/lit.common.cfg create mode 100644 test/lsan/lit.site.cfg.in create mode 100644 test/msan/CMakeLists.txt create mode 100644 test/msan/Linux/cmsghdr.cc create mode 100644 test/msan/Linux/eventfd.cc create mode 100644 test/msan/Linux/fopencookie.cc create mode 100644 test/msan/Linux/forkpty.cc create mode 100644 test/msan/Linux/getresid.cc create mode 100644 test/msan/Linux/glob.cc create mode 100644 test/msan/Linux/glob_altdirfunc.cc create mode 100644 test/msan/Linux/glob_nomatch.cc create mode 100644 test/msan/Linux/glob_test_root/aa create mode 100644 test/msan/Linux/glob_test_root/ab create mode 100644 test/msan/Linux/glob_test_root/ba create mode 100644 test/msan/Linux/ioctl_sound.cc create mode 100644 test/msan/Linux/lit.local.cfg create mode 100644 test/msan/Linux/mallinfo.cc create mode 100644 test/msan/Linux/mincore.cc create mode 100644 test/msan/Linux/obstack.cc create mode 100644 test/msan/Linux/poll.cc create mode 100644 test/msan/Linux/process_vm_readv.cc create mode 100644 test/msan/Linux/sendmsg.cc create mode 100644 test/msan/Linux/strerror_r.cc create mode 100644 test/msan/Linux/sunrpc.cc create mode 100644 test/msan/Linux/sunrpc_bytes.cc create mode 100644 test/msan/Linux/sunrpc_string.cc create mode 100644 test/msan/Linux/syscalls.cc create mode 100644 test/msan/Linux/syscalls_sigaction.cc create mode 100644 test/msan/Linux/tcgetattr.cc create mode 100644 test/msan/Linux/xattr.cc create mode 100644 test/msan/Linux/xattr_test_root/a create mode 100644 test/msan/Unit/lit.site.cfg.in create mode 100644 test/msan/__strxfrm_l.cc create mode 100644 test/msan/alloca.cc create mode 100644 test/msan/allocator_mapping.cc create mode 100644 test/msan/allocator_returns_null.cc create mode 100644 test/msan/backtrace.cc create mode 100644 test/msan/c-strdup.c create mode 100644 test/msan/chained_origin.cc create mode 100644 test/msan/chained_origin_empty_stack.cc create mode 100644 test/msan/chained_origin_limits.cc create mode 100644 test/msan/chained_origin_memcpy.cc create mode 100644 test/msan/chained_origin_with_signals.cc create mode 100644 test/msan/check_mem_is_initialized.cc create mode 100644 test/msan/coverage-levels.cc create mode 100644 test/msan/ctermid.cc create mode 100644 test/msan/cxa_atexit.cc create mode 100644 test/msan/death-callback.cc create mode 100644 test/msan/default_blacklist.cc create mode 100644 test/msan/dlerror.cc create mode 100644 test/msan/dlopen_executable.cc create mode 100644 test/msan/dso-origin.cc create mode 100644 test/msan/dtls_test.c create mode 100644 test/msan/dtor-base-access.cc create mode 100644 test/msan/dtor-bit-fields.cc create mode 100644 test/msan/dtor-derived-class.cc create mode 100644 test/msan/dtor-member.cc create mode 100644 test/msan/dtor-multiple-inheritance-nontrivial-class-members.cc create mode 100644 test/msan/dtor-multiple-inheritance.cc create mode 100644 test/msan/dtor-trivial-class-members.cc create mode 100644 test/msan/dtor-trivial.cpp create mode 100644 test/msan/dtor-vtable-multiple-inheritance.cc create mode 100644 test/msan/dtor-vtable.cc create mode 100644 test/msan/errno.cc create mode 100644 test/msan/fork.cc create mode 100644 test/msan/fread_fwrite.cc create mode 100644 test/msan/ftime.cc create mode 100644 test/msan/getaddrinfo-positive.cc create mode 100644 test/msan/getaddrinfo.cc create mode 100644 test/msan/getc_unlocked.c create mode 100644 test/msan/getline.cc create mode 100644 test/msan/getloadavg.cc create mode 100644 test/msan/getutent.cc create mode 100644 test/msan/heap-origin.cc create mode 100644 test/msan/icmp_slt_allones.cc create mode 100644 test/msan/iconv.cc create mode 100644 test/msan/if_indextoname.cc create mode 100644 test/msan/ifaddrs.cc create mode 100644 test/msan/initgroups.cc create mode 100644 test/msan/inline.cc create mode 100644 test/msan/insertvalue_origin.cc create mode 100644 test/msan/ioctl.cc create mode 100644 test/msan/ioctl_custom.cc create mode 100644 test/msan/lit.cfg create mode 100644 test/msan/lit.site.cfg.in create mode 100644 test/msan/memcmp_test.cc create mode 100644 test/msan/mktime.cc create mode 100644 test/msan/mmap.cc create mode 100644 test/msan/mmap_below_shadow.cc create mode 100644 test/msan/msan_check_mem_is_initialized.cc create mode 100644 test/msan/msan_copy_shadow.cc create mode 100644 test/msan/msan_dump_shadow.cc create mode 100644 test/msan/msan_print_shadow.cc create mode 100644 test/msan/msan_print_shadow2.cc create mode 100644 test/msan/msan_print_shadow3.cc create mode 100644 test/msan/mul_by_const.cc create mode 100644 test/msan/no_sanitize_memory.cc create mode 100644 test/msan/no_sanitize_memory_prop.cc create mode 100644 test/msan/origin-store-long.cc create mode 100644 test/msan/param_tls_limit.cc create mode 100644 test/msan/poison_in_free.cc create mode 100644 test/msan/pr32842.c create mode 100644 test/msan/print_stats.cc create mode 100644 test/msan/pthread_getattr_np_deadlock.cc create mode 100644 test/msan/pthread_getname_np.cc create mode 100644 test/msan/pthread_setcancelstate.cc create mode 100644 test/msan/pvalloc.cc create mode 100644 test/msan/rand_r.cc create mode 100644 test/msan/readdir64.cc create mode 100644 test/msan/realloc-large-origin.cc create mode 100644 test/msan/realloc-origin.cc create mode 100644 test/msan/recover-dso.cc create mode 100644 test/msan/recover.cc create mode 100644 test/msan/report-demangling.cc create mode 100644 test/msan/scandir.cc create mode 100644 test/msan/scandir_null.cc create mode 100644 test/msan/scandir_test_root/aaa create mode 100644 test/msan/scandir_test_root/aab create mode 100644 test/msan/scandir_test_root/bbb create mode 100644 test/msan/select.cc create mode 100644 test/msan/select_float_origin.cc create mode 100644 test/msan/select_origin.cc create mode 100644 test/msan/sem_getvalue.cc create mode 100644 test/msan/setlocale.cc create mode 100644 test/msan/sigaction.cc create mode 100644 test/msan/signal_stress_test.cc create mode 100644 test/msan/sigwait.cc create mode 100644 test/msan/sigwaitinfo.cc create mode 100644 test/msan/stack-origin.cc create mode 100644 test/msan/stack-origin2.cc create mode 100644 test/msan/strerror_r-non-gnu.c create mode 100644 test/msan/strlen_of_shadow.cc create mode 100644 test/msan/strndup.cc create mode 100644 test/msan/strxfrm.cc create mode 100644 test/msan/sync_lock_set_and_test.cc create mode 100644 test/msan/test.h create mode 100644 test/msan/textdomain.cc create mode 100644 test/msan/times.cc create mode 100644 test/msan/tls_reuse.cc create mode 100644 test/msan/tsearch.cc create mode 100644 test/msan/tzset.cc create mode 100644 test/msan/unaligned_read_origin.cc create mode 100644 test/msan/unpoison_string.cc create mode 100644 test/msan/use-after-dtor.cc create mode 100644 test/msan/use-after-free.cc create mode 100644 test/msan/vector_cvt.cc create mode 100644 test/msan/vector_select.cc create mode 100644 test/msan/wcsncpy.cc create mode 100644 test/profile/CMakeLists.txt create mode 100644 test/profile/Inputs/comdat_rename.h create mode 100644 test/profile/Inputs/comdat_rename_1.cc create mode 100644 test/profile/Inputs/comdat_rename_2.cc create mode 100644 test/profile/Inputs/extern_template.cpp create mode 100644 test/profile/Inputs/extern_template.h create mode 100644 test/profile/Inputs/extern_template1.cpp create mode 100644 test/profile/Inputs/extern_template2.cpp create mode 100644 test/profile/Inputs/gcc-flag-compatibility.c create mode 100644 test/profile/Inputs/instrprof-alloc.c create mode 100644 test/profile/Inputs/instrprof-comdat-1.cpp create mode 100644 test/profile/Inputs/instrprof-comdat-2.cpp create mode 100644 test/profile/Inputs/instrprof-comdat.h create mode 100644 test/profile/Inputs/instrprof-dlopen-dlclose-main.c create mode 100644 test/profile/Inputs/instrprof-dlopen-func.c create mode 100644 test/profile/Inputs/instrprof-dlopen-func2.c create mode 100644 test/profile/Inputs/instrprof-dlopen-main.c create mode 100644 test/profile/Inputs/instrprof-dynamic-a.cpp create mode 100644 test/profile/Inputs/instrprof-dynamic-b.cpp create mode 100644 test/profile/Inputs/instrprof-dynamic-header.h create mode 100644 test/profile/Inputs/instrprof-dynamic-main.cpp create mode 100644 test/profile/Inputs/instrprof-file_ex.c create mode 100644 test/profile/Inputs/instrprof-icall-promo.h create mode 100644 test/profile/Inputs/instrprof-icall-promo_1.cc create mode 100644 test/profile/Inputs/instrprof-icall-promo_2.cc create mode 100644 test/profile/Inputs/instrprof-merge-match-lib.c create mode 100644 test/profile/Inputs/instrprof-merge-match.c create mode 100644 test/profile/Inputs/instrprof-shared-lib.c create mode 100644 test/profile/Inputs/instrprof-shared-main.c create mode 100644 test/profile/Inputs/instrprof-value-prof-evict.c create mode 100644 test/profile/Inputs/instrprof-value-prof-real.c create mode 100644 test/profile/Inputs/instrprof-visibility-helper.cpp create mode 100644 test/profile/Linux/comdat_rename.test create mode 100644 test/profile/Linux/counter_promo_for.c create mode 100644 test/profile/Linux/counter_promo_nest.c create mode 100644 test/profile/Linux/counter_promo_while.c create mode 100644 test/profile/Linux/coverage_ctors.cpp create mode 100644 test/profile/Linux/coverage_dtor.cpp create mode 100644 test/profile/Linux/coverage_shared.test create mode 100644 test/profile/Linux/coverage_test.cpp create mode 100644 test/profile/Linux/extern_template.test create mode 100644 test/profile/Linux/instrprof-alloc.test create mode 100644 test/profile/Linux/instrprof-basic.c create mode 100644 test/profile/Linux/instrprof-comdat.test create mode 100644 test/profile/Linux/instrprof-cs.c create mode 100644 test/profile/Linux/instrprof-dir.c create mode 100644 test/profile/Linux/instrprof-dlopen.test create mode 100644 test/profile/Linux/instrprof-dynamic-one-shared.test create mode 100644 test/profile/Linux/instrprof-dynamic-two-shared.test create mode 100644 test/profile/Linux/instrprof-file_ex.test create mode 100644 test/profile/Linux/instrprof-merge-vp.c create mode 100644 test/profile/Linux/instrprof-value-prof-warn.test create mode 100644 test/profile/Linux/lit.local.cfg create mode 100644 test/profile/gcc-flag-compatibility.test create mode 100644 test/profile/infinite_loop.c create mode 100644 test/profile/instrprof-basic.c create mode 100644 test/profile/instrprof-bufferio.c create mode 100644 test/profile/instrprof-darwin-dead-strip.c create mode 100644 test/profile/instrprof-dlopen-dlclose-gcov.test create mode 100644 test/profile/instrprof-dlopen.test create mode 100644 test/profile/instrprof-dump.c create mode 100644 test/profile/instrprof-dynamic-one-shared.test create mode 100644 test/profile/instrprof-dynamic-two-shared.test create mode 100644 test/profile/instrprof-error.c create mode 100644 test/profile/instrprof-hostname.c create mode 100644 test/profile/instrprof-icall-promo.test create mode 100644 test/profile/instrprof-merge-match.test create mode 100644 test/profile/instrprof-merge.c create mode 100644 test/profile/instrprof-override-filename-then-reset-default.c create mode 100644 test/profile/instrprof-override-filename-with-env.c create mode 100644 test/profile/instrprof-override-filename.c create mode 100644 test/profile/instrprof-path.c create mode 100644 test/profile/instrprof-reset-counters.c create mode 100644 test/profile/instrprof-set-filename-shared.test create mode 100644 test/profile/instrprof-set-filename-then-reset-default.c create mode 100644 test/profile/instrprof-set-filename.c create mode 100644 test/profile/instrprof-shared.test create mode 100644 test/profile/instrprof-value-prof-2.c create mode 100644 test/profile/instrprof-value-prof-evict.test create mode 100644 test/profile/instrprof-value-prof-reset.c create mode 100644 test/profile/instrprof-value-prof-shared.test create mode 100644 test/profile/instrprof-value-prof.c create mode 100644 test/profile/instrprof-value-prof.test create mode 100644 test/profile/instrprof-version-mismatch.c create mode 100644 test/profile/instrprof-visibility-kinds.inc create mode 100644 test/profile/instrprof-visibility.cpp create mode 100644 test/profile/instrprof-without-libc.c create mode 100644 test/profile/instrprof-write-file-atexit-explicitly.c create mode 100644 test/profile/instrprof-write-file-only.c create mode 100644 test/profile/instrprof-write-file.c create mode 100644 test/profile/lit.cfg create mode 100644 test/profile/lit.site.cfg.in create mode 100644 test/profile/runtime_infinite.c create mode 100644 test/safestack/CMakeLists.txt create mode 100644 test/safestack/buffer-copy-vla.c create mode 100644 test/safestack/buffer-copy.c create mode 100644 test/safestack/canary.c create mode 100644 test/safestack/init.c create mode 100644 test/safestack/lit.cfg create mode 100644 test/safestack/lit.site.cfg.in create mode 100644 test/safestack/lto.c create mode 100644 test/safestack/overflow.c create mode 100644 test/safestack/pthread-cleanup.c create mode 100644 test/safestack/pthread.c create mode 100644 test/safestack/utils.h create mode 100644 test/sanitizer_common/CMakeLists.txt create mode 100644 test/sanitizer_common/TestCases/Darwin/abort_on_error.cc create mode 100644 test/sanitizer_common/TestCases/Darwin/lit.local.cfg create mode 100644 test/sanitizer_common/TestCases/Darwin/print-stack-trace.cc create mode 100644 test/sanitizer_common/TestCases/Linux/abort_on_error.cc create mode 100644 test/sanitizer_common/TestCases/Linux/aligned_alloc.c create mode 100644 test/sanitizer_common/TestCases/Linux/allow_user_segv.cc create mode 100644 test/sanitizer_common/TestCases/Linux/assert.cc create mode 100644 test/sanitizer_common/TestCases/Linux/clock_gettime.c create mode 100644 test/sanitizer_common/TestCases/Linux/closedir.c create mode 100644 test/sanitizer_common/TestCases/Linux/decorate_proc_maps.cc create mode 100644 test/sanitizer_common/TestCases/Linux/deepbind.cc create mode 100644 test/sanitizer_common/TestCases/Linux/getpwnam_r_invalid_user.cc create mode 100644 test/sanitizer_common/TestCases/Linux/hard_rss_limit_mb_test.cc create mode 100644 test/sanitizer_common/TestCases/Linux/iconv_test.c create mode 100644 test/sanitizer_common/TestCases/Linux/ill.cc create mode 100644 test/sanitizer_common/TestCases/Linux/lit.local.cfg create mode 100644 test/sanitizer_common/TestCases/Linux/mlock_test.cc create mode 100644 test/sanitizer_common/TestCases/Linux/mprobe.cc create mode 100644 test/sanitizer_common/TestCases/Linux/new_delete_test.cc create mode 100644 test/sanitizer_common/TestCases/Linux/open_memstream.cc create mode 100644 test/sanitizer_common/TestCases/Linux/ptrace.cc create mode 100644 test/sanitizer_common/TestCases/Linux/recv_msg_trunc.cc create mode 100644 test/sanitizer_common/TestCases/Linux/sched_getparam.cc create mode 100644 test/sanitizer_common/TestCases/Linux/sem_init_glibc.cc create mode 100644 test/sanitizer_common/TestCases/Linux/signal_segv_handler.cc create mode 100644 test/sanitizer_common/TestCases/Linux/soft_rss_limit_mb_test.cc create mode 100644 test/sanitizer_common/TestCases/Linux/sysconf_interceptor_bypass_test.cc create mode 100644 test/sanitizer_common/TestCases/Linux/timerfd.cc create mode 100644 test/sanitizer_common/TestCases/Linux/unexpected_format_specifier_test.cc create mode 100644 test/sanitizer_common/TestCases/Posix/dedup_token_length_test.cc create mode 100644 test/sanitizer_common/TestCases/Posix/dump_instruction_bytes.cc create mode 100644 test/sanitizer_common/TestCases/Posix/dump_registers.cc create mode 100644 test/sanitizer_common/TestCases/Posix/fpe.cc create mode 100644 test/sanitizer_common/TestCases/Posix/getpass.cc create mode 100644 test/sanitizer_common/TestCases/Posix/lit.local.cfg create mode 100644 test/sanitizer_common/TestCases/Posix/sanitizer_set_death_callback_test.cc create mode 100644 test/sanitizer_common/TestCases/Posix/sanitizer_set_report_fd_test.cc create mode 100644 test/sanitizer_common/TestCases/Posix/weak_hook_test.cc create mode 100644 test/sanitizer_common/TestCases/corelimit.cc create mode 100644 test/sanitizer_common/TestCases/fopen_nullptr.c create mode 100644 test/sanitizer_common/TestCases/get_module_and_offset_for_pc.cc create mode 100644 test/sanitizer_common/TestCases/malloc_hook.cc create mode 100644 test/sanitizer_common/TestCases/options-help.cc create mode 100644 test/sanitizer_common/TestCases/options-include.cc create mode 100644 test/sanitizer_common/TestCases/options-invalid.cc create mode 100644 test/sanitizer_common/TestCases/print-stack-trace.cc create mode 100644 test/sanitizer_common/TestCases/printf-ldbl.c create mode 100644 test/sanitizer_common/TestCases/pthread_mutexattr_get.cc create mode 100644 test/sanitizer_common/TestCases/sanitizer_coverage_inline8bit_counter.cc create mode 100644 test/sanitizer_common/TestCases/sanitizer_coverage_no_prune.cc create mode 100644 test/sanitizer_common/TestCases/sanitizer_coverage_stack_depth.cc create mode 100644 test/sanitizer_common/TestCases/sanitizer_coverage_symbolize.cc create mode 100644 test/sanitizer_common/TestCases/sanitizer_coverage_trace_pc_guard-dso.cc create mode 100644 test/sanitizer_common/TestCases/sanitizer_coverage_trace_pc_guard-init.cc create mode 100644 test/sanitizer_common/TestCases/sanitizer_coverage_trace_pc_guard.cc create mode 100644 test/sanitizer_common/TestCases/scanf-ldbl.c create mode 100644 test/sanitizer_common/TestCases/strcasestr.c create mode 100644 test/sanitizer_common/TestCases/strcspn.c create mode 100644 test/sanitizer_common/TestCases/strnlen.c create mode 100644 test/sanitizer_common/TestCases/strpbrk.c create mode 100644 test/sanitizer_common/TestCases/strspn.c create mode 100644 test/sanitizer_common/TestCases/strstr.c create mode 100644 test/sanitizer_common/TestCases/symbolize_pc.cc create mode 100644 test/sanitizer_common/TestCases/symbolize_stack.cc create mode 100644 test/sanitizer_common/Unit/lit.site.cfg.in create mode 100644 test/sanitizer_common/android_commands/android_common.py create mode 100755 test/sanitizer_common/android_commands/android_compile.py create mode 100755 test/sanitizer_common/android_commands/android_run.py create mode 100755 test/sanitizer_common/ios_commands/iossim_compile.py create mode 100755 test/sanitizer_common/ios_commands/iossim_env.py create mode 100755 test/sanitizer_common/ios_commands/iossim_run.py create mode 100644 test/sanitizer_common/lit.common.cfg create mode 100644 test/sanitizer_common/lit.site.cfg.in create mode 100644 test/sanitizer_common/print_address.h create mode 100644 test/scudo/CMakeLists.txt create mode 100644 test/scudo/alignment.c create mode 100644 test/scudo/double-free.cpp create mode 100644 test/scudo/interface.cpp create mode 100644 test/scudo/lit.cfg create mode 100644 test/scudo/lit.site.cfg.in create mode 100644 test/scudo/malloc.cpp create mode 100644 test/scudo/memalign.c create mode 100644 test/scudo/mismatch.cpp create mode 100644 test/scudo/options.cpp create mode 100644 test/scudo/overflow.c create mode 100644 test/scudo/preinit.c create mode 100644 test/scudo/preload.cpp create mode 100644 test/scudo/quarantine.c create mode 100644 test/scudo/random_shuffle.cpp create mode 100644 test/scudo/realloc.cpp create mode 100644 test/scudo/rss.c create mode 100644 test/scudo/secondary.c create mode 100644 test/scudo/sized-delete.cpp create mode 100644 test/scudo/sizes.cpp create mode 100644 test/scudo/threads.c create mode 100644 test/scudo/tsd_destruction.c create mode 100644 test/scudo/valloc.c create mode 100644 test/tsan/CMakeLists.txt create mode 100644 test/tsan/Darwin/deadlock.mm create mode 100644 test/tsan/Darwin/debug_external.cc create mode 100644 test/tsan/Darwin/dispatch_main.mm create mode 100644 test/tsan/Darwin/dispatch_once_deadlock.mm create mode 100644 test/tsan/Darwin/dlopen.cc create mode 100644 test/tsan/Darwin/external-dups.cc create mode 100644 test/tsan/Darwin/external-ignore-noninstrumented.cc create mode 100644 test/tsan/Darwin/external-lib.cc create mode 100644 test/tsan/Darwin/external-noninstrumented-module.cc create mode 100644 test/tsan/Darwin/external-swift.cc create mode 100644 test/tsan/Darwin/external.cc create mode 100644 test/tsan/Darwin/gcd-after-null.mm create mode 100644 test/tsan/Darwin/gcd-after.mm create mode 100644 test/tsan/Darwin/gcd-apply-race.mm create mode 100644 test/tsan/Darwin/gcd-apply.mm create mode 100644 test/tsan/Darwin/gcd-async-norace.mm create mode 100644 test/tsan/Darwin/gcd-async-race.mm create mode 100644 test/tsan/Darwin/gcd-barrier-race.mm create mode 100644 test/tsan/Darwin/gcd-barrier.mm create mode 100644 test/tsan/Darwin/gcd-blocks.mm create mode 100644 test/tsan/Darwin/gcd-data.mm create mode 100644 test/tsan/Darwin/gcd-fd.mm create mode 100644 test/tsan/Darwin/gcd-groups-destructor.mm create mode 100644 test/tsan/Darwin/gcd-groups-leave.mm create mode 100644 test/tsan/Darwin/gcd-groups-norace.mm create mode 100644 test/tsan/Darwin/gcd-groups-stress.mm create mode 100644 test/tsan/Darwin/gcd-io-barrier-race.mm create mode 100644 test/tsan/Darwin/gcd-io-barrier.mm create mode 100644 test/tsan/Darwin/gcd-io-cleanup.mm create mode 100644 test/tsan/Darwin/gcd-io-race.mm create mode 100644 test/tsan/Darwin/gcd-io.mm create mode 100644 test/tsan/Darwin/gcd-once.mm create mode 100644 test/tsan/Darwin/gcd-semaphore-norace.mm create mode 100644 test/tsan/Darwin/gcd-serial-queue-norace.mm create mode 100644 test/tsan/Darwin/gcd-source-cancel.mm create mode 100644 test/tsan/Darwin/gcd-source-cancel2.mm create mode 100644 test/tsan/Darwin/gcd-source-event.mm create mode 100644 test/tsan/Darwin/gcd-source-event2.mm create mode 100644 test/tsan/Darwin/gcd-source-registration.mm create mode 100644 test/tsan/Darwin/gcd-source-registration2.mm create mode 100644 test/tsan/Darwin/gcd-source-serial.mm create mode 100644 test/tsan/Darwin/gcd-suspend.mm create mode 100644 test/tsan/Darwin/gcd-sync-norace.mm create mode 100644 test/tsan/Darwin/gcd-sync-race.mm create mode 100644 test/tsan/Darwin/gcd-target-queue-norace.mm create mode 100644 test/tsan/Darwin/ignore-noninstrumented.mm create mode 100644 test/tsan/Darwin/ignored-interceptors.mm create mode 100644 test/tsan/Darwin/libcxx-call-once.mm create mode 100644 test/tsan/Darwin/libcxx-future.mm create mode 100644 test/tsan/Darwin/libcxx-shared-ptr-recursive.mm create mode 100644 test/tsan/Darwin/libcxx-shared-ptr-stress.mm create mode 100644 test/tsan/Darwin/libcxx-shared-ptr.mm create mode 100644 test/tsan/Darwin/lit.local.cfg create mode 100644 test/tsan/Darwin/main_tid.mm create mode 100644 test/tsan/Darwin/malloc-stack-logging.cc create mode 100644 test/tsan/Darwin/malloc_size.mm create mode 100644 test/tsan/Darwin/norace-objcxx-run-time.mm create mode 100644 test/tsan/Darwin/objc-double-property.mm create mode 100644 test/tsan/Darwin/objc-race.mm create mode 100644 test/tsan/Darwin/objc-simple.mm create mode 100644 test/tsan/Darwin/osatomics-add.mm create mode 100644 test/tsan/Darwin/osatomics-bitops.mm create mode 100644 test/tsan/Darwin/osatomics-list.mm create mode 100644 test/tsan/Darwin/osspinlock-norace.cc create mode 100644 test/tsan/Darwin/realloc-zero.cc create mode 100644 test/tsan/Darwin/signals-blocked.cc create mode 100644 test/tsan/Darwin/symbolizer-atos.cc create mode 100644 test/tsan/Darwin/symbolizer-dladdr.cc create mode 100644 test/tsan/Darwin/workerthreads.mm create mode 100644 test/tsan/Darwin/xpc-cancel.mm create mode 100644 test/tsan/Darwin/xpc-race.mm create mode 100644 test/tsan/Darwin/xpc.mm create mode 100644 test/tsan/Linux/check_memcpy.cc create mode 100644 test/tsan/Linux/check_preinit.cc create mode 100644 test/tsan/Linux/double_race.cc create mode 100644 test/tsan/Linux/lit.local.cfg create mode 100644 test/tsan/Linux/mutex_robust.cc create mode 100644 test/tsan/Linux/mutex_robust2.cc create mode 100644 test/tsan/Linux/pie_no_aslr.cc create mode 100644 test/tsan/Linux/user_fopen.cc create mode 100644 test/tsan/Linux/user_malloc.cc create mode 100644 test/tsan/Unit/lit.site.cfg.in create mode 100644 test/tsan/aligned_vs_unaligned_race.cc create mode 100644 test/tsan/allocator_returns_null.cc create mode 100644 test/tsan/annotate_happens_before.cc create mode 100644 test/tsan/atexit.cc create mode 100644 test/tsan/atexit2.cc create mode 100644 test/tsan/atexit3.cc create mode 100644 test/tsan/atomic_free.cc create mode 100644 test/tsan/atomic_free2.cc create mode 100644 test/tsan/atomic_free3.cc create mode 100644 test/tsan/atomic_hle.cc create mode 100644 test/tsan/atomic_norace.cc create mode 100644 test/tsan/atomic_race.cc create mode 100644 test/tsan/atomic_stack.cc create mode 100644 test/tsan/atomic_store.cc create mode 100644 test/tsan/barrier.cc create mode 100644 test/tsan/bench.h create mode 100644 test/tsan/bench_acquire_only.cc create mode 100644 test/tsan/bench_acquire_release.cc create mode 100644 test/tsan/bench_local_mutex.cc create mode 100644 test/tsan/bench_mutex.cc create mode 100644 test/tsan/bench_release_only.cc create mode 100644 test/tsan/bench_rwmutex.cc create mode 100644 test/tsan/bench_shadow_flush.cc create mode 100644 test/tsan/bench_single_writer.cc create mode 100644 test/tsan/bench_ten_mutexes.cc create mode 100644 test/tsan/benign_race.cc create mode 100644 test/tsan/blacklist.cc create mode 100644 test/tsan/blacklist2.cc create mode 100644 test/tsan/cond.c create mode 100644 test/tsan/cond_cancel.c create mode 100644 test/tsan/cond_destruction.cc create mode 100644 test/tsan/cond_race.cc create mode 100644 test/tsan/cond_version.c create mode 100644 test/tsan/custom_mutex.h create mode 100644 test/tsan/custom_mutex0.cc create mode 100644 test/tsan/custom_mutex1.cc create mode 100644 test/tsan/custom_mutex2.cc create mode 100644 test/tsan/custom_mutex3.cc create mode 100644 test/tsan/custom_mutex4.cc create mode 100644 test/tsan/custom_mutex5.cc create mode 100644 test/tsan/deadlock_detector_stress_test.cc create mode 100644 test/tsan/debug_alloc_stack.cc create mode 100644 test/tsan/debug_locate.cc create mode 100644 test/tsan/debugging.cc create mode 100644 test/tsan/deep_stack1.cc create mode 100644 test/tsan/default_options.cc create mode 100755 test/tsan/deflake.bash create mode 100644 test/tsan/dl_iterate_phdr.cc create mode 100644 test/tsan/dlclose.cc create mode 100644 test/tsan/dtls.c create mode 100644 test/tsan/exceptions.cc create mode 100644 test/tsan/fd_close_norace.cc create mode 100644 test/tsan/fd_close_norace2.cc create mode 100644 test/tsan/fd_dup_norace.cc create mode 100644 test/tsan/fd_dup_norace2.cc create mode 100644 test/tsan/fd_dup_race.cc create mode 100644 test/tsan/fd_location.cc create mode 100644 test/tsan/fd_pipe_norace.cc create mode 100644 test/tsan/fd_pipe_race.cc create mode 100644 test/tsan/fd_socket_connect_norace.cc create mode 100644 test/tsan/fd_socket_norace.cc create mode 100644 test/tsan/fd_socketpair_norace.cc create mode 100644 test/tsan/fd_stdout_race.cc create mode 100644 test/tsan/fd_tid_recycled.cc create mode 100644 test/tsan/fork_atexit.cc create mode 100644 test/tsan/fork_deadlock.cc create mode 100644 test/tsan/fork_multithreaded.cc create mode 100644 test/tsan/fork_multithreaded3.cc create mode 100644 test/tsan/free_race.c create mode 100644 test/tsan/free_race.c.supp create mode 100644 test/tsan/free_race2.c create mode 100644 test/tsan/getline_nohang.cc create mode 100644 test/tsan/global_race.cc create mode 100644 test/tsan/global_race2.cc create mode 100644 test/tsan/global_race3.cc create mode 100644 test/tsan/halt_on_error.cc create mode 100644 test/tsan/heap_race.cc create mode 100644 test/tsan/ignore_free.cc create mode 100644 test/tsan/ignore_lib0.cc create mode 100644 test/tsan/ignore_lib0.cc.supp create mode 100644 test/tsan/ignore_lib1.cc create mode 100644 test/tsan/ignore_lib1.cc.supp create mode 100644 test/tsan/ignore_lib2.cc create mode 100644 test/tsan/ignore_lib2.cc.supp create mode 100644 test/tsan/ignore_lib3.cc create mode 100644 test/tsan/ignore_lib3.cc.supp create mode 100644 test/tsan/ignore_lib4.cc create mode 100644 test/tsan/ignore_lib5.cc create mode 100644 test/tsan/ignore_lib5.cc.supp create mode 100644 test/tsan/ignore_lib_lib.h create mode 100644 test/tsan/ignore_malloc.cc create mode 100644 test/tsan/ignore_race.cc create mode 100644 test/tsan/ignore_sync.cc create mode 100644 test/tsan/ignored-interceptors-mmap.cc create mode 100644 test/tsan/inlined_memcpy_race.cc create mode 100644 test/tsan/inlined_memcpy_race2.cc create mode 100644 test/tsan/interface_atomic_test.c create mode 100644 test/tsan/java.h create mode 100644 test/tsan/java_alloc.cc create mode 100644 test/tsan/java_finalizer.cc create mode 100644 test/tsan/java_find.cc create mode 100644 test/tsan/java_heap_init.cc create mode 100644 test/tsan/java_lock.cc create mode 100644 test/tsan/java_lock_move.cc create mode 100644 test/tsan/java_lock_rec.cc create mode 100644 test/tsan/java_lock_rec_race.cc create mode 100644 test/tsan/java_move_overlap.cc create mode 100644 test/tsan/java_move_overlap_race.cc create mode 100644 test/tsan/java_race.cc create mode 100644 test/tsan/java_race_move.cc create mode 100644 test/tsan/java_race_pc.cc create mode 100644 test/tsan/java_rwlock.cc create mode 100644 test/tsan/java_symbolization.cc create mode 100644 test/tsan/java_volatile.cc create mode 100644 test/tsan/large_malloc_meta.cc create mode 100644 test/tsan/libcxx/lit.local.cfg create mode 100644 test/tsan/libcxx/std_shared_ptr.cc create mode 100644 test/tsan/lit.cfg create mode 100644 test/tsan/lit.site.cfg.in create mode 100644 test/tsan/load_shared_lib.cc create mode 100644 test/tsan/longjmp.cc create mode 100644 test/tsan/longjmp2.cc create mode 100644 test/tsan/longjmp3.cc create mode 100644 test/tsan/longjmp4.cc create mode 100644 test/tsan/lots_of_threads.c create mode 100644 test/tsan/malloc_overflow.cc create mode 100644 test/tsan/malloc_stack.cc create mode 100644 test/tsan/map32bit.cc create mode 100644 test/tsan/memcmp_race.cc create mode 100644 test/tsan/memcpy_race.cc create mode 100644 test/tsan/mmap_large.cc create mode 100644 test/tsan/mmap_stress.cc create mode 100644 test/tsan/mop1.c create mode 100644 test/tsan/mop_with_offset.cc create mode 100644 test/tsan/mop_with_offset2.cc create mode 100644 test/tsan/must_deadlock.cc create mode 100644 test/tsan/mutex_annotations.cc create mode 100644 test/tsan/mutex_bad_read_lock.cc create mode 100644 test/tsan/mutex_bad_read_unlock.cc create mode 100644 test/tsan/mutex_bad_unlock.cc create mode 100644 test/tsan/mutex_cycle2.c create mode 100644 test/tsan/mutex_cycle_long.c create mode 100644 test/tsan/mutex_destroy_locked.cc create mode 100644 test/tsan/mutex_double_lock.cc create mode 100644 test/tsan/mutex_lock_destroyed.cc create mode 100644 test/tsan/mutexset1.cc create mode 100644 test/tsan/mutexset2.cc create mode 100644 test/tsan/mutexset3.cc create mode 100644 test/tsan/mutexset4.cc create mode 100644 test/tsan/mutexset5.cc create mode 100644 test/tsan/mutexset6.cc create mode 100644 test/tsan/mutexset7.cc create mode 100644 test/tsan/mutexset8.cc create mode 100644 test/tsan/pie_test.cc create mode 100644 test/tsan/printf-1.c create mode 100644 test/tsan/pthread_atfork_deadlock.c create mode 100644 test/tsan/pthread_key.cc create mode 100644 test/tsan/race_on_barrier.c create mode 100644 test/tsan/race_on_barrier2.c create mode 100644 test/tsan/race_on_heap.cc create mode 100644 test/tsan/race_on_mutex.c create mode 100644 test/tsan/race_on_mutex2.c create mode 100644 test/tsan/race_on_puts.cc create mode 100644 test/tsan/race_on_read.cc create mode 100644 test/tsan/race_on_speculative_load.cc create mode 100644 test/tsan/race_on_write.cc create mode 100644 test/tsan/race_stress.cc create mode 100644 test/tsan/race_top_suppression.cc create mode 100644 test/tsan/race_top_suppression1.cc create mode 100644 test/tsan/race_with_finished_thread.cc create mode 100644 test/tsan/real_deadlock_detector_stress_test.cc create mode 100644 test/tsan/restore_stack.cc create mode 100644 test/tsan/setuid.c create mode 100644 test/tsan/setuid2.c create mode 100644 test/tsan/signal_block.cc create mode 100644 test/tsan/signal_cond.cc create mode 100644 test/tsan/signal_errno.cc create mode 100644 test/tsan/signal_longjmp.cc create mode 100644 test/tsan/signal_malloc.cc create mode 100644 test/tsan/signal_pause.cc create mode 100644 test/tsan/signal_recursive.cc create mode 100644 test/tsan/signal_reset.cc create mode 100644 test/tsan/signal_sync.cc create mode 100644 test/tsan/signal_sync2.cc create mode 100644 test/tsan/signal_thread.cc create mode 100644 test/tsan/signal_write.cc create mode 100644 test/tsan/sigsuspend.cc create mode 100644 test/tsan/simple_race.c create mode 100644 test/tsan/simple_race.cc create mode 100644 test/tsan/simple_stack.c create mode 100644 test/tsan/simple_stack2.cc create mode 100644 test/tsan/sleep_sync.cc create mode 100644 test/tsan/sleep_sync2.cc create mode 100644 test/tsan/stack_race.cc create mode 100644 test/tsan/stack_race2.cc create mode 100644 test/tsan/stack_sync_reuse.cc create mode 100644 test/tsan/static_init1.cc create mode 100644 test/tsan/static_init2.cc create mode 100644 test/tsan/static_init3.cc create mode 100644 test/tsan/static_init4.cc create mode 100644 test/tsan/static_init5.cc create mode 100644 test/tsan/static_init6.cc create mode 100644 test/tsan/strerror_r.cc create mode 100644 test/tsan/sunrpc.cc create mode 100644 test/tsan/suppress_same_address.cc create mode 100644 test/tsan/suppress_same_stacks.cc create mode 100644 test/tsan/suppressions_global.cc create mode 100644 test/tsan/suppressions_global.cc.supp create mode 100644 test/tsan/suppressions_race.cc create mode 100644 test/tsan/suppressions_race.cc.supp create mode 100644 test/tsan/suppressions_race2.cc create mode 100644 test/tsan/suppressions_race2.cc.supp create mode 100644 test/tsan/test.h create mode 100644 test/tsan/thread_detach.c create mode 100644 test/tsan/thread_detach2.c create mode 100644 test/tsan/thread_end_with_ignore.cc create mode 100644 test/tsan/thread_end_with_ignore2.cc create mode 100644 test/tsan/thread_end_with_ignore3.cc create mode 100644 test/tsan/thread_leak.c create mode 100644 test/tsan/thread_leak2.c create mode 100644 test/tsan/thread_leak3.c create mode 100644 test/tsan/thread_leak4.c create mode 100644 test/tsan/thread_leak5.c create mode 100644 test/tsan/thread_name.cc create mode 100644 test/tsan/thread_name2.cc create mode 100644 test/tsan/tiny_race.c create mode 100644 test/tsan/tls_race.cc create mode 100644 test/tsan/tls_race2.cc create mode 100644 test/tsan/tsan-vs-gvn.cc create mode 100644 test/tsan/unaligned_norace.cc create mode 100644 test/tsan/unaligned_race.cc create mode 100644 test/tsan/vfork.cc create mode 100644 test/tsan/virtual_inheritance_compile_bug.cc create mode 100644 test/tsan/vptr_benign_race.cc create mode 100644 test/tsan/vptr_harmful_race.cc create mode 100644 test/tsan/vptr_harmful_race2.cc create mode 100644 test/tsan/vptr_harmful_race3.cc create mode 100644 test/tsan/vptr_harmful_race4.cc create mode 100644 test/tsan/write_in_reader_lock.cc create mode 100644 test/ubsan/CMakeLists.txt create mode 100644 test/ubsan/TestCases/Float/cast-overflow.cpp create mode 100644 test/ubsan/TestCases/Integer/add-overflow.cpp create mode 100644 test/ubsan/TestCases/Integer/div-overflow.cpp create mode 100644 test/ubsan/TestCases/Integer/div-zero.cpp create mode 100644 test/ubsan/TestCases/Integer/incdec-overflow.cpp create mode 100644 test/ubsan/TestCases/Integer/mul-overflow.cpp create mode 100644 test/ubsan/TestCases/Integer/negate-overflow.cpp create mode 100644 test/ubsan/TestCases/Integer/no-recover.cpp create mode 100644 test/ubsan/TestCases/Integer/shift.cpp create mode 100644 test/ubsan/TestCases/Integer/sub-overflow.cpp create mode 100644 test/ubsan/TestCases/Integer/summary.cpp create mode 100644 test/ubsan/TestCases/Integer/suppressions.cpp create mode 100644 test/ubsan/TestCases/Integer/uadd-overflow.cpp create mode 100644 test/ubsan/TestCases/Integer/uincdec-overflow.cpp create mode 100644 test/ubsan/TestCases/Integer/umul-overflow.cpp create mode 100644 test/ubsan/TestCases/Integer/usub-overflow.cpp create mode 100644 test/ubsan/TestCases/Misc/Inputs/no-interception-dso.c create mode 100644 test/ubsan/TestCases/Misc/Inputs/returns-unexpectedly.c create mode 100644 test/ubsan/TestCases/Misc/Linux/lit.local.cfg create mode 100644 test/ubsan/TestCases/Misc/Linux/print_stack_trace.cc create mode 100644 test/ubsan/TestCases/Misc/Linux/ubsan_options.cc create mode 100644 test/ubsan/TestCases/Misc/bool.cpp create mode 100644 test/ubsan/TestCases/Misc/bool.m create mode 100644 test/ubsan/TestCases/Misc/bounds.cpp create mode 100644 test/ubsan/TestCases/Misc/builtins.cpp create mode 100644 test/ubsan/TestCases/Misc/coverage-levels.cc create mode 100644 test/ubsan/TestCases/Misc/deduplication.cpp create mode 100644 test/ubsan/TestCases/Misc/enum.cpp create mode 100644 test/ubsan/TestCases/Misc/log-path_test.cc create mode 100644 test/ubsan/TestCases/Misc/missing_return.cpp create mode 100644 test/ubsan/TestCases/Misc/no-interception.cpp create mode 100644 test/ubsan/TestCases/Misc/nonnull-arg.cpp create mode 100644 test/ubsan/TestCases/Misc/nonnull.cpp create mode 100644 test/ubsan/TestCases/Misc/nullability.c create mode 100644 test/ubsan/TestCases/Misc/unreachable.cpp create mode 100644 test/ubsan/TestCases/Misc/vla.c create mode 100644 test/ubsan/TestCases/Pointer/index-overflow.cpp create mode 100644 test/ubsan/TestCases/Pointer/unsigned-index-expression.cpp create mode 100644 test/ubsan/TestCases/TypeCheck/Function/function.cpp create mode 100644 test/ubsan/TestCases/TypeCheck/Function/lit.local.cfg create mode 100644 test/ubsan/TestCases/TypeCheck/Linux/PR33221.cpp create mode 100644 test/ubsan/TestCases/TypeCheck/Linux/lit.local.cfg create mode 100644 test/ubsan/TestCases/TypeCheck/PR33221.cpp create mode 100644 test/ubsan/TestCases/TypeCheck/misaligned.cpp create mode 100644 test/ubsan/TestCases/TypeCheck/null.cpp create mode 100644 test/ubsan/TestCases/TypeCheck/vptr-corrupted-vtable-itanium.cpp create mode 100644 test/ubsan/TestCases/TypeCheck/vptr-non-unique-typeinfo.cpp create mode 100644 test/ubsan/TestCases/TypeCheck/vptr-virtual-base-construction.cpp create mode 100644 test/ubsan/TestCases/TypeCheck/vptr-virtual-base.cpp create mode 100644 test/ubsan/TestCases/TypeCheck/vptr.cpp create mode 100644 test/ubsan/lit.common.cfg create mode 100644 test/ubsan/lit.site.cfg.in create mode 100644 test/ubsan_minimal/CMakeLists.txt create mode 100644 test/ubsan_minimal/TestCases/recover-dedup-limit.cpp create mode 100644 test/ubsan_minimal/TestCases/recover-dedup.cpp create mode 100644 test/ubsan_minimal/TestCases/test-darwin-interface.c create mode 100644 test/ubsan_minimal/TestCases/uadd-overflow.cpp create mode 100644 test/ubsan_minimal/lit.common.cfg create mode 100644 test/ubsan_minimal/lit.site.cfg.in create mode 100644 test/xray/CMakeLists.txt create mode 100644 test/xray/TestCases/Linux/always-never-instrument.cc create mode 100644 test/xray/TestCases/Linux/arg1-arg0-logging.cc create mode 100644 test/xray/TestCases/Linux/arg1-logger.cc create mode 100644 test/xray/TestCases/Linux/arg1-logging-implicit-this.cc create mode 100644 test/xray/TestCases/Linux/argv0-log-file-name.cc create mode 100644 test/xray/TestCases/Linux/basic-filtering.cc create mode 100644 test/xray/TestCases/Linux/common-trampoline-alignment.cc create mode 100644 test/xray/TestCases/Linux/coverage-sample.cc create mode 100644 test/xray/TestCases/Linux/custom-event-handler-alignment.cc create mode 100644 test/xray/TestCases/Linux/custom-event-logging.cc create mode 100644 test/xray/TestCases/Linux/fdr-mode.cc create mode 100644 test/xray/TestCases/Linux/fdr-single-thread.cc create mode 100644 test/xray/TestCases/Linux/fdr-thread-order.cc create mode 100644 test/xray/TestCases/Linux/fixedsize-logging.cc create mode 100644 test/xray/TestCases/Linux/func-id-utils.cc create mode 100644 test/xray/TestCases/Linux/logging-modes.cc create mode 100644 test/xray/TestCases/Linux/optional-inmemory-log.cc create mode 100644 test/xray/TestCases/Linux/patching-unpatching.cc create mode 100644 test/xray/TestCases/Linux/pic_test.cc create mode 100644 test/xray/TestCases/Linux/quiet-start.cc create mode 100644 test/xray/Unit/lit.site.cfg.in create mode 100644 test/xray/lit.cfg create mode 100644 test/xray/lit.site.cfg.in create mode 100644 unittests/CMakeLists.txt create mode 100644 unittests/lit.common.unit.cfg create mode 100644 unittests/lit.common.unit.configured.in create mode 100644 unittests/lit_unittest_cfg_utils.py create mode 100644 www/content.css create mode 100644 www/index.html create mode 100644 www/menu.css create mode 100644 www/menu.html.incl diff --git a/.arcconfig b/.arcconfig new file mode 100644 index 00000000..74604d35 --- /dev/null +++ b/.arcconfig @@ -0,0 +1,4 @@ +{ + "repository.callsign" : "CRT", + "conduit_uri" : "https://reviews.llvm.org/" +} diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..f7d4697e --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +*~ +darwin_fat +clang_darwin +multi_arch +*.sw? +*.pyc diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 00000000..4b953b21 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,386 @@ +# CMake build for CompilerRT. +# +# An important constraint of the build is that it only produces libraries +# based on the ability of the host toolchain to target various platforms. + +cmake_minimum_required(VERSION 3.4.3) + +# Check if compiler-rt is built as a standalone project. +if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR OR COMPILER_RT_STANDALONE_BUILD) + project(CompilerRT C CXX ASM) + set(COMPILER_RT_STANDALONE_BUILD TRUE) +endif() + +# Add path for custom compiler-rt modules. +list(INSERT CMAKE_MODULE_PATH 0 + "${CMAKE_CURRENT_SOURCE_DIR}/cmake" + "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules" + ) + +if(CMAKE_CONFIGURATION_TYPES) + set(CMAKE_CFG_RESOLVED_INTDIR "${CMAKE_CFG_INTDIR}/") +else() + set(CMAKE_CFG_RESOLVED_INTDIR "") +endif() + +include(base-config-ix) +include(CompilerRTUtils) + +option(COMPILER_RT_BUILD_BUILTINS "Build builtins" ON) +mark_as_advanced(COMPILER_RT_BUILD_BUILTINS) +option(COMPILER_RT_BUILD_SANITIZERS "Build sanitizers" ON) +mark_as_advanced(COMPILER_RT_BUILD_SANITIZERS) +option(COMPILER_RT_BUILD_XRAY "Build xray" ON) +mark_as_advanced(COMPILER_RT_BUILD_XRAY) +option(COMPILER_RT_BUILD_LIBFUZZER "Build libFuzzer" ON) +mark_as_advanced(COMPILER_RT_BUILD_LIBFUZZER) +option(COMPILER_RT_BUILD_PROFILE "Build profile runtime" ON) +mark_as_advanced(COMPILER_RT_BUILD_PROFILE) +option(COMPILER_RT_BUILD_XRAY_NO_PREINIT "Build xray with no preinit patching" OFF) +mark_as_advanced(COMPILER_RT_BUILD_XRAY_NO_PREINIT) + +set(COMPILER_RT_ASAN_SHADOW_SCALE "" + CACHE STRING "Override the shadow scale to be used in ASan runtime") + +if (NOT COMPILER_RT_ASAN_SHADOW_SCALE STREQUAL "") + # Check that the shadow scale value is valid. + if (NOT (COMPILER_RT_ASAN_SHADOW_SCALE GREATER -1 AND + COMPILER_RT_ASAN_SHADOW_SCALE LESS 8)) + message(FATAL_ERROR " + Invalid ASan Shadow Scale '${COMPILER_RT_ASAN_SHADOW_SCALE}'.") + endif() + + set(COMPILER_RT_ASAN_SHADOW_SCALE_LLVM_FLAG + -mllvm -asan-mapping-scale=${COMPILER_RT_ASAN_SHADOW_SCALE}) + set(COMPILER_RT_ASAN_SHADOW_SCALE_DEFINITION + ASAN_SHADOW_SCALE=${COMPILER_RT_ASAN_SHADOW_SCALE}) + set(COMPILER_RT_ASAN_SHADOW_SCALE_FLAG + -D${COMPILER_RT_ASAN_SHADOW_SCALE_DEFINITION}) +endif() + +set(COMPILER_RT_BAREMETAL_BUILD OFF CACHE BOOLEAN + "Build for a bare-metal target.") + +if (COMPILER_RT_STANDALONE_BUILD) + load_llvm_config() + + # Find Python interpreter. + set(Python_ADDITIONAL_VERSIONS 2.7 2.6 2.5) + include(FindPythonInterp) + if(NOT PYTHONINTERP_FOUND) + message(FATAL_ERROR " + Unable to find Python interpreter required testing. Please install Python + or specify the PYTHON_EXECUTABLE CMake variable.") + endif() + + # Define default arguments to lit. + set(LIT_ARGS_DEFAULT "-sv") + if (MSVC OR XCODE) + set(LIT_ARGS_DEFAULT "${LIT_ARGS_DEFAULT} --no-progress-bar") + endif() + set(LLVM_LIT_ARGS "${LIT_ARGS_DEFAULT}" CACHE STRING "Default options for lit") + set(LLVM_LIT_OUTPUT_DIR "${COMPILER_RT_EXEC_OUTPUT_DIR}") +endif() + +construct_compiler_rt_default_triple() +if ("${COMPILER_RT_DEFAULT_TARGET_ABI}" MATCHES "hf$") + if (${COMPILER_RT_DEFAULT_TARGET_ARCH} MATCHES "^arm") + set(COMPILER_RT_DEFAULT_TARGET_ARCH "armhf") + endif() +endif() +if ("${COMPILER_RT_DEFAULT_TARGET_ABI}" MATCHES "^android") + set(ANDROID 1) +endif() +pythonize_bool(ANDROID) + +set(COMPILER_RT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}) +set(COMPILER_RT_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}) + +# We support running instrumented tests when we're not cross compiling +# and target a UNIX-like system or Windows. +# We can run tests on Android even when we are cross-compiling. +if(("${CMAKE_HOST_SYSTEM}" STREQUAL "${CMAKE_SYSTEM}" AND (UNIX OR WIN32)) OR ANDROID + OR COMPILER_RT_EMULATOR) + option(COMPILER_RT_CAN_EXECUTE_TESTS "Can we execute instrumented tests" ON) +else() + option(COMPILER_RT_CAN_EXECUTE_TESTS "Can we execute instrumented tests" OFF) +endif() + +option(COMPILER_RT_DEBUG "Build runtimes with full debug info" OFF) +option(COMPILER_RT_EXTERNALIZE_DEBUGINFO + "Generate dSYM files and strip executables and libraries (Darwin Only)" OFF) +# COMPILER_RT_DEBUG_PYBOOL is used by lit.common.configured.in. +pythonize_bool(COMPILER_RT_DEBUG) + +include(HandleCompilerRT) +include(config-ix) + +if(APPLE AND SANITIZER_MIN_OSX_VERSION AND SANITIZER_MIN_OSX_VERSION VERSION_LESS "10.9") + # Mac OS X prior to 10.9 had problems with exporting symbols from + # libc++/libc++abi. + set(cxxabi_supported OFF) +else() + set(cxxabi_supported ON) +endif() + +option(SANITIZER_ALLOW_CXXABI "Allow use of C++ ABI details in ubsan" ON) + +set(SANITIZE_CAN_USE_CXXABI OFF) +if (cxxabi_supported AND SANITIZER_ALLOW_CXXABI) + set(SANITIZER_CAN_USE_CXXABI ON) +endif() +pythonize_bool(SANITIZER_CAN_USE_CXXABI) + +set(SANITIZER_CXX_ABI "default" CACHE STRING + "Specify C++ ABI library to use.") +set(CXXABIS none default libcxxabi libstdc++ libc++) +set_property(CACHE SANITIZER_CXX_ABI PROPERTY STRINGS ;${CXXABIS}) + +if (SANITIZER_CXX_ABI STREQUAL "default") + if (HAVE_LIBCXXABI AND COMPILER_RT_DEFAULT_TARGET_ONLY) + set(SANITIZER_CXX_ABI_LIBNAME "libcxxabi") + set(SANITIZER_CXX_ABI_INTREE 1) + elseif (APPLE) + set(SANITIZER_CXX_ABI_LIBNAME "libcxxabi") + set(SANITIZER_CXX_ABI_SYSTEM 1) + else() + set(SANITIZER_CXX_ABI_LIBNAME "libstdc++") + endif() +else() + set(SANITIZER_CXX_ABI_LIBNAME "${SANITIZER_CXX_ABI}") +endif() + +if (SANITIZER_CXX_ABI_LIBNAME STREQUAL "libcxxabi") + if (SANITIZER_CXX_ABI_INTREE) + if (TARGET unwind_shared OR HAVE_LIBUNWIND) + list(APPEND SANITIZER_CXX_ABI_LIBRARY unwind_shared) + endif() + if (TARGET cxxabi_shared OR HAVE_LIBCXXABI) + list(APPEND SANITIZER_CXX_ABI_LIBRARY cxxabi_shared) + endif() + else() + list(APPEND SANITIZER_CXX_ABI_LIBRARY "c++abi") + endif() +elseif (SANITIZER_CXX_ABI_LIBNAME STREQUAL "libc++") + list(APPEND SANITIZER_CXX_ABI_LIBRARY "c++") +elseif (SANITIZER_CXX_ABI_LIBNAME STREQUAL "libstdc++") + append_list_if(COMPILER_RT_HAS_LIBSTDCXX stdc++ SANITIZER_CXX_ABI_LIBRARY) +endif() + +option(SANITIZER_USE_COMPILER_RT "Use compiler-rt builtins instead of libgcc" OFF) + +#================================ +# Setup Compiler Flags +#================================ + +if(MSVC) + # Override any existing /W flags with /W4. This is what LLVM does. Failing to + # remove other /W[0-4] flags will result in a warning about overriding a + # previous flag. + if (COMPILER_RT_HAS_W4_FLAG) + string(REGEX REPLACE " /W[0-4]" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") + string(REGEX REPLACE " /W[0-4]" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + append_string_if(COMPILER_RT_HAS_W4_FLAG /W4 CMAKE_C_FLAGS CMAKE_CXX_FLAGS) + endif() +else() + append_string_if(COMPILER_RT_HAS_WALL_FLAG -Wall CMAKE_C_FLAGS CMAKE_CXX_FLAGS) +endif() +if(COMPILER_RT_ENABLE_WERROR) + append_string_if(COMPILER_RT_HAS_WERROR_FLAG -Werror CMAKE_C_FLAGS CMAKE_CXX_FLAGS) + append_string_if(COMPILER_RT_HAS_WX_FLAG /WX CMAKE_C_FLAGS CMAKE_CXX_FLAGS) +endif() + +append_string_if(COMPILER_RT_HAS_STD_CXX11_FLAG -std=c++11 CMAKE_CXX_FLAGS) + +# Emulate C99 and C++11's __func__ for MSVC prior to 2013 CTP. +if(NOT COMPILER_RT_HAS_FUNC_SYMBOL) + add_definitions(-D__func__=__FUNCTION__) +endif() + +# Provide some common commmandline flags for Sanitizer runtimes. +if(NOT WIN32) + append_list_if(COMPILER_RT_HAS_FPIC_FLAG -fPIC SANITIZER_COMMON_CFLAGS) +endif() +append_list_if(COMPILER_RT_HAS_FNO_BUILTIN_FLAG -fno-builtin SANITIZER_COMMON_CFLAGS) +append_list_if(COMPILER_RT_HAS_FNO_EXCEPTIONS_FLAG -fno-exceptions SANITIZER_COMMON_CFLAGS) +if(NOT COMPILER_RT_DEBUG AND NOT APPLE) + append_list_if(COMPILER_RT_HAS_FOMIT_FRAME_POINTER_FLAG -fomit-frame-pointer SANITIZER_COMMON_CFLAGS) +endif() +append_list_if(COMPILER_RT_HAS_FUNWIND_TABLES_FLAG -funwind-tables SANITIZER_COMMON_CFLAGS) +append_list_if(COMPILER_RT_HAS_FNO_STACK_PROTECTOR_FLAG -fno-stack-protector SANITIZER_COMMON_CFLAGS) +append_list_if(COMPILER_RT_HAS_FNO_SANITIZE_SAFE_STACK_FLAG -fno-sanitize=safe-stack SANITIZER_COMMON_CFLAGS) +append_list_if(COMPILER_RT_HAS_FVISIBILITY_HIDDEN_FLAG -fvisibility=hidden SANITIZER_COMMON_CFLAGS) +if(NOT COMPILER_RT_HAS_FVISIBILITY_HIDDEN_FLAG) + append_list_if(COMPILER_RT_HAS_FVISIBILITY_INLINES_HIDDEN_FLAG -fvisibility-inlines-hidden SANITIZER_COMMON_CFLAGS) +endif() +append_list_if(COMPILER_RT_HAS_FNO_LTO_FLAG -fno-lto SANITIZER_COMMON_CFLAGS) + +# The following is a workaround for powerpc64le. This is the only architecture +# that requires -fno-function-sections to work properly. If lacking, the ASan +# Linux test function-sections-are-bad.cc fails with the following error: +# 'undefined symbol: __sanitizer_unaligned_load32'. +if(DEFINED TARGET_powerpc64le_CFLAGS) + append_list_if(COMPILER_RT_HAS_FNO_FUNCTION_SECTIONS_FLAG -fno-function-sections TARGET_powerpc64le_CFLAGS) +endif() + +if(MSVC) + # Replace the /M[DT][d] flags with /MT, and strip any definitions of _DEBUG, + # which cause definition mismatches at link time. + # FIXME: In fact, sanitizers should support both /MT and /MD, see PR20214. + if(COMPILER_RT_HAS_MT_FLAG) + foreach(flag_var + CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE + CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO + CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE + CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO) + string(REGEX REPLACE "/M[DT]d" "/MT" ${flag_var} "${${flag_var}}") + string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}") + string(REGEX REPLACE "/D_DEBUG" "" ${flag_var} "${${flag_var}}") + endforeach() + endif() + append_list_if(COMPILER_RT_HAS_Oy_FLAG /Oy- SANITIZER_COMMON_CFLAGS) + append_list_if(COMPILER_RT_HAS_GS_FLAG /GS- SANITIZER_COMMON_CFLAGS) + # VS 2015 (version 1900) added support for thread safe static initialization. + # However, ASan interceptors run before CRT initialization, which causes the + # new thread safe code to crash. Disable this feature for now. + if (MSVC_VERSION GREATER 1899 OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") + list(APPEND SANITIZER_COMMON_CFLAGS /Zc:threadSafeInit-) + endif() +endif() + +append_list_if(COMPILER_RT_DEBUG -DSANITIZER_DEBUG=1 SANITIZER_COMMON_CFLAGS) + +# If we're using MSVC, +# always respect the optimization flags set by CMAKE_BUILD_TYPE instead. +if (NOT MSVC) + + # Build with optimization, unless we're in debug mode. + if(COMPILER_RT_DEBUG) + list(APPEND SANITIZER_COMMON_CFLAGS -O0) + else() + list(APPEND SANITIZER_COMMON_CFLAGS -O3) + endif() +endif() + +# Determine if we should restrict stack frame sizes. +# Stack frames on PowerPC and Mips and in debug biuld can be much larger than +# anticipated. +# FIXME: Fix all sanitizers and add -Wframe-larger-than to +# SANITIZER_COMMON_FLAGS +if(COMPILER_RT_HAS_WFRAME_LARGER_THAN_FLAG AND NOT COMPILER_RT_DEBUG + AND NOT ${COMPILER_RT_DEFAULT_TARGET_ARCH} MATCHES "powerpc|mips") + set(SANITIZER_LIMIT_FRAME_SIZE TRUE) +else() + set(SANITIZER_LIMIT_FRAME_SIZE FALSE) +endif() + +# Build sanitizer runtimes with debug info. +if(COMPILER_RT_HAS_GLINE_TABLES_ONLY_FLAG AND NOT COMPILER_RT_DEBUG) + list(APPEND SANITIZER_COMMON_CFLAGS -gline-tables-only) +elseif(COMPILER_RT_HAS_G_FLAG) + list(APPEND SANITIZER_COMMON_CFLAGS -g) +elseif(MSVC) + # Use /Z7 instead of /Zi for the asan runtime. This avoids the LNK4099 + # warning from the MS linker complaining that it can't find the 'vc140.pdb' + # file used by our object library compilations. + list(APPEND SANITIZER_COMMON_CFLAGS /Z7) + llvm_replace_compiler_option(CMAKE_CXX_FLAGS "/Z[i7I]" "/Z7") + llvm_replace_compiler_option(CMAKE_CXX_FLAGS_DEBUG "/Z[i7I]" "/Z7") + llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/Z[i7I]" "/Z7") +endif() + +if(LLVM_ENABLE_MODULES) + # Sanitizers cannot be built with -fmodules. The interceptors intentionally + # don't include system headers, which is incompatible with modules. + list(APPEND SANITIZER_COMMON_CFLAGS -fno-modules) +endif() + +# Turn off several warnings. +append_list_if(COMPILER_RT_HAS_WGNU_FLAG -Wno-gnu SANITIZER_COMMON_CFLAGS) +append_list_if(COMPILER_RT_HAS_WVARIADIC_MACROS_FLAG -Wno-variadic-macros SANITIZER_COMMON_CFLAGS) +append_list_if(COMPILER_RT_HAS_WC99_EXTENSIONS_FLAG -Wno-c99-extensions SANITIZER_COMMON_CFLAGS) +append_list_if(COMPILER_RT_HAS_WNON_VIRTUAL_DTOR_FLAG -Wno-non-virtual-dtor SANITIZER_COMMON_CFLAGS) +append_list_if(COMPILER_RT_HAS_WD4146_FLAG /wd4146 SANITIZER_COMMON_CFLAGS) +append_list_if(COMPILER_RT_HAS_WD4291_FLAG /wd4291 SANITIZER_COMMON_CFLAGS) +append_list_if(COMPILER_RT_HAS_WD4391_FLAG /wd4391 SANITIZER_COMMON_CFLAGS) +append_list_if(COMPILER_RT_HAS_WD4722_FLAG /wd4722 SANITIZER_COMMON_CFLAGS) +append_list_if(COMPILER_RT_HAS_WD4800_FLAG /wd4800 SANITIZER_COMMON_CFLAGS) + +# Set common link flags. +append_list_if(COMPILER_RT_HAS_NODEFAULTLIBS_FLAG -nodefaultlibs SANITIZER_COMMON_LINK_FLAGS) + +if (SANITIZER_USE_COMPILER_RT) + list(APPEND SANITIZER_COMMON_LINK_FLAGS -rtlib=compiler-rt) + find_compiler_rt_library(builtins COMPILER_RT_BUILTINS_LIBRARY) + list(APPEND SANITIZER_COMMON_LINK_LIBS ${COMPILER_RT_BUILTINS_LIBRARY}) +else() + if (ANDROID) + append_list_if(COMPILER_RT_HAS_GCC_LIB gcc SANITIZER_COMMON_LINK_LIBS) + else() + append_list_if(COMPILER_RT_HAS_GCC_S_LIB gcc_s SANITIZER_COMMON_LINK_LIBS) + endif() +endif() + +append_list_if(COMPILER_RT_HAS_LIBC c SANITIZER_COMMON_LINK_LIBS) + +if("${CMAKE_SYSTEM_NAME}" STREQUAL "Fuchsia") + list(APPEND SANITIZER_COMMON_LINK_FLAGS -Wl,-z,defs,-z,now,-z,relro) + list(APPEND SANITIZER_COMMON_LINK_LIBS zircon) +endif() + +# Warnings to turn off for all libraries, not just sanitizers. +append_string_if(COMPILER_RT_HAS_WUNUSED_PARAMETER_FLAG -Wno-unused-parameter CMAKE_C_FLAGS CMAKE_CXX_FLAGS) + +if (CMAKE_LINKER MATCHES "link.exe$") + # Silence MSVC linker warnings caused by empty object files. The + # sanitizer libraries intentionally use ifdefs that result in empty + # files, rather than skipping these files in the build system. + # Ideally, we would pass this flag only for the libraries that need + # it, but CMake doesn't seem to have a way to set linker flags for + # individual static libraries, so we enable the suppression flag for + # the whole compiler-rt project. + append("/IGNORE:4221" CMAKE_STATIC_LINKER_FLAGS) +endif() + +add_subdirectory(include) + +foreach(path IN ITEMS ${LLVM_MAIN_SRC_DIR}/projects/libcxx + ${LLVM_MAIN_SRC_DIR}/runtimes/libcxx + ${LLVM_MAIN_SRC_DIR}/../libcxx + ${LLVM_EXTERNAL_LIBCXX_SOURCE_DIR}) + if(IS_DIRECTORY ${path}) + set(COMPILER_RT_LIBCXX_PATH ${path}) + break() + endif() +endforeach() + +set(COMPILER_RT_LLD_PATH ${LLVM_MAIN_SRC_DIR}/tools/lld) +if(EXISTS ${COMPILER_RT_LLD_PATH}/ AND LLVM_TOOL_LLD_BUILD) + set(COMPILER_RT_HAS_LLD TRUE) +else() + set(COMPILER_RT_LLD_PATH ${LLVM_MAIN_SRC_DIR}/../lld) + if(EXISTS ${COMPILER_RT_LLD_PATH}/ AND LLVM_TOOL_LLD_BUILD) + set(COMPILER_RT_HAS_LLD TRUE) + else() + set(COMPILER_RT_HAS_LLD FALSE) + endif() +endif() +pythonize_bool(COMPILER_RT_HAS_LLD) + +add_subdirectory(lib) + +if(COMPILER_RT_INCLUDE_TESTS) + add_subdirectory(unittests) + add_subdirectory(test) + if (COMPILER_RT_STANDALONE_BUILD) + # If we have a valid source tree, generate llvm-lit into the bin directory. + # The user can still choose to have the check targets *use* a different lit + # by specifying -DLLVM_EXTERNAL_LIT, but we generate it regardless. + if (EXISTS ${LLVM_MAIN_SRC_DIR}/utils/llvm-lit) + add_subdirectory(${LLVM_MAIN_SRC_DIR}/utils/llvm-lit ${CMAKE_CURRENT_BINARY_DIR}/llvm-lit) + elseif(NOT EXISTS ${LLVM_EXTERNAL_LIT}) + message(WARNING "Could not find LLVM source directory and LLVM_EXTERNAL_LIT does not" + "point to a valid file. You will not be able to run tests.") + endif() + endif() +endif() diff --git a/CODE_OWNERS.TXT b/CODE_OWNERS.TXT new file mode 100644 index 00000000..12548781 --- /dev/null +++ b/CODE_OWNERS.TXT @@ -0,0 +1,53 @@ +This file is a list of the people responsible for ensuring that patches for a +particular part of compiler-rt are reviewed, either by themself or by +someone else. They are also the gatekeepers for their part of compiler-rt, with +the final word on what goes in or not. + +The list is sorted by surname and formatted to allow easy grepping and +beautification by scripts. The fields are: name (N), email (E), web-address +(W), PGP key ID and fingerprint (P), description (D), and snail-mail address +(S). + +N: Peter Collingbourne +E: peter@pcc.me.uk +D: DataFlowSanitizer + +N: Daniel Dunbar +E: daniel@zuster.org +D: Makefile build + +N: Timur Iskhodzhanov +E: timurrrr@google.com +D: AddressSanitizer for Windows + +N: Howard Hinnant +E: howard.hinnant@gmail.com +D: builtins library + +N: Alexander Potapenko +E: glider@google.com +D: MacOS/iOS port of sanitizers + +N: Alexey Samsonov +E: samsonov@google.com +D: CMake build, test suite + +N: Kostya Serebryany +E: kcc@google.com +D: AddressSanitizer, sanitizer_common, porting sanitizers to another platforms, LeakSanitizer + +N: Richard Smith +E: richard-llvm@metafoo.co.uk +D: UndefinedBehaviorSanitizer + +N: Evgeniy Stepanov +E: eugenis@google.com +D: MemorySanitizer, Android port of sanitizers + +N: Dmitry Vyukov +E: dvyukov@google.com +D: ThreadSanitizer + +N: Bill Wendling +E: isanbard@gmail.com +D: Profile runtime library diff --git a/CREDITS.TXT b/CREDITS.TXT new file mode 100644 index 00000000..6964eba0 --- /dev/null +++ b/CREDITS.TXT @@ -0,0 +1,36 @@ +This file is a partial list of people who have contributed to the LLVM/CompilerRT +project. If you have contributed a patch or made some other contribution to +LLVM/CompilerRT, please submit a patch to this file to add yourself, and it will be +done! + +The list is sorted by surname and formatted to allow easy grepping and +beautification by scripts. The fields are: name (N), email (E), web-address +(W), PGP key ID and fingerprint (P), description (D), and snail-mail address +(S). + +N: Craig van Vliet +E: cvanvliet@auroraux.org +W: http://www.auroraux.org +D: Code style and Readability fixes. + +N: Edward O'Callaghan +E: eocallaghan@auroraux.org +W: http://www.auroraux.org +D: CMake'ify Compiler-RT build system +D: Maintain Solaris & AuroraUX ports of Compiler-RT + +N: Howard Hinnant +E: hhinnant@apple.com +D: Architect and primary author of compiler-rt + +N: Guan-Hong Liu +E: koviankevin@hotmail.com +D: IEEE Quad-precision functions + +N: Joerg Sonnenberger +E: joerg@NetBSD.org +D: Maintains NetBSD port. + +N: Matt Thomas +E: matt@NetBSD.org +D: ARM improvements. diff --git a/LICENSE.TXT b/LICENSE.TXT new file mode 100644 index 00000000..a17dc12b --- /dev/null +++ b/LICENSE.TXT @@ -0,0 +1,91 @@ +============================================================================== +compiler_rt License +============================================================================== + +The compiler_rt library is dual licensed under both the University of Illinois +"BSD-Like" license and the MIT license. As a user of this code you may choose +to use it under either license. As a contributor, you agree to allow your code +to be used under both. + +Full text of the relevant licenses is included below. + +============================================================================== + +University of Illinois/NCSA +Open Source License + +Copyright (c) 2009-2016 by the contributors listed in CREDITS.TXT + +All rights reserved. + +Developed by: + + LLVM Team + + University of Illinois at Urbana-Champaign + + http://llvm.org + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal with +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimers. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimers in the + documentation and/or other materials provided with the distribution. + + * Neither the names of the LLVM Team, University of Illinois at + Urbana-Champaign, nor the names of its contributors may be used to + endorse or promote products derived from this Software without specific + prior written permission. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE +SOFTWARE. + +============================================================================== + +Copyright (c) 2009-2015 by the contributors listed in CREDITS.TXT + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +============================================================================== +Copyrights and Licenses for Third Party Software Distributed with LLVM: +============================================================================== +The LLVM software contains code written by third parties. Such software will +have its own individual LICENSE.TXT file in the directory in which it appears. +This file will describe the copyrights, license, and restrictions which apply +to that code. + +The disclaimer of warranty in the University of Illinois Open Source License +applies to all code in the LLVM Distribution, and nothing in any of the +other licenses gives permission to use the names of the LLVM Team or the +University of Illinois to endorse or promote products derived from this +Software. + diff --git a/README.txt b/README.txt new file mode 100644 index 00000000..fc884324 --- /dev/null +++ b/README.txt @@ -0,0 +1,11 @@ +Compiler-RT +================================ + +This directory and its subdirectories contain source code for the compiler +support routines. + +Compiler-RT is open source software. You may freely distribute it under the +terms of the license agreement found in LICENSE.txt. + +================================ + diff --git a/cmake/Modules/AddCompilerRT.cmake b/cmake/Modules/AddCompilerRT.cmake new file mode 100644 index 00000000..139b6140 --- /dev/null +++ b/cmake/Modules/AddCompilerRT.cmake @@ -0,0 +1,549 @@ +include(ExternalProject) +include(CompilerRTUtils) + +function(set_target_output_directories target output_dir) + # For RUNTIME_OUTPUT_DIRECTORY variable, Multi-configuration generators + # append a per-configuration subdirectory to the specified directory. + # To avoid the appended folder, the configuration specific variable must be + # set 'RUNTIME_OUTPUT_DIRECTORY_${CONF}': + # RUNTIME_OUTPUT_DIRECTORY_DEBUG, RUNTIME_OUTPUT_DIRECTORY_RELEASE, ... + if(CMAKE_CONFIGURATION_TYPES) + foreach(build_mode ${CMAKE_CONFIGURATION_TYPES}) + string(TOUPPER "${build_mode}" CONFIG_SUFFIX) + set_target_properties("${target}" PROPERTIES + "ARCHIVE_OUTPUT_DIRECTORY_${CONFIG_SUFFIX}" ${output_dir} + "LIBRARY_OUTPUT_DIRECTORY_${CONFIG_SUFFIX}" ${output_dir} + "RUNTIME_OUTPUT_DIRECTORY_${CONFIG_SUFFIX}" ${output_dir}) + endforeach() + else() + set_target_properties("${target}" PROPERTIES + ARCHIVE_OUTPUT_DIRECTORY ${output_dir} + LIBRARY_OUTPUT_DIRECTORY ${output_dir} + RUNTIME_OUTPUT_DIRECTORY ${output_dir}) + endif() +endfunction() + +# Tries to add an "object library" target for a given list of OSs and/or +# architectures with name "." for non-Darwin platforms if +# architecture can be targeted, and "." for Darwin platforms. +# add_compiler_rt_object_libraries( +# OS +# ARCHS +# SOURCES +# CFLAGS +# DEFS ) +function(add_compiler_rt_object_libraries name) + cmake_parse_arguments(LIB "" "" "OS;ARCHS;SOURCES;CFLAGS;DEFS" ${ARGN}) + set(libnames) + if(APPLE) + foreach(os ${LIB_OS}) + set(libname "${name}.${os}") + set(libnames ${libnames} ${libname}) + set(extra_cflags_${libname} ${DARWIN_${os}_CFLAGS}) + list_intersect(LIB_ARCHS_${libname} DARWIN_${os}_ARCHS LIB_ARCHS) + endforeach() + else() + foreach(arch ${LIB_ARCHS}) + set(libname "${name}.${arch}") + set(libnames ${libnames} ${libname}) + set(extra_cflags_${libname} ${TARGET_${arch}_CFLAGS}) + if(NOT CAN_TARGET_${arch}) + message(FATAL_ERROR "Architecture ${arch} can't be targeted") + return() + endif() + endforeach() + endif() + + foreach(libname ${libnames}) + add_library(${libname} OBJECT ${LIB_SOURCES}) + + # Strip out -msse3 if this isn't macOS. + set(target_flags ${LIB_CFLAGS}) + if(APPLE AND NOT "${libname}" MATCHES ".*\.osx.*") + list(REMOVE_ITEM target_flags "-msse3") + endif() + + set_target_compile_flags(${libname} + ${CMAKE_CXX_FLAGS} ${extra_cflags_${libname}} ${target_flags}) + set_property(TARGET ${libname} APPEND PROPERTY + COMPILE_DEFINITIONS ${LIB_DEFS}) + set_target_properties(${libname} PROPERTIES FOLDER "Compiler-RT Libraries") + if(APPLE) + set_target_properties(${libname} PROPERTIES + OSX_ARCHITECTURES "${LIB_ARCHS_${libname}}") + endif() + endforeach() +endfunction() + +# Takes a list of object library targets, and a suffix and appends the proper +# TARGET_OBJECTS string to the output variable. +# format_object_libs( ...) +macro(format_object_libs output suffix) + foreach(lib ${ARGN}) + list(APPEND ${output} $) + endforeach() +endmacro() + +function(add_compiler_rt_component name) + add_custom_target(${name}) + set_target_properties(${name} PROPERTIES FOLDER "Compiler-RT Misc") + if(COMMAND runtime_register_component) + runtime_register_component(${name}) + endif() + add_dependencies(compiler-rt ${name}) +endfunction() + +function(add_asm_sources output) + set(${output} ${ARGN} PARENT_SCOPE) + # Xcode will try to compile asm files as C ('clang -x c'), and that will fail. + if (${CMAKE_GENERATOR} STREQUAL "Xcode") + enable_language(ASM) + else() + # Pass ASM file directly to the C++ compiler. + set_source_files_properties(${ARGN} PROPERTIES LANGUAGE C) + endif() +endfunction() + +macro(set_output_name output name arch) + if(ANDROID AND ${arch} STREQUAL "i386") + set(${output} "${name}-i686${COMPILER_RT_OS_SUFFIX}") + else() + set(${output} "${name}-${arch}${COMPILER_RT_OS_SUFFIX}") + endif() +endmacro() + +# Adds static or shared runtime for a list of architectures and operating +# systems and puts it in the proper directory in the build and install trees. +# add_compiler_rt_runtime( +# {STATIC|SHARED} +# ARCHS +# OS +# SOURCES +# CFLAGS +# LINK_FLAGS +# DEFS +# LINK_LIBS (only for shared library) +# OBJECT_LIBS +# PARENT_TARGET ) +function(add_compiler_rt_runtime name type) + if(NOT type MATCHES "^(STATIC|SHARED)$") + message(FATAL_ERROR "type argument must be STATIC or SHARED") + return() + endif() + cmake_parse_arguments(LIB + "" + "PARENT_TARGET" + "OS;ARCHS;SOURCES;CFLAGS;LINK_FLAGS;DEFS;LINK_LIBS;OBJECT_LIBS" + ${ARGN}) + set(libnames) + # Until we support this some other way, build compiler-rt runtime without LTO + # to allow non-LTO projects to link with it. + if(COMPILER_RT_HAS_FNO_LTO_FLAG) + set(NO_LTO_FLAGS "-fno-lto") + else() + set(NO_LTO_FLAGS "") + endif() + + if(APPLE) + foreach(os ${LIB_OS}) + # Strip out -msse3 if this isn't macOS. + list(LENGTH LIB_CFLAGS HAS_EXTRA_CFLAGS) + if(HAS_EXTRA_CFLAGS AND NOT "${os}" MATCHES "^(osx)$") + list(REMOVE_ITEM LIB_CFLAGS "-msse3") + endif() + if(type STREQUAL "STATIC") + set(libname "${name}_${os}") + else() + set(libname "${name}_${os}_dynamic") + set(extra_link_flags_${libname} ${DARWIN_${os}_LINK_FLAGS} ${LIB_LINK_FLAGS}) + endif() + list_intersect(LIB_ARCHS_${libname} DARWIN_${os}_ARCHS LIB_ARCHS) + if(LIB_ARCHS_${libname}) + list(APPEND libnames ${libname}) + set(extra_cflags_${libname} ${DARWIN_${os}_CFLAGS} ${NO_LTO_FLAGS} ${LIB_CFLAGS}) + set(output_name_${libname} ${libname}${COMPILER_RT_OS_SUFFIX}) + set(sources_${libname} ${LIB_SOURCES}) + format_object_libs(sources_${libname} ${os} ${LIB_OBJECT_LIBS}) + endif() + endforeach() + else() + foreach(arch ${LIB_ARCHS}) + if(NOT CAN_TARGET_${arch}) + message(FATAL_ERROR "Architecture ${arch} can't be targeted") + return() + endif() + if(type STREQUAL "STATIC") + set(libname "${name}-${arch}") + set_output_name(output_name_${libname} ${name} ${arch}) + else() + set(libname "${name}-dynamic-${arch}") + set(extra_cflags_${libname} ${TARGET_${arch}_CFLAGS} ${LIB_CFLAGS}) + set(extra_link_flags_${libname} ${TARGET_${arch}_LINK_FLAGS} ${LIB_LINK_FLAGS}) + if(WIN32) + set_output_name(output_name_${libname} ${name}_dynamic ${arch}) + else() + set_output_name(output_name_${libname} ${name} ${arch}) + endif() + endif() + set(sources_${libname} ${LIB_SOURCES}) + format_object_libs(sources_${libname} ${arch} ${LIB_OBJECT_LIBS}) + set(libnames ${libnames} ${libname}) + set(extra_cflags_${libname} ${TARGET_${arch}_CFLAGS} ${NO_LTO_FLAGS} ${LIB_CFLAGS}) + endforeach() + endif() + + if(NOT libnames) + return() + endif() + + if(LIB_PARENT_TARGET) + # If the parent targets aren't created we should create them + if(NOT TARGET ${LIB_PARENT_TARGET}) + add_custom_target(${LIB_PARENT_TARGET}) + endif() + if(NOT TARGET install-${LIB_PARENT_TARGET}) + # The parent install target specifies the parent component to scrape up + # anything not installed by the individual install targets, and to handle + # installation when running the multi-configuration generators. + add_custom_target(install-${LIB_PARENT_TARGET} + DEPENDS ${LIB_PARENT_TARGET} + COMMAND "${CMAKE_COMMAND}" + -DCMAKE_INSTALL_COMPONENT=${LIB_PARENT_TARGET} + -P "${CMAKE_BINARY_DIR}/cmake_install.cmake") + add_custom_target(install-${LIB_PARENT_TARGET}-stripped + DEPENDS ${LIB_PARENT_TARGET} + COMMAND "${CMAKE_COMMAND}" + -DCMAKE_INSTALL_COMPONENT=${LIB_PARENT_TARGET} + -DCMAKE_INSTALL_DO_STRIP=1 + -P "${CMAKE_BINARY_DIR}/cmake_install.cmake") + set_target_properties(install-${LIB_PARENT_TARGET} PROPERTIES + FOLDER "Compiler-RT Misc") + set_target_properties(install-${LIB_PARENT_TARGET}-stripped PROPERTIES + FOLDER "Compiler-RT Misc") + add_dependencies(install-compiler-rt install-${LIB_PARENT_TARGET}) + add_dependencies(install-compiler-rt-stripped install-${LIB_PARENT_TARGET}-stripped) + endif() + endif() + + foreach(libname ${libnames}) + # If you are using a multi-configuration generator we don't generate + # per-library install rules, so we fall back to the parent target COMPONENT + if(CMAKE_CONFIGURATION_TYPES AND LIB_PARENT_TARGET) + set(COMPONENT_OPTION COMPONENT ${LIB_PARENT_TARGET}) + else() + set(COMPONENT_OPTION COMPONENT ${libname}) + endif() + + add_library(${libname} ${type} ${sources_${libname}}) + set_target_compile_flags(${libname} ${extra_cflags_${libname}}) + set_target_link_flags(${libname} ${extra_link_flags_${libname}}) + set_property(TARGET ${libname} APPEND PROPERTY + COMPILE_DEFINITIONS ${LIB_DEFS}) + set_target_output_directories(${libname} ${COMPILER_RT_LIBRARY_OUTPUT_DIR}) + set_target_properties(${libname} PROPERTIES + OUTPUT_NAME ${output_name_${libname}}) + set_target_properties(${libname} PROPERTIES FOLDER "Compiler-RT Runtime") + if(LIB_LINK_LIBS) + target_link_libraries(${libname} ${LIB_LINK_LIBS}) + endif() + if(${type} STREQUAL "SHARED") + if(WIN32 AND NOT CYGWIN AND NOT MINGW) + set_target_properties(${libname} PROPERTIES IMPORT_PREFIX "") + set_target_properties(${libname} PROPERTIES IMPORT_SUFFIX ".lib") + endif() + if(APPLE) + # Ad-hoc sign the dylibs + add_custom_command(TARGET ${libname} + POST_BUILD + COMMAND codesign --sign - $ + WORKING_DIRECTORY ${COMPILER_RT_LIBRARY_OUTPUT_DIR} + ) + endif() + endif() + install(TARGETS ${libname} + ARCHIVE DESTINATION ${COMPILER_RT_LIBRARY_INSTALL_DIR} + ${COMPONENT_OPTION} + LIBRARY DESTINATION ${COMPILER_RT_LIBRARY_INSTALL_DIR} + ${COMPONENT_OPTION} + RUNTIME DESTINATION ${COMPILER_RT_LIBRARY_INSTALL_DIR} + ${COMPONENT_OPTION}) + + # We only want to generate per-library install targets if you aren't using + # an IDE because the extra targets get cluttered in IDEs. + if(NOT CMAKE_CONFIGURATION_TYPES) + add_custom_target(install-${libname} + DEPENDS ${libname} + COMMAND "${CMAKE_COMMAND}" + -DCMAKE_INSTALL_COMPONENT=${libname} + -P "${CMAKE_BINARY_DIR}/cmake_install.cmake") + add_custom_target(install-${libname}-stripped + DEPENDS ${libname} + COMMAND "${CMAKE_COMMAND}" + -DCMAKE_INSTALL_COMPONENT=${libname} + -DCMAKE_INSTALL_DO_STRIP=1 + -P "${CMAKE_BINARY_DIR}/cmake_install.cmake") + # If you have a parent target specified, we bind the new install target + # to the parent install target. + if(LIB_PARENT_TARGET) + add_dependencies(install-${LIB_PARENT_TARGET} install-${libname}) + add_dependencies(install-${LIB_PARENT_TARGET}-stripped install-${libname}-stripped) + endif() + endif() + if(APPLE) + set_target_properties(${libname} PROPERTIES + OSX_ARCHITECTURES "${LIB_ARCHS_${libname}}") + endif() + + if(type STREQUAL "SHARED") + rt_externalize_debuginfo(${libname}) + endif() + endforeach() + if(LIB_PARENT_TARGET) + add_dependencies(${LIB_PARENT_TARGET} ${libnames}) + endif() +endfunction() + +# when cross compiling, COMPILER_RT_TEST_COMPILER_CFLAGS help +# in compilation and linking of unittests. +string(REPLACE " " ";" COMPILER_RT_UNITTEST_CFLAGS "${COMPILER_RT_TEST_COMPILER_CFLAGS}") +set(COMPILER_RT_UNITTEST_LINK_FLAGS ${COMPILER_RT_UNITTEST_CFLAGS}) + +# Unittests support. +set(COMPILER_RT_GTEST_PATH ${LLVM_MAIN_SRC_DIR}/utils/unittest/googletest) +set(COMPILER_RT_GTEST_SOURCE ${COMPILER_RT_GTEST_PATH}/src/gtest-all.cc) +set(COMPILER_RT_GTEST_CFLAGS + -DGTEST_NO_LLVM_RAW_OSTREAM=1 + -DGTEST_HAS_RTTI=0 + -I${COMPILER_RT_GTEST_PATH}/include + -I${COMPILER_RT_GTEST_PATH} +) + +append_list_if(COMPILER_RT_DEBUG -DSANITIZER_DEBUG=1 COMPILER_RT_UNITTEST_CFLAGS) +append_list_if(COMPILER_RT_HAS_WCOVERED_SWITCH_DEFAULT_FLAG -Wno-covered-switch-default COMPILER_RT_UNITTEST_CFLAGS) + +if(MSVC) + # clang doesn't support exceptions on Windows yet. + list(APPEND COMPILER_RT_UNITTEST_CFLAGS -D_HAS_EXCEPTIONS=0) + + # We should teach clang to understand "#pragma intrinsic", see PR19898. + list(APPEND COMPILER_RT_UNITTEST_CFLAGS -Wno-undefined-inline) + + # Clang doesn't support SEH on Windows yet. + list(APPEND COMPILER_RT_GTEST_CFLAGS -DGTEST_HAS_SEH=0) + + # gtest use a lot of stuff marked as deprecated on Windows. + list(APPEND COMPILER_RT_GTEST_CFLAGS -Wno-deprecated-declarations) +endif() + +# Compile and register compiler-rt tests. +# generate_compiler_rt_tests( +# +# KIND +# SUBDIR +# SOURCES +# RUNTIME +# CFLAGS +# COMPILE_DEPS +# DEPS +# LINK_FLAGS +# ) +function(generate_compiler_rt_tests test_objects test_suite testname arch) + cmake_parse_arguments(TEST "" "KIND;RUNTIME;SUBDIR" + "SOURCES;COMPILE_DEPS;DEPS;CFLAGS;LINK_FLAGS" ${ARGN}) + + foreach(source ${TEST_SOURCES}) + sanitizer_test_compile( + "${test_objects}" "${source}" "${arch}" + KIND ${TEST_KIND} + COMPILE_DEPS ${TEST_COMPILE_DEPS} + DEPS ${TEST_DEPS} + CFLAGS ${TEST_CFLAGS} + ) + endforeach() + + set(TEST_DEPS ${${test_objects}}) + + if(NOT "${TEST_RUNTIME}" STREQUAL "") + list(APPEND TEST_DEPS ${TEST_RUNTIME}) + list(APPEND "${test_objects}" $) + endif() + + add_compiler_rt_test(${test_suite} "${testname}" "${arch}" + SUBDIR ${TEST_SUBDIR} + OBJECTS ${${test_objects}} + DEPS ${TEST_DEPS} + LINK_FLAGS ${TEST_LINK_FLAGS} + ) + set("${test_objects}" "${${test_objects}}" PARENT_SCOPE) +endfunction() + +# Link objects into a single executable with COMPILER_RT_TEST_COMPILER, +# using specified link flags. Make executable a part of provided +# test_suite. +# add_compiler_rt_test( +# SUBDIR +# OBJECTS +# DEPS +# LINK_FLAGS ) +function(add_compiler_rt_test test_suite test_name arch) + cmake_parse_arguments(TEST "" "SUBDIR" "OBJECTS;DEPS;LINK_FLAGS" "" ${ARGN}) + set(output_dir ${CMAKE_CURRENT_BINARY_DIR}) + if(TEST_SUBDIR) + set(output_dir "${output_dir}/${TEST_SUBDIR}") + endif() + set(output_dir "${output_dir}/${CMAKE_CFG_INTDIR}") + file(MAKE_DIRECTORY "${output_dir}") + set(output_bin "${output_dir}/${test_name}") + if(MSVC) + set(output_bin "${output_bin}.exe") + endif() + + # Use host compiler in a standalone build, and just-built Clang otherwise. + if(NOT COMPILER_RT_STANDALONE_BUILD) + list(APPEND TEST_DEPS clang) + endif() + + get_target_flags_for_arch(${arch} TARGET_LINK_FLAGS) + list(APPEND TEST_LINK_FLAGS ${TARGET_LINK_FLAGS}) + + # If we're not on MSVC, include the linker flags from CMAKE but override them + # with the provided link flags. This ensures that flags which are required to + # link programs at all are included, but the changes needed for the test + # trump. With MSVC we can't do that because CMake is set up to run link.exe + # when linking, not the compiler. Here, we hack it to use the compiler + # because we want to use -fsanitize flags. + if(NOT MSVC) + set(TEST_LINK_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${TEST_LINK_FLAGS}") + separate_arguments(TEST_LINK_FLAGS) + endif() + add_custom_command( + OUTPUT "${output_bin}" + COMMAND ${COMPILER_RT_TEST_COMPILER} ${TEST_OBJECTS} -o "${output_bin}" + ${TEST_LINK_FLAGS} + DEPENDS ${TEST_DEPS} + ) + add_custom_target(T${test_name} DEPENDS "${output_bin}") + set_target_properties(T${test_name} PROPERTIES FOLDER "Compiler-RT Tests") + + # Make the test suite depend on the binary. + add_dependencies(${test_suite} T${test_name}) +endfunction() + +macro(add_compiler_rt_resource_file target_name file_name component) + set(src_file "${CMAKE_CURRENT_SOURCE_DIR}/${file_name}") + set(dst_file "${COMPILER_RT_OUTPUT_DIR}/${file_name}") + add_custom_command(OUTPUT ${dst_file} + DEPENDS ${src_file} + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src_file} ${dst_file} + COMMENT "Copying ${file_name}...") + add_custom_target(${target_name} DEPENDS ${dst_file}) + # Install in Clang resource directory. + install(FILES ${file_name} + DESTINATION ${COMPILER_RT_INSTALL_PATH} + COMPONENT ${component}) + add_dependencies(${component} ${target_name}) + + set_target_properties(${target_name} PROPERTIES FOLDER "Compiler-RT Misc") +endmacro() + +macro(add_compiler_rt_script name) + set(dst ${COMPILER_RT_EXEC_OUTPUT_DIR}/${name}) + set(src ${CMAKE_CURRENT_SOURCE_DIR}/${name}) + add_custom_command(OUTPUT ${dst} + DEPENDS ${src} + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src} ${dst} + COMMENT "Copying ${name}...") + add_custom_target(${name} DEPENDS ${dst}) + install(FILES ${dst} + PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE + DESTINATION ${COMPILER_RT_INSTALL_PATH}/bin) +endmacro(add_compiler_rt_script src name) + +# Builds custom version of libc++ and installs it in . +# Can be used to build sanitized versions of libc++ for running unit tests. +# add_custom_libcxx( +# DEPS +# CFLAGS ) +macro(add_custom_libcxx name prefix) + if(NOT COMPILER_RT_LIBCXX_PATH) + message(FATAL_ERROR "libcxx not found!") + endif() + + cmake_parse_arguments(LIBCXX "" "" "DEPS;CFLAGS;CMAKE_ARGS" ${ARGN}) + foreach(flag ${LIBCXX_CFLAGS}) + set(flagstr "${flagstr} ${flag}") + endforeach() + set(LIBCXX_CFLAGS ${flagstr}) + + if(NOT COMPILER_RT_STANDALONE_BUILD) + list(APPEND LIBCXX_DEPS clang) + endif() + + ExternalProject_Add(${name} + PREFIX ${prefix} + SOURCE_DIR ${COMPILER_RT_LIBCXX_PATH} + CMAKE_ARGS -DCMAKE_MAKE_PROGRAM:STRING=${CMAKE_MAKE_PROGRAM} + -DCMAKE_C_COMPILER=${COMPILER_RT_TEST_COMPILER} + -DCMAKE_CXX_COMPILER=${COMPILER_RT_TEST_CXX_COMPILER} + -DCMAKE_C_FLAGS=${LIBCXX_CFLAGS} + -DCMAKE_CXX_FLAGS=${LIBCXX_CFLAGS} + -DCMAKE_BUILD_TYPE=Release + -DCMAKE_INSTALL_PREFIX:PATH= + -DLLVM_PATH=${LLVM_MAIN_SRC_DIR} + -DLIBCXX_STANDALONE_BUILD=On + ${LIBCXX_CMAKE_ARGS} + LOG_BUILD 1 + LOG_CONFIGURE 1 + LOG_INSTALL 1 + ) + set_target_properties(${name} PROPERTIES EXCLUDE_FROM_ALL TRUE) + + ExternalProject_Add_Step(${name} force-reconfigure + DEPENDERS configure + ALWAYS 1 + ) + + ExternalProject_Add_Step(${name} clobber + COMMAND ${CMAKE_COMMAND} -E remove_directory + COMMAND ${CMAKE_COMMAND} -E make_directory + COMMENT "Clobberring ${name} build directory..." + DEPENDERS configure + DEPENDS ${LIBCXX_DEPS} + ) +endmacro() + +function(rt_externalize_debuginfo name) + if(NOT COMPILER_RT_EXTERNALIZE_DEBUGINFO) + return() + endif() + + if(NOT COMPILER_RT_EXTERNALIZE_DEBUGINFO_SKIP_STRIP) + set(strip_command COMMAND xcrun strip -Sl $) + endif() + + if(APPLE) + if(CMAKE_CXX_FLAGS MATCHES "-flto" + OR CMAKE_CXX_FLAGS_${uppercase_CMAKE_BUILD_TYPE} MATCHES "-flto") + + set(lto_object ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${name}-lto.o) + set_property(TARGET ${name} APPEND_STRING PROPERTY + LINK_FLAGS " -Wl,-object_path_lto -Wl,${lto_object}") + endif() + add_custom_command(TARGET ${name} POST_BUILD + COMMAND xcrun dsymutil $ + ${strip_command}) + else() + message(FATAL_ERROR "COMPILER_RT_EXTERNALIZE_DEBUGINFO isn't implemented for non-darwin platforms!") + endif() +endfunction() + + +# Configure lit configuration files, including compiler-rt specific variables. +function(configure_compiler_rt_lit_site_cfg input output) + set_llvm_build_mode() + + string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} COMPILER_RT_RESOLVED_TEST_COMPILER ${COMPILER_RT_TEST_COMPILER}) + string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} COMPILER_RT_RESOLVED_LIBRARY_OUTPUT_DIR ${COMPILER_RT_LIBRARY_OUTPUT_DIR}) + + configure_lit_site_cfg(${input} ${output}) +endfunction() diff --git a/cmake/Modules/BuiltinTests.cmake b/cmake/Modules/BuiltinTests.cmake new file mode 100644 index 00000000..a6bf8644 --- /dev/null +++ b/cmake/Modules/BuiltinTests.cmake @@ -0,0 +1,98 @@ +include(CMakeCheckCompilerFlagCommonPatterns) + +# This function takes an OS and a list of architectures and identifies the +# subset of the architectures list that the installed toolchain can target. +function(try_compile_only output) + cmake_parse_arguments(ARG "" "" "SOURCE;FLAGS" ${ARGN}) + if(NOT ARG_SOURCE) + set(ARG_SOURCE "int foo(int x, int y) { return x + y; }\n") + endif() + set(SIMPLE_C ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/src.c) + file(WRITE ${SIMPLE_C} "${ARG_SOURCE}\n") + string(REGEX MATCHALL "<[A-Za-z0-9_]*>" substitutions + ${CMAKE_C_COMPILE_OBJECT}) + + set(TRY_COMPILE_FLAGS "${ARG_FLAGS}") + if(CMAKE_C_COMPILER_ID MATCHES Clang AND CMAKE_C_COMPILER_TARGET) + list(APPEND TRY_COMPILE_FLAGS "-target ${CMAKE_C_COMPILER_TARGET}") + endif() + + string(REPLACE ";" " " extra_flags "${TRY_COMPILE_FLAGS}") + + set(test_compile_command "${CMAKE_C_COMPILE_OBJECT}") + foreach(substitution ${substitutions}) + if(substitution STREQUAL "") + string(REPLACE "" + "${CMAKE_C_COMPILER}" test_compile_command ${test_compile_command}) + elseif(substitution STREQUAL "") + string(REPLACE "" + "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/test.o" + test_compile_command ${test_compile_command}) + elseif(substitution STREQUAL "") + string(REPLACE "" "${SIMPLE_C}" test_compile_command + ${test_compile_command}) + elseif(substitution STREQUAL "") + string(REPLACE "" "${CMAKE_C_FLAGS} ${extra_flags}" + test_compile_command ${test_compile_command}) + else() + string(REPLACE "${substitution}" "" test_compile_command + ${test_compile_command}) + endif() + endforeach() + + string(REPLACE " " ";" test_compile_command "${test_compile_command}") + + execute_process( + COMMAND ${test_compile_command} + RESULT_VARIABLE result + OUTPUT_VARIABLE TEST_OUTPUT + ERROR_VARIABLE TEST_ERROR + ) + + CHECK_COMPILER_FLAG_COMMON_PATTERNS(_CheckCCompilerFlag_COMMON_PATTERNS) + set(ERRORS_FOUND OFF) + foreach(var ${_CheckCCompilerFlag_COMMON_PATTERNS}) + if("${var}" STREQUAL "FAIL_REGEX") + continue() + endif() + if("${TEST_ERROR}" MATCHES "${var}" OR "${TEST_OUTPUT}" MATCHES "${var}") + set(ERRORS_FOUND ON) + endif() + endforeach() + + if(result EQUAL 0 AND NOT ERRORS_FOUND) + set(${output} True PARENT_SCOPE) + else() + file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log + "Testing compiler for supporting " ${ARGN} ":\n" + "Command: ${test_compile_command}\n" + "${TEST_OUTPUT}\n${TEST_ERROR}\n${result}\n") + set(${output} False PARENT_SCOPE) + endif() +endfunction() + +function(builtin_check_c_compiler_flag flag output) + if(NOT DEFINED ${output}) + message(STATUS "Performing Test ${output}") + try_compile_only(result FLAGS ${flag}) + set(${output} ${result} CACHE INTERNAL "Compiler supports ${flag}") + if(${result}) + message(STATUS "Performing Test ${output} - Success") + else() + message(STATUS "Performing Test ${output} - Failed") + endif() + endif() +endfunction() + +function(builtin_check_c_compiler_source output source) + if(NOT DEFINED ${output}) + message(STATUS "Performing Test ${output}") + try_compile_only(result SOURCE ${source}) + set(${output} ${result} CACHE INTERNAL "Compiler supports ${flag}") + if(${result}) + message(STATUS "Performing Test ${output} - Success") + else() + message(STATUS "Performing Test ${output} - Failed") + endif() + endif() +endfunction() diff --git a/cmake/Modules/CompilerRTCompile.cmake b/cmake/Modules/CompilerRTCompile.cmake new file mode 100644 index 00000000..556ee789 --- /dev/null +++ b/cmake/Modules/CompilerRTCompile.cmake @@ -0,0 +1,143 @@ +# On Windows, CMAKE_*_FLAGS are built for MSVC but we use the GCC clang.exe, +# which uses completely different flags. Translate some common flag types, and +# drop the rest. +function(translate_msvc_cflags out_flags msvc_flags) + # Insert an empty string in the list to simplify processing. + set(msvc_flags ";${msvc_flags}") + + # Canonicalize /flag to -flag. + string(REPLACE ";/" ";-" msvc_flags "${msvc_flags}") + + # Make space separated -D and -U flags into joined flags. + string(REGEX REPLACE ";-\([DU]\);" ";-\\1" msvc_flags "${msvc_flags}") + + set(clang_flags "") + foreach(flag ${msvc_flags}) + if ("${flag}" MATCHES "^-[DU]") + # Pass through basic command line macro definitions (-DNDEBUG). + list(APPEND clang_flags "${flag}") + elseif ("${flag}" MATCHES "^-O[2x]") + # Canonicalize normal optimization flags to -O2. + list(APPEND clang_flags "-O2") + endif() + endforeach() + set(${out_flags} "${clang_flags}" PARENT_SCOPE) +endfunction() + +# Compile a sanitizer test with a freshly built clang +# for a given architecture, adding the result to the object list. +# - obj_list: output list of objects, populated by path +# of a generated object file. +# - source: source file of a test. +# - arch: architecture to compile for. +# sanitizer_test_compile( +# KIND +# COMPILE_DEPS +# DEPS +# CFLAGS +# ) +function(sanitizer_test_compile obj_list source arch) + cmake_parse_arguments(TEST + "" "" "KIND;COMPILE_DEPS;DEPS;CFLAGS" ${ARGN}) + get_filename_component(basename ${source} NAME) + set(output_obj + "${CMAKE_CFG_RESOLVED_INTDIR}${obj_list}.${basename}.${arch}${TEST_KIND}.o") + + # Write out architecture-specific flags into TARGET_CFLAGS variable. + get_target_flags_for_arch(${arch} TARGET_CFLAGS) + set(COMPILE_DEPS ${TEST_COMPILE_DEPS}) + if(NOT COMPILER_RT_STANDALONE_BUILD) + list(APPEND COMPILE_DEPS ${TEST_DEPS}) + endif() + clang_compile(${output_obj} ${source} + CFLAGS ${TEST_CFLAGS} ${TARGET_CFLAGS} + DEPS ${COMPILE_DEPS}) + list(APPEND ${obj_list} ${output_obj}) + set("${obj_list}" "${${obj_list}}" PARENT_SCOPE) +endfunction() + +# Compile a source into an object file with COMPILER_RT_TEST_COMPILER using +# a provided compile flags and dependenices. +# clang_compile( +# CFLAGS +# DEPS ) +function(clang_compile object_file source) + cmake_parse_arguments(SOURCE "" "" "CFLAGS;DEPS" ${ARGN}) + get_filename_component(source_rpath ${source} REALPATH) + if(NOT COMPILER_RT_STANDALONE_BUILD) + list(APPEND SOURCE_DEPS clang compiler-rt-headers) + endif() + if (TARGET CompilerRTUnitTestCheckCxx) + list(APPEND SOURCE_DEPS CompilerRTUnitTestCheckCxx) + endif() + string(REGEX MATCH "[.](cc|cpp)$" is_cxx ${source_rpath}) + string(REGEX MATCH "[.](m|mm)$" is_objc ${source_rpath}) + if(is_cxx) + string(REPLACE " " ";" global_flags "${CMAKE_CXX_FLAGS}") + else() + string(REPLACE " " ";" global_flags "${CMAKE_C_FLAGS}") + endif() + + if (MSVC) + translate_msvc_cflags(global_flags "${global_flags}") + endif() + + if (APPLE) + set(global_flags ${OSX_SYSROOT_FLAG} ${global_flags}) + endif() + if (is_objc) + list(APPEND global_flags -ObjC) + endif() + + # Ignore unknown warnings. CMAKE_CXX_FLAGS may contain GCC-specific options + # which are not supported by Clang. + list(APPEND global_flags -Wno-unknown-warning-option) + set(compile_flags ${global_flags} ${SOURCE_CFLAGS}) + add_custom_command( + OUTPUT ${object_file} + COMMAND ${COMPILER_RT_TEST_COMPILER} ${compile_flags} -c + -o "${object_file}" + ${source_rpath} + MAIN_DEPENDENCY ${source} + DEPENDS ${SOURCE_DEPS}) +endfunction() + +# On Darwin, there are no system-wide C++ headers and the just-built clang is +# therefore not able to compile C++ files unless they are copied/symlinked into +# ${LLVM_BINARY_DIR}/include/c++ +# The just-built clang is used to build compiler-rt unit tests. Let's detect +# this before we try to build the tests and print out a suggestion how to fix +# it. +# On other platforms, this is currently not an issue. +macro(clang_compiler_add_cxx_check) + if (APPLE) + set(CMD + "echo '#include ' | ${COMPILER_RT_TEST_COMPILER} ${OSX_SYSROOT_FLAG} -E -x c++ - > /dev/null" + "if [ $? != 0 ] " + " then echo" + " echo 'Your just-built clang cannot find C++ headers, which are needed to build and run compiler-rt tests.'" + " echo 'You should copy or symlink your system C++ headers into ${LLVM_BINARY_DIR}/include/c++'" + " if [ -d $(dirname $(dirname $(xcrun -f clang)))/include/c++ ]" + " then echo 'e.g. with:'" + " echo ' cp -r' $(dirname $(dirname $(xcrun -f clang)))/include/c++ '${LLVM_BINARY_DIR}/include/'" + " elif [ -d $(dirname $(dirname $(xcrun -f clang)))/lib/c++ ]" + " then echo 'e.g. with:'" + " echo ' cp -r' $(dirname $(dirname $(xcrun -f clang)))/lib/c++ '${LLVM_BINARY_DIR}/include/'" + " fi" + " echo 'This can also be fixed by checking out the libcxx project from llvm.org and installing the headers'" + " echo 'into your build directory:'" + " echo ' cd ${LLVM_MAIN_SRC_DIR}/projects && svn co http://llvm.org/svn/llvm-project/libcxx/trunk libcxx'" + " echo ' cd ${LLVM_BINARY_DIR} && make -C ${LLVM_MAIN_SRC_DIR}/projects/libcxx installheaders HEADER_DIR=${LLVM_BINARY_DIR}/include'" + " echo" + " false" + "fi" + ) + add_custom_target(CompilerRTUnitTestCheckCxx + COMMAND bash -c "${CMD}" + COMMENT "Checking that just-built clang can find C++ headers..." + VERBATIM) + if (NOT COMPILER_RT_STANDALONE_BUILD) + ADD_DEPENDENCIES(CompilerRTUnitTestCheckCxx clang) + endif() + endif() +endmacro() diff --git a/cmake/Modules/CompilerRTDarwinUtils.cmake b/cmake/Modules/CompilerRTDarwinUtils.cmake new file mode 100644 index 00000000..a25540bf --- /dev/null +++ b/cmake/Modules/CompilerRTDarwinUtils.cmake @@ -0,0 +1,438 @@ +include(CMakeParseArguments) + +# On OS X SDKs can be installed anywhere on the base system and xcode-select can +# set the default Xcode to use. This function finds the SDKs that are present in +# the current Xcode. +function(find_darwin_sdk_dir var sdk_name) + set(DARWIN_${sdk_name}_CACHED_SYSROOT "" CACHE STRING "Darwin SDK path for SDK ${sdk_name}.") + set(DARWIN_PREFER_PUBLIC_SDK OFF CACHE BOOL "Prefer Darwin public SDK, even when an internal SDK is present.") + + if(DARWIN_${sdk_name}_CACHED_SYSROOT) + set(${var} ${DARWIN_${sdk_name}_CACHED_SYSROOT} PARENT_SCOPE) + return() + endif() + if(NOT DARWIN_PREFER_PUBLIC_SDK) + # Let's first try the internal SDK, otherwise use the public SDK. + execute_process( + COMMAND xcodebuild -version -sdk ${sdk_name}.internal Path + RESULT_VARIABLE result_process + OUTPUT_VARIABLE var_internal + OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_FILE /dev/null + ) + endif() + if((NOT result_process EQUAL 0) OR "" STREQUAL "${var_internal}") + execute_process( + COMMAND xcodebuild -version -sdk ${sdk_name} Path + RESULT_VARIABLE result_process + OUTPUT_VARIABLE var_internal + OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_FILE /dev/null + ) + else() + set(${var}_INTERNAL ${var_internal} PARENT_SCOPE) + endif() + if(result_process EQUAL 0) + set(${var} ${var_internal} PARENT_SCOPE) + endif() + set(DARWIN_${sdk_name}_CACHED_SYSROOT ${var_internal} CACHE STRING "Darwin SDK path for SDK ${sdk_name}." FORCE) +endfunction() + +# There isn't a clear mapping of what architectures are supported with a given +# target platform, but ld's version output does list the architectures it can +# link for. +function(darwin_get_toolchain_supported_archs output_var) + execute_process( + COMMAND ld -v + ERROR_VARIABLE LINKER_VERSION) + + string(REGEX MATCH "configured to support archs: ([^\n]+)" + ARCHES_MATCHED "${LINKER_VERSION}") + if(ARCHES_MATCHED) + set(ARCHES "${CMAKE_MATCH_1}") + message(STATUS "Got ld supported ARCHES: ${ARCHES}") + string(REPLACE " " ";" ARCHES ${ARCHES}) + else() + # If auto-detecting fails, fall back to a default set + message(WARNING "Detecting supported architectures from 'ld -v' failed. Returning default set.") + set(ARCHES "i386;x86_64;armv7;armv7s;arm64") + endif() + + set(${output_var} ${ARCHES} PARENT_SCOPE) +endfunction() + +# This function takes an OS and a list of architectures and identifies the +# subset of the architectures list that the installed toolchain can target. +function(darwin_test_archs os valid_archs) + if(${valid_archs}) + message(STATUS "Using cached valid architectures for ${os}.") + return() + endif() + + set(archs ${ARGN}) + if(NOT TEST_COMPILE_ONLY) + message(STATUS "Finding valid architectures for ${os}...") + set(SIMPLE_C ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/src.c) + file(WRITE ${SIMPLE_C} "#include \nint main() { printf(__FILE__); return 0; }\n") + + set(os_linker_flags) + foreach(flag ${DARWIN_${os}_LINK_FLAGS}) + set(os_linker_flags "${os_linker_flags} ${flag}") + endforeach() + endif() + + # The simple program will build for x86_64h on the simulator because it is + # compatible with x86_64 libraries (mostly), but since x86_64h isn't actually + # a valid or useful architecture for the iOS simulator we should drop it. + if(${os} MATCHES "^(iossim|tvossim|watchossim)$") + list(REMOVE_ITEM archs "x86_64h") + endif() + + set(working_archs) + foreach(arch ${archs}) + + set(arch_linker_flags "-arch ${arch} ${os_linker_flags}") + if(TEST_COMPILE_ONLY) + try_compile_only(CAN_TARGET_${os}_${arch} -v -arch ${arch} ${DARWIN_${os}_CFLAGS}) + else() + set(SAVED_CMAKE_EXE_LINKER_FLAGS ${CMAKE_EXE_LINKER_FLAGS}) + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${arch_linker_flags}") + try_compile(CAN_TARGET_${os}_${arch} ${CMAKE_BINARY_DIR} ${SIMPLE_C} + COMPILE_DEFINITIONS "-v -arch ${arch}" ${DARWIN_${os}_CFLAGS} + OUTPUT_VARIABLE TEST_OUTPUT) + set(CMAKE_EXE_LINKER_FLAGS ${SAVED_CMAKE_EXE_LINKER_FLAGS}) + endif() + if(${CAN_TARGET_${os}_${arch}}) + list(APPEND working_archs ${arch}) + else() + file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log + "Testing compiler for supporting ${os}-${arch}:\n" + "${TEST_OUTPUT}\n") + endif() + endforeach() + set(${valid_archs} ${working_archs} + CACHE STRING "List of valid architectures for platform ${os}.") +endfunction() + +# This function checks the host cpusubtype to see if it is post-haswell. Haswell +# and later machines can run x86_64h binaries. Haswell is cpusubtype 8. +function(darwin_filter_host_archs input output) + list_intersect(tmp_var DARWIN_osx_ARCHS ${input}) + execute_process( + COMMAND sysctl hw.cpusubtype + OUTPUT_VARIABLE SUBTYPE) + + string(REGEX MATCH "hw.cpusubtype: ([0-9]*)" + SUBTYPE_MATCHED "${SUBTYPE}") + set(HASWELL_SUPPORTED Off) + if(SUBTYPE_MATCHED) + if(${CMAKE_MATCH_1} GREATER 7) + set(HASWELL_SUPPORTED On) + endif() + endif() + if(NOT HASWELL_SUPPORTED) + list(REMOVE_ITEM tmp_var x86_64h) + endif() + set(${output} ${tmp_var} PARENT_SCOPE) +endfunction() + +# Read and process the exclude file into a list of symbols +function(darwin_read_list_from_file output_var file) + if(EXISTS ${file}) + file(READ ${file} EXCLUDES) + string(REPLACE "\n" ";" EXCLUDES ${EXCLUDES}) + set(${output_var} ${EXCLUDES} PARENT_SCOPE) + endif() +endfunction() + +# this function takes an OS, architecture and minimum version and provides a +# list of builtin functions to exclude +function(darwin_find_excluded_builtins_list output_var) + cmake_parse_arguments(LIB + "" + "OS;ARCH;MIN_VERSION" + "" + ${ARGN}) + + if(NOT LIB_OS OR NOT LIB_ARCH) + message(FATAL_ERROR "Must specify OS and ARCH to darwin_find_excluded_builtins_list!") + endif() + + darwin_read_list_from_file(${LIB_OS}_BUILTINS + ${DARWIN_EXCLUDE_DIR}/${LIB_OS}.txt) + darwin_read_list_from_file(${LIB_OS}_${LIB_ARCH}_BASE_BUILTINS + ${DARWIN_EXCLUDE_DIR}/${LIB_OS}-${LIB_ARCH}.txt) + + if(LIB_MIN_VERSION) + file(GLOB builtin_lists ${DARWIN_EXCLUDE_DIR}/${LIB_OS}*-${LIB_ARCH}.txt) + foreach(builtin_list ${builtin_lists}) + string(REGEX MATCH "${LIB_OS}([0-9\\.]*)-${LIB_ARCH}.txt" VERSION_MATCHED "${builtin_list}") + if (VERSION_MATCHED AND NOT CMAKE_MATCH_1 VERSION_LESS LIB_MIN_VERSION) + if(NOT smallest_version) + set(smallest_version ${CMAKE_MATCH_1}) + elseif(CMAKE_MATCH_1 VERSION_LESS smallest_version) + set(smallest_version ${CMAKE_MATCH_1}) + endif() + endif() + endforeach() + + if(smallest_version) + darwin_read_list_from_file(${LIB_ARCH}_${LIB_OS}_BUILTINS + ${DARWIN_EXCLUDE_DIR}/${LIB_OS}${smallest_version}-${LIB_ARCH}.txt) + endif() + endif() + + set(${output_var} + ${${LIB_ARCH}_${LIB_OS}_BUILTINS} + ${${LIB_OS}_${LIB_ARCH}_BASE_BUILTINS} + ${${LIB_OS}_BUILTINS} PARENT_SCOPE) +endfunction() + +# adds a single builtin library for a single OS & ARCH +macro(darwin_add_builtin_library name suffix) + cmake_parse_arguments(LIB + "" + "PARENT_TARGET;OS;ARCH" + "SOURCES;CFLAGS;DEFS" + ${ARGN}) + set(libname "${name}.${suffix}_${LIB_ARCH}_${LIB_OS}") + add_library(${libname} STATIC ${LIB_SOURCES}) + if(DARWIN_${LIB_OS}_SYSROOT) + set(sysroot_flag -isysroot ${DARWIN_${LIB_OS}_SYSROOT}) + endif() + + # Make a copy of the compilation flags. + set(builtin_cflags ${LIB_CFLAGS}) + + # Strip out any inappropriate flags for the target. + if("${LIB_ARCH}" MATCHES "^(armv7|armv7k|armv7s)$") + set(builtin_cflags "") + foreach(cflag "${LIB_CFLAGS}") + string(REPLACE "-fomit-frame-pointer" "" cflag "${cflag}") + list(APPEND builtin_cflags ${cflag}) + endforeach(cflag) + endif() + + set_target_compile_flags(${libname} + ${sysroot_flag} + ${DARWIN_${LIB_OS}_BUILTIN_MIN_VER_FLAG} + ${builtin_cflags}) + set_property(TARGET ${libname} APPEND PROPERTY + COMPILE_DEFINITIONS ${LIB_DEFS}) + set_target_properties(${libname} PROPERTIES + OUTPUT_NAME ${libname}${COMPILER_RT_OS_SUFFIX}) + set_target_properties(${libname} PROPERTIES + OSX_ARCHITECTURES ${LIB_ARCH}) + + if(LIB_PARENT_TARGET) + add_dependencies(${LIB_PARENT_TARGET} ${libname}) + endif() + + list(APPEND ${LIB_OS}_${suffix}_libs ${libname}) + list(APPEND ${LIB_OS}_${suffix}_lipo_flags -arch ${arch} $) +endmacro() + +function(darwin_lipo_libs name) + cmake_parse_arguments(LIB + "" + "PARENT_TARGET;OUTPUT_DIR;INSTALL_DIR" + "LIPO_FLAGS;DEPENDS" + ${ARGN}) + if(LIB_DEPENDS AND LIB_LIPO_FLAGS) + add_custom_command(OUTPUT ${LIB_OUTPUT_DIR}/lib${name}.a + COMMAND ${CMAKE_COMMAND} -E make_directory ${LIB_OUTPUT_DIR} + COMMAND lipo -output + ${LIB_OUTPUT_DIR}/lib${name}.a + -create ${LIB_LIPO_FLAGS} + DEPENDS ${LIB_DEPENDS} + ) + add_custom_target(${name} + DEPENDS ${LIB_OUTPUT_DIR}/lib${name}.a) + add_dependencies(${LIB_PARENT_TARGET} ${name}) + install(FILES ${LIB_OUTPUT_DIR}/lib${name}.a + DESTINATION ${LIB_INSTALL_DIR}) + else() + message(WARNING "Not generating lipo target for ${name} because no input libraries exist.") + endif() +endfunction() + +# Generates builtin libraries for all operating systems specified in ARGN. Each +# OS library is constructed by lipo-ing together single-architecture libraries. +macro(darwin_add_builtin_libraries) + set(DARWIN_EXCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/Darwin-excludes) + + set(CFLAGS "-fPIC -O3 -fvisibility=hidden -DVISIBILITY_HIDDEN -Wall -fomit-frame-pointer") + set(CMAKE_C_FLAGS "") + set(CMAKE_CXX_FLAGS "") + set(CMAKE_ASM_FLAGS "") + + set(PROFILE_SOURCES ../profile/InstrProfiling + ../profile/InstrProfilingBuffer + ../profile/InstrProfilingPlatformDarwin + ../profile/InstrProfilingWriter) + foreach (os ${ARGN}) + list_intersect(DARWIN_BUILTIN_ARCHS DARWIN_${os}_ARCHS BUILTIN_SUPPORTED_ARCH) + foreach (arch ${DARWIN_BUILTIN_ARCHS}) + darwin_find_excluded_builtins_list(${arch}_${os}_EXCLUDED_BUILTINS + OS ${os} + ARCH ${arch} + MIN_VERSION ${DARWIN_${os}_BUILTIN_MIN_VER}) + + filter_builtin_sources(filtered_sources + EXCLUDE ${arch}_${os}_EXCLUDED_BUILTINS + ${${arch}_SOURCES}) + + darwin_add_builtin_library(clang_rt builtins + OS ${os} + ARCH ${arch} + SOURCES ${filtered_sources} + CFLAGS ${CFLAGS} -arch ${arch} + PARENT_TARGET builtins) + endforeach() + + # Don't build cc_kext libraries for simulator platforms + if(NOT DARWIN_${os}_SKIP_CC_KEXT) + foreach (arch ${DARWIN_BUILTIN_ARCHS}) + # By not specifying MIN_VERSION this only reads the OS and OS-arch lists. + # We don't want to filter out the builtins that are present in libSystem + # because kexts can't link libSystem. + darwin_find_excluded_builtins_list(${arch}_${os}_EXCLUDED_BUILTINS + OS ${os} + ARCH ${arch}) + + filter_builtin_sources(filtered_sources + EXCLUDE ${arch}_${os}_EXCLUDED_BUILTINS + ${${arch}_SOURCES}) + + # In addition to the builtins cc_kext includes some profile sources + darwin_add_builtin_library(clang_rt cc_kext + OS ${os} + ARCH ${arch} + SOURCES ${filtered_sources} ${PROFILE_SOURCES} + CFLAGS ${CFLAGS} -arch ${arch} -mkernel + DEFS KERNEL_USE + PARENT_TARGET builtins) + endforeach() + set(archive_name clang_rt.cc_kext_${os}) + if(${os} STREQUAL "osx") + set(archive_name clang_rt.cc_kext) + endif() + darwin_lipo_libs(${archive_name} + PARENT_TARGET builtins + LIPO_FLAGS ${${os}_cc_kext_lipo_flags} + DEPENDS ${${os}_cc_kext_libs} + OUTPUT_DIR ${COMPILER_RT_LIBRARY_OUTPUT_DIR} + INSTALL_DIR ${COMPILER_RT_LIBRARY_INSTALL_DIR}) + endif() + endforeach() + + # We put the x86 sim slices into the archives for their base OS + foreach (os ${ARGN}) + if(NOT ${os} MATCHES ".*sim$") + darwin_lipo_libs(clang_rt.${os} + PARENT_TARGET builtins + LIPO_FLAGS ${${os}_builtins_lipo_flags} ${${os}sim_builtins_lipo_flags} + DEPENDS ${${os}_builtins_libs} ${${os}sim_builtins_libs} + OUTPUT_DIR ${COMPILER_RT_LIBRARY_OUTPUT_DIR} + INSTALL_DIR ${COMPILER_RT_LIBRARY_INSTALL_DIR}) + endif() + endforeach() + darwin_add_embedded_builtin_libraries() +endmacro() + +macro(darwin_add_embedded_builtin_libraries) + # this is a hacky opt-out. If you can't target both intel and arm + # architectures we bail here. + set(DARWIN_SOFT_FLOAT_ARCHS armv6m armv7m armv7em armv7) + set(DARWIN_HARD_FLOAT_ARCHS armv7em armv7) + if(COMPILER_RT_SUPPORTED_ARCH MATCHES ".*armv.*") + list(FIND COMPILER_RT_SUPPORTED_ARCH i386 i386_idx) + if(i386_idx GREATER -1) + list(APPEND DARWIN_HARD_FLOAT_ARCHS i386) + endif() + + list(FIND COMPILER_RT_SUPPORTED_ARCH x86_64 x86_64_idx) + if(x86_64_idx GREATER -1) + list(APPEND DARWIN_HARD_FLOAT_ARCHS x86_64) + endif() + + set(MACHO_SYM_DIR ${CMAKE_CURRENT_SOURCE_DIR}/macho_embedded) + + set(CFLAGS "-Oz -Wall -fomit-frame-pointer -ffreestanding") + set(CMAKE_C_FLAGS "") + set(CMAKE_CXX_FLAGS "") + set(CMAKE_ASM_FLAGS "") + + set(SOFT_FLOAT_FLAG -mfloat-abi=soft) + set(HARD_FLOAT_FLAG -mfloat-abi=hard) + + set(ENABLE_PIC Off) + set(PIC_FLAG -fPIC) + set(STATIC_FLAG -static) + + set(DARWIN_macho_embedded_ARCHS armv6m armv7m armv7em armv7 i386 x86_64) + + set(DARWIN_macho_embedded_LIBRARY_OUTPUT_DIR + ${COMPILER_RT_OUTPUT_DIR}/lib/macho_embedded) + set(DARWIN_macho_embedded_LIBRARY_INSTALL_DIR + ${COMPILER_RT_INSTALL_PATH}/lib/macho_embedded) + + set(CFLAGS_armv7 "-target thumbv7-apple-darwin-eabi") + set(CFLAGS_i386 "-march=pentium") + + darwin_read_list_from_file(common_FUNCTIONS ${MACHO_SYM_DIR}/common.txt) + darwin_read_list_from_file(thumb2_FUNCTIONS ${MACHO_SYM_DIR}/thumb2.txt) + darwin_read_list_from_file(thumb2_64_FUNCTIONS ${MACHO_SYM_DIR}/thumb2-64.txt) + darwin_read_list_from_file(arm_FUNCTIONS ${MACHO_SYM_DIR}/arm.txt) + darwin_read_list_from_file(i386_FUNCTIONS ${MACHO_SYM_DIR}/i386.txt) + + + set(armv6m_FUNCTIONS ${common_FUNCTIONS} ${arm_FUNCTIONS}) + set(armv7m_FUNCTIONS ${common_FUNCTIONS} ${arm_FUNCTIONS} ${thumb2_FUNCTIONS}) + set(armv7em_FUNCTIONS ${common_FUNCTIONS} ${arm_FUNCTIONS} ${thumb2_FUNCTIONS}) + set(armv7_FUNCTIONS ${common_FUNCTIONS} ${arm_FUNCTIONS} ${thumb2_FUNCTIONS} ${thumb2_64_FUNCTIONS}) + set(i386_FUNCTIONS ${common_FUNCTIONS} ${i386_FUNCTIONS}) + set(x86_64_FUNCTIONS ${common_FUNCTIONS}) + + foreach(arch ${DARWIN_macho_embedded_ARCHS}) + filter_builtin_sources(${arch}_filtered_sources + INCLUDE ${arch}_FUNCTIONS + ${${arch}_SOURCES}) + if(NOT ${arch}_filtered_sources) + message("${arch}_SOURCES: ${${arch}_SOURCES}") + message("${arch}_FUNCTIONS: ${${arch}_FUNCTIONS}") + message(FATAL_ERROR "Empty filtered sources!") + endif() + endforeach() + + foreach(float_type SOFT HARD) + foreach(type PIC STATIC) + string(TOLOWER "${float_type}_${type}" lib_suffix) + foreach(arch ${DARWIN_${float_type}_FLOAT_ARCHS}) + set(DARWIN_macho_embedded_SYSROOT ${DARWIN_osx_SYSROOT}) + set(float_flag) + if(${arch} MATCHES "^arm") + # x86 targets are hard float by default, but the complain about the + # float ABI flag, so don't pass it unless we're targeting arm. + set(float_flag ${${float_type}_FLOAT_FLAG}) + endif() + darwin_add_builtin_library(clang_rt ${lib_suffix} + OS macho_embedded + ARCH ${arch} + SOURCES ${${arch}_filtered_sources} + CFLAGS ${CFLAGS} -arch ${arch} ${${type}_FLAG} ${float_flag} ${CFLAGS_${arch}} + PARENT_TARGET builtins) + endforeach() + foreach(lib ${macho_embedded_${lib_suffix}_libs}) + set_target_properties(${lib} PROPERTIES LINKER_LANGUAGE C) + endforeach() + darwin_lipo_libs(clang_rt.${lib_suffix} + PARENT_TARGET builtins + LIPO_FLAGS ${macho_embedded_${lib_suffix}_lipo_flags} + DEPENDS ${macho_embedded_${lib_suffix}_libs} + OUTPUT_DIR ${DARWIN_macho_embedded_LIBRARY_OUTPUT_DIR} + INSTALL_DIR ${DARWIN_macho_embedded_LIBRARY_INSTALL_DIR}) + endforeach() + endforeach() + endif() +endmacro() diff --git a/cmake/Modules/CompilerRTLink.cmake b/cmake/Modules/CompilerRTLink.cmake new file mode 100644 index 00000000..05c535f6 --- /dev/null +++ b/cmake/Modules/CompilerRTLink.cmake @@ -0,0 +1,16 @@ +# Link a shared library with COMPILER_RT_TEST_COMPILER. +# clang_link_shared( +# OBJECTS +# LINK_FLAGS +# DEPS ) +macro(clang_link_shared so_file) + cmake_parse_arguments(SOURCE "" "" "OBJECTS;LINK_FLAGS;DEPS" ${ARGN}) + if(NOT COMPILER_RT_STANDALONE_BUILD) + list(APPEND SOURCE_DEPS clang) + endif() + add_custom_command( + OUTPUT ${so_file} + COMMAND ${COMPILER_RT_TEST_COMPILER} -o "${so_file}" -shared + ${SOURCE_LINK_FLAGS} ${SOURCE_OBJECTS} + DEPENDS ${SOURCE_DEPS}) +endmacro() diff --git a/cmake/Modules/CompilerRTUtils.cmake b/cmake/Modules/CompilerRTUtils.cmake new file mode 100644 index 00000000..9f79a9b9 --- /dev/null +++ b/cmake/Modules/CompilerRTUtils.cmake @@ -0,0 +1,307 @@ +include(CMakePushCheckState) +include(CheckSymbolExists) + +# Because compiler-rt spends a lot of time setting up custom compile flags, +# define a handy helper function for it. The compile flags setting in CMake +# has serious issues that make its syntax challenging at best. +function(set_target_compile_flags target) + set(argstring "") + foreach(arg ${ARGN}) + set(argstring "${argstring} ${arg}") + endforeach() + set_property(TARGET ${target} PROPERTY COMPILE_FLAGS "${argstring}") +endfunction() + +function(set_target_link_flags target) + set(argstring "") + foreach(arg ${ARGN}) + set(argstring "${argstring} ${arg}") + endforeach() + set_property(TARGET ${target} PROPERTY LINK_FLAGS "${argstring}") +endfunction() + +# Set the variable var_PYBOOL to True if var holds a true-ish string, +# otherwise set it to False. +macro(pythonize_bool var) + if (${var}) + set(${var}_PYBOOL True) + else() + set(${var}_PYBOOL False) + endif() +endmacro() + +# Appends value to all lists in ARGN, if the condition is true. +macro(append_list_if condition value) + if(${condition}) + foreach(list ${ARGN}) + list(APPEND ${list} ${value}) + endforeach() + endif() +endmacro() + +# Appends value to all strings in ARGN, if the condition is true. +macro(append_string_if condition value) + if(${condition}) + foreach(str ${ARGN}) + set(${str} "${${str}} ${value}") + endforeach() + endif() +endmacro() + +macro(append_rtti_flag polarity list) + if(${polarity}) + append_list_if(COMPILER_RT_HAS_FRTTI_FLAG -frtti ${list}) + append_list_if(COMPILER_RT_HAS_GR_FLAG /GR ${list}) + else() + append_list_if(COMPILER_RT_HAS_FNO_RTTI_FLAG -fno-rtti ${list}) + append_list_if(COMPILER_RT_HAS_GR_FLAG /GR- ${list}) + endif() +endmacro() + +macro(append_have_file_definition filename varname list) + check_include_file("${filename}" "${varname}") + if (NOT ${varname}) + set("${varname}" 0) + endif() + list(APPEND ${list} "${varname}=${${varname}}") +endmacro() + +macro(list_intersect output input1 input2) + set(${output}) + foreach(it ${${input1}}) + list(FIND ${input2} ${it} index) + if( NOT (index EQUAL -1)) + list(APPEND ${output} ${it}) + endif() + endforeach() +endmacro() + +function(list_replace input_list old new) + set(replaced_list) + foreach(item ${${input_list}}) + if(${item} STREQUAL ${old}) + list(APPEND replaced_list ${new}) + else() + list(APPEND replaced_list ${item}) + endif() + endforeach() + set(${input_list} "${replaced_list}" PARENT_SCOPE) +endfunction() + +# Takes ${ARGN} and puts only supported architectures in @out_var list. +function(filter_available_targets out_var) + set(archs ${${out_var}}) + foreach(arch ${ARGN}) + list(FIND COMPILER_RT_SUPPORTED_ARCH ${arch} ARCH_INDEX) + if(NOT (ARCH_INDEX EQUAL -1) AND CAN_TARGET_${arch}) + list(APPEND archs ${arch}) + endif() + endforeach() + set(${out_var} ${archs} PARENT_SCOPE) +endfunction() + +# Add $arch as supported with no additional flags. +macro(add_default_target_arch arch) + set(TARGET_${arch}_CFLAGS "") + set(CAN_TARGET_${arch} 1) + list(APPEND COMPILER_RT_SUPPORTED_ARCH ${arch}) +endmacro() + +function(check_compile_definition def argstring out_var) + if("${def}" STREQUAL "") + set(${out_var} TRUE PARENT_SCOPE) + return() + endif() + cmake_push_check_state() + set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} ${argstring}") + check_symbol_exists(${def} "" ${out_var}) + cmake_pop_check_state() +endfunction() + +# test_target_arch( ) +# Checks if architecture is supported: runs host compiler with provided +# flags to verify that: +# 1) is defined (if non-empty) +# 2) simple file can be successfully built. +# If successful, saves target flags for this architecture. +macro(test_target_arch arch def) + set(TARGET_${arch}_CFLAGS ${ARGN}) + set(TARGET_${arch}_LINK_FLAGS ${ARGN}) + set(argstring "") + foreach(arg ${ARGN}) + set(argstring "${argstring} ${arg}") + endforeach() + check_compile_definition("${def}" "${argstring}" HAS_${arch}_DEF) + if(NOT DEFINED CAN_TARGET_${arch}) + if(NOT HAS_${arch}_DEF) + set(CAN_TARGET_${arch} FALSE) + elseif(TEST_COMPILE_ONLY) + try_compile_only(CAN_TARGET_${arch} ${TARGET_${arch}_CFLAGS}) + else() + set(FLAG_NO_EXCEPTIONS "") + if(COMPILER_RT_HAS_FNO_EXCEPTIONS_FLAG) + set(FLAG_NO_EXCEPTIONS " -fno-exceptions ") + endif() + set(SAVED_CMAKE_EXE_LINKER_FLAGS ${CMAKE_EXE_LINKER_FLAGS}) + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${argstring}") + try_compile(CAN_TARGET_${arch} ${CMAKE_BINARY_DIR} ${SIMPLE_SOURCE} + COMPILE_DEFINITIONS "${TARGET_${arch}_CFLAGS} ${FLAG_NO_EXCEPTIONS}" + OUTPUT_VARIABLE TARGET_${arch}_OUTPUT) + set(CMAKE_EXE_LINKER_FLAGS ${SAVED_CMAKE_EXE_LINKER_FLAGS}) + endif() + endif() + if(${CAN_TARGET_${arch}}) + list(APPEND COMPILER_RT_SUPPORTED_ARCH ${arch}) + elseif("${COMPILER_RT_DEFAULT_TARGET_ARCH}" STREQUAL "${arch}" AND + COMPILER_RT_HAS_EXPLICIT_DEFAULT_TARGET_TRIPLE) + # Bail out if we cannot target the architecture we plan to test. + message(FATAL_ERROR "Cannot compile for ${arch}:\n${TARGET_${arch}_OUTPUT}") + endif() +endmacro() + +macro(detect_target_arch) + check_symbol_exists(__arm__ "" __ARM) + check_symbol_exists(__aarch64__ "" __AARCH64) + check_symbol_exists(__x86_64__ "" __X86_64) + check_symbol_exists(__i386__ "" __I386) + check_symbol_exists(__mips__ "" __MIPS) + check_symbol_exists(__mips64__ "" __MIPS64) + check_symbol_exists(__powerpc64__ "" __PPC64) + check_symbol_exists(__powerpc64le__ "" __PPC64LE) + check_symbol_exists(__s390x__ "" __S390X) + check_symbol_exists(__wasm32__ "" __WEBASSEMBLY32) + check_symbol_exists(__wasm64__ "" __WEBASSEMBLY64) + if(__ARM) + add_default_target_arch(arm) + elseif(__AARCH64) + add_default_target_arch(aarch64) + elseif(__X86_64) + add_default_target_arch(x86_64) + elseif(__I386) + add_default_target_arch(i386) + elseif(__MIPS64) # must be checked before __MIPS + add_default_target_arch(mips64) + elseif(__MIPS) + add_default_target_arch(mips) + elseif(__PPC64) + add_default_target_arch(powerpc64) + elseif(__PPC64LE) + add_default_target_arch(powerpc64le) + elseif(__S390X) + add_default_target_arch(s390x) + elseif(__WEBASSEMBLY32) + add_default_target_arch(wasm32) + elseif(__WEBASSEMBLY64) + add_default_target_arch(wasm64) + endif() +endmacro() + +macro(load_llvm_config) + if (NOT LLVM_CONFIG_PATH) + find_program(LLVM_CONFIG_PATH "llvm-config" + DOC "Path to llvm-config binary") + if (NOT LLVM_CONFIG_PATH) + message(FATAL_ERROR "llvm-config not found: specify LLVM_CONFIG_PATH") + endif() + endif() + execute_process( + COMMAND ${LLVM_CONFIG_PATH} "--obj-root" "--bindir" "--libdir" "--src-root" + RESULT_VARIABLE HAD_ERROR + OUTPUT_VARIABLE CONFIG_OUTPUT) + if (HAD_ERROR) + message(FATAL_ERROR "llvm-config failed with status ${HAD_ERROR}") + endif() + string(REGEX REPLACE "[ \t]*[\r\n]+[ \t]*" ";" CONFIG_OUTPUT ${CONFIG_OUTPUT}) + list(GET CONFIG_OUTPUT 0 BINARY_DIR) + list(GET CONFIG_OUTPUT 1 TOOLS_BINARY_DIR) + list(GET CONFIG_OUTPUT 2 LIBRARY_DIR) + list(GET CONFIG_OUTPUT 3 MAIN_SRC_DIR) + + set(LLVM_BINARY_DIR ${BINARY_DIR} CACHE PATH "Path to LLVM build tree") + set(LLVM_TOOLS_BINARY_DIR ${TOOLS_BINARY_DIR} CACHE PATH "Path to llvm/bin") + set(LLVM_LIBRARY_DIR ${LIBRARY_DIR} CACHE PATH "Path to llvm/lib") + set(LLVM_MAIN_SRC_DIR ${MAIN_SRC_DIR} CACHE PATH "Path to LLVM source tree") + + # Make use of LLVM CMake modules. + # --cmakedir is supported since llvm r291218 (4.0 release) + execute_process( + COMMAND ${LLVM_CONFIG_PATH} --cmakedir + RESULT_VARIABLE HAD_ERROR + OUTPUT_VARIABLE CONFIG_OUTPUT) + if(NOT HAD_ERROR) + string(STRIP "${CONFIG_OUTPUT}" LLVM_CMAKE_PATH_FROM_LLVM_CONFIG) + file(TO_CMAKE_PATH ${LLVM_CMAKE_PATH_FROM_LLVM_CONFIG} LLVM_CMAKE_PATH) + else() + file(TO_CMAKE_PATH ${LLVM_BINARY_DIR} LLVM_BINARY_DIR_CMAKE_STYLE) + set(LLVM_CMAKE_PATH "${LLVM_BINARY_DIR_CMAKE_STYLE}/lib${LLVM_LIBDIR_SUFFIX}/cmake/llvm") + endif() + + list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_PATH}") + # Get some LLVM variables from LLVMConfig. + include("${LLVM_CMAKE_PATH}/LLVMConfig.cmake") + + set(LLVM_LIBRARY_OUTPUT_INTDIR + ${LLVM_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${LLVM_LIBDIR_SUFFIX}) +endmacro() + +macro(construct_compiler_rt_default_triple) + if(COMPILER_RT_DEFAULT_TARGET_ONLY) + if(DEFINED COMPILER_RT_DEFAULT_TARGET_TRIPLE) + message(FATAL_ERROR "COMPILER_RT_DEFAULT_TARGET_TRIPLE isn't supported when building for default target only") + endif() + set(COMPILER_RT_DEFAULT_TARGET_TRIPLE ${CMAKE_C_COMPILER_TARGET}) + else() + set(COMPILER_RT_DEFAULT_TARGET_TRIPLE ${TARGET_TRIPLE} CACHE STRING + "Default triple for which compiler-rt runtimes will be built.") + endif() + + if(DEFINED COMPILER_RT_TEST_TARGET_TRIPLE) + # Backwards compatibility: this variable used to be called + # COMPILER_RT_TEST_TARGET_TRIPLE. + set(COMPILER_RT_DEFAULT_TARGET_TRIPLE ${COMPILER_RT_TEST_TARGET_TRIPLE}) + endif() + + string(REPLACE "-" ";" TARGET_TRIPLE_LIST ${COMPILER_RT_DEFAULT_TARGET_TRIPLE}) + list(GET TARGET_TRIPLE_LIST 0 COMPILER_RT_DEFAULT_TARGET_ARCH) + list(GET TARGET_TRIPLE_LIST 1 COMPILER_RT_DEFAULT_TARGET_OS) + list(LENGTH TARGET_TRIPLE_LIST TARGET_TRIPLE_LIST_LENGTH) + if(TARGET_TRIPLE_LIST_LENGTH GREATER 2) + list(GET TARGET_TRIPLE_LIST 2 COMPILER_RT_DEFAULT_TARGET_ABI) + endif() + # Determine if test target triple is specified explicitly, and doesn't match the + # default. + if(NOT COMPILER_RT_DEFAULT_TARGET_TRIPLE STREQUAL TARGET_TRIPLE) + set(COMPILER_RT_HAS_EXPLICIT_DEFAULT_TARGET_TRIPLE TRUE) + else() + set(COMPILER_RT_HAS_EXPLICIT_DEFAULT_TARGET_TRIPLE FALSE) + endif() +endmacro() + +# Filter out generic versions of routines that are re-implemented in +# architecture specific manner. This prevents multiple definitions of the +# same symbols, making the symbol selection non-deterministic. +function(filter_builtin_sources output_var exclude_or_include excluded_list) + if(exclude_or_include STREQUAL "EXCLUDE") + set(filter_action GREATER) + set(filter_value -1) + elseif(exclude_or_include STREQUAL "INCLUDE") + set(filter_action LESS) + set(filter_value 0) + else() + message(FATAL_ERROR "filter_builtin_sources called without EXCLUDE|INCLUDE") + endif() + + set(intermediate ${ARGN}) + foreach (_file ${intermediate}) + get_filename_component(_name_we ${_file} NAME_WE) + list(FIND ${excluded_list} ${_name_we} _found) + if(_found ${filter_action} ${filter_value}) + list(REMOVE_ITEM intermediate ${_file}) + elseif(${_file} MATCHES ".*/.*\\.S" OR ${_file} MATCHES ".*/.*\\.c") + get_filename_component(_name ${_file} NAME) + string(REPLACE ".S" ".c" _cname "${_name}") + list(REMOVE_ITEM intermediate ${_cname}) + endif () + endforeach () + set(${output_var} ${intermediate} PARENT_SCOPE) +endfunction() diff --git a/cmake/Modules/HandleCompilerRT.cmake b/cmake/Modules/HandleCompilerRT.cmake new file mode 100644 index 00000000..cff5031e --- /dev/null +++ b/cmake/Modules/HandleCompilerRT.cmake @@ -0,0 +1,21 @@ +function(find_compiler_rt_library name dest) + set(dest "" PARENT_SCOPE) + set(CLANG_COMMAND ${CMAKE_CXX_COMPILER} ${SANITIZER_COMMON_CFLAGS} + "--rtlib=compiler-rt" "--print-libgcc-file-name") + if (CMAKE_CXX_COMPILER_ID MATCHES Clang AND CMAKE_CXX_COMPILER_TARGET) + list(APPEND CLANG_COMMAND "--target=${CMAKE_CXX_COMPILER_TARGET}") + endif() + execute_process( + COMMAND ${CLANG_COMMAND} + RESULT_VARIABLE HAD_ERROR + OUTPUT_VARIABLE LIBRARY_FILE + ) + string(STRIP "${LIBRARY_FILE}" LIBRARY_FILE) + string(REPLACE "builtins" "${name}" LIBRARY_FILE "${LIBRARY_FILE}") + if (NOT HAD_ERROR AND EXISTS "${LIBRARY_FILE}") + message(STATUS "Found compiler-rt ${name} library: ${LIBRARY_FILE}") + set(${dest} "${LIBRARY_FILE}" PARENT_SCOPE) + else() + message(STATUS "Failed to find compiler-rt ${name} library") + endif() +endfunction() diff --git a/cmake/Modules/SanitizerUtils.cmake b/cmake/Modules/SanitizerUtils.cmake new file mode 100644 index 00000000..c80fc3b1 --- /dev/null +++ b/cmake/Modules/SanitizerUtils.cmake @@ -0,0 +1,94 @@ +set(SANITIZER_GEN_DYNAMIC_LIST + ${COMPILER_RT_SOURCE_DIR}/lib/sanitizer_common/scripts/gen_dynamic_list.py) + +set(SANITIZER_LINT_SCRIPT + ${COMPILER_RT_SOURCE_DIR}/lib/sanitizer_common/scripts/check_lint.sh) + +# Create a target "--symbols" that would generate the list of +# symbols that need to be exported from sanitizer runtime "". Function +# interceptors are exported automatically, user can also provide files with +# symbol names that should be exported as well. +# add_sanitizer_rt_symbols( +# ARCHS +# PARENT_TARGET +# EXTRA ) +macro(add_sanitizer_rt_symbols name) + cmake_parse_arguments(ARG + "" + "PARENT_TARGET" + "ARCHS;EXTRA" + ${ARGN}) + foreach(arch ${ARG_ARCHS}) + set(target_name ${name}-${arch}) + set(stamp ${CMAKE_CURRENT_BINARY_DIR}/${target_name}.syms-stamp) + set(extra_args) + foreach(arg ${ARG_EXTRA}) + list(APPEND extra_args "--extra" ${arg}) + endforeach() + add_custom_command(OUTPUT ${stamp} + COMMAND ${PYTHON_EXECUTABLE} + ${SANITIZER_GEN_DYNAMIC_LIST} ${extra_args} $ + > $.syms + COMMAND ${CMAKE_COMMAND} -E touch ${stamp} + DEPENDS ${target_name} ${SANITIZER_GEN_DYNAMIC_LIST} ${ARG_EXTRA} + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + COMMENT "Generating exported symbols for ${target_name}" + VERBATIM) + add_custom_target(${target_name}-symbols ALL + DEPENDS ${stamp} + SOURCES ${SANITIZER_GEN_DYNAMIC_LIST} ${ARG_EXTRA}) + + install(FILES $.syms + DESTINATION ${COMPILER_RT_LIBRARY_INSTALL_DIR}) + if(ARG_PARENT_TARGET) + add_dependencies(${ARG_PARENT_TARGET} ${target_name}-symbols) + endif() + endforeach() +endmacro() + +# This function is only used on Darwin, where undefined symbols must be specified +# in the linker invocation. +function(add_weak_symbols libname link_flags) + file(STRINGS "${COMPILER_RT_SOURCE_DIR}/lib/${libname}/weak_symbols.txt" WEAK_SYMBOLS) + set(local_link_flags ${${link_flags}}) + foreach(SYMBOL ${WEAK_SYMBOLS}) + set(local_link_flags ${local_link_flags} -Wl,-U,${SYMBOL}) + endforeach() + set(${link_flags} ${local_link_flags} PARENT_SCOPE) +endfunction() + +macro(add_sanitizer_rt_version_list name) + set(vers ${CMAKE_CURRENT_BINARY_DIR}/${name}.vers) + cmake_parse_arguments(ARG "" "" "LIBS;EXTRA" ${ARGN}) + set(args) + foreach(arg ${ARG_EXTRA}) + list(APPEND args "--extra" ${arg}) + endforeach() + foreach(arg ${ARG_LIBS}) + list(APPEND args "$") + endforeach() + add_custom_command(OUTPUT ${vers} + COMMAND ${PYTHON_EXECUTABLE} + ${SANITIZER_GEN_DYNAMIC_LIST} --version-list ${args} + > ${vers} + DEPENDS ${SANITIZER_GEN_DYNAMIC_LIST} ${ARG_EXTRA} ${ARG_LIBS} + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + COMMENT "Generating version list for ${name}" + VERBATIM) + + add_custom_target(${name}-version-list ALL + DEPENDS ${vers}) +endmacro() + +# Add target to check code style for sanitizer runtimes. +if(CMAKE_HOST_UNIX) + add_custom_target(SanitizerLintCheck + COMMAND env LLVM_CHECKOUT=${LLVM_MAIN_SRC_DIR} SILENT=1 TMPDIR= + PYTHON_EXECUTABLE=${PYTHON_EXECUTABLE} + COMPILER_RT=${COMPILER_RT_SOURCE_DIR} + ${SANITIZER_LINT_SCRIPT} + DEPENDS ${SANITIZER_LINT_SCRIPT} + COMMENT "Running lint check for sanitizer sources..." + VERBATIM) +endif() + diff --git a/cmake/base-config-ix.cmake b/cmake/base-config-ix.cmake new file mode 100644 index 00000000..b208f085 --- /dev/null +++ b/cmake/base-config-ix.cmake @@ -0,0 +1,196 @@ +# The CompilerRT build system requires CMake version 2.8.8 or higher in order +# to use its support for building convenience "libraries" as a collection of +# .o files. This is particularly useful in producing larger, more complex +# runtime libraries. + +include(CheckIncludeFile) +include(CheckCXXSourceCompiles) + +check_include_file(unwind.h HAVE_UNWIND_H) + +# Top level target used to build all compiler-rt libraries. +add_custom_target(compiler-rt ALL) +add_custom_target(install-compiler-rt) +add_custom_target(install-compiler-rt-stripped) +set_target_properties(compiler-rt PROPERTIES FOLDER "Compiler-RT Misc") + +# Setting these variables from an LLVM build is sufficient that compiler-rt can +# construct the output paths, so it can behave as if it were in-tree here. +if (LLVM_LIBRARY_OUTPUT_INTDIR AND LLVM_RUNTIME_OUTPUT_INTDIR AND PACKAGE_VERSION) + set(LLVM_TREE_AVAILABLE On) +endif() + +if (LLVM_TREE_AVAILABLE) + # Compute the Clang version from the LLVM version. + # FIXME: We should be able to reuse CLANG_VERSION variable calculated + # in Clang cmake files, instead of copying the rules here. + string(REGEX MATCH "[0-9]+\\.[0-9]+(\\.[0-9]+)?" CLANG_VERSION + ${PACKAGE_VERSION}) + # Setup the paths where compiler-rt runtimes and headers should be stored. + set(COMPILER_RT_OUTPUT_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}/clang/${CLANG_VERSION}) + set(COMPILER_RT_EXEC_OUTPUT_DIR ${LLVM_RUNTIME_OUTPUT_INTDIR}) + set(COMPILER_RT_INSTALL_PATH lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}) + option(COMPILER_RT_INCLUDE_TESTS "Generate and build compiler-rt unit tests." + ${LLVM_INCLUDE_TESTS}) + option(COMPILER_RT_ENABLE_WERROR "Fail and stop if warning is triggered" + ${LLVM_ENABLE_WERROR}) + # Use just-built Clang to compile/link tests on all platforms, except for + # Windows where we need to use clang-cl instead. + if(NOT MSVC) + set(COMPILER_RT_TEST_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/clang) + set(COMPILER_RT_TEST_CXX_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/clang++) + else() + set(COMPILER_RT_TEST_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/clang.exe) + set(COMPILER_RT_TEST_CXX_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/clang++.exe) + endif() +else() + # Take output dir and install path from the user. + set(COMPILER_RT_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR} CACHE PATH + "Path where built compiler-rt libraries should be stored.") + set(COMPILER_RT_EXEC_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/bin CACHE PATH + "Path where built compiler-rt executables should be stored.") + set(COMPILER_RT_INSTALL_PATH ${CMAKE_INSTALL_PREFIX} CACHE PATH + "Path where built compiler-rt libraries should be installed.") + option(COMPILER_RT_INCLUDE_TESTS "Generate and build compiler-rt unit tests." OFF) + option(COMPILER_RT_ENABLE_WERROR "Fail and stop if warning is triggered" OFF) + # Use a host compiler to compile/link tests. + set(COMPILER_RT_TEST_COMPILER ${CMAKE_C_COMPILER} CACHE PATH "Compiler to use for testing") + set(COMPILER_RT_TEST_CXX_COMPILER ${CMAKE_CXX_COMPILER} CACHE PATH "C++ Compiler to use for testing") +endif() + +if("${COMPILER_RT_TEST_COMPILER}" MATCHES "clang[+]*$") + set(COMPILER_RT_TEST_COMPILER_ID Clang) +elseif("${COMPILER_RT_TEST_COMPILER}" MATCHES "clang.*.exe$") + set(COMPILER_RT_TEST_COMPILER_ID Clang) +else() + set(COMPILER_RT_TEST_COMPILER_ID GNU) +endif() + +if(NOT DEFINED COMPILER_RT_OS_DIR) + string(TOLOWER ${CMAKE_SYSTEM_NAME} COMPILER_RT_OS_DIR) +endif() +set(COMPILER_RT_LIBRARY_OUTPUT_DIR + ${COMPILER_RT_OUTPUT_DIR}/lib/${COMPILER_RT_OS_DIR}) +set(COMPILER_RT_LIBRARY_INSTALL_DIR + ${COMPILER_RT_INSTALL_PATH}/lib/${COMPILER_RT_OS_DIR}) + +if(APPLE) + # On Darwin if /usr/include doesn't exist, the user probably has Xcode but not + # the command line tools. If this is the case, we need to find the OS X + # sysroot to pass to clang. + if(NOT EXISTS /usr/include) + execute_process(COMMAND xcodebuild -version -sdk macosx Path + OUTPUT_VARIABLE OSX_SYSROOT + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE) + set(OSX_SYSROOT_FLAG "-isysroot${OSX_SYSROOT}") + endif() + + option(COMPILER_RT_ENABLE_IOS "Enable building for iOS" On) + option(COMPILER_RT_ENABLE_WATCHOS "Enable building for watchOS - Experimental" Off) + option(COMPILER_RT_ENABLE_TVOS "Enable building for tvOS - Experimental" Off) + +else() + option(COMPILER_RT_DEFAULT_TARGET_ONLY "Build builtins only for the default target" Off) +endif() + +if(WIN32 AND NOT MINGW AND NOT CYGWIN) + set(CMAKE_SHARED_LIBRARY_PREFIX_C "") + set(CMAKE_SHARED_LIBRARY_PREFIX_CXX "") + set(CMAKE_STATIC_LIBRARY_PREFIX_C "") + set(CMAKE_STATIC_LIBRARY_PREFIX_CXX "") + set(CMAKE_STATIC_LIBRARY_SUFFIX_C ".lib") + set(CMAKE_STATIC_LIBRARY_SUFFIX_CXX ".lib") +endif() + +macro(test_targets) + # Find and run MSVC (not clang-cl) and get its version. This will tell clang-cl + # what version of MSVC to pretend to be so that the STL works. + set(MSVC_VERSION_FLAG "") + if (MSVC) + # Find and run MSVC (not clang-cl) and get its version. This will tell + # clang-cl what version of MSVC to pretend to be so that the STL works. + execute_process(COMMAND "$ENV{VSINSTALLDIR}/VC/bin/cl.exe" + OUTPUT_QUIET + ERROR_VARIABLE MSVC_COMPAT_VERSION + ) + string(REGEX REPLACE "^.*Compiler Version ([0-9.]+) for .*$" "\\1" + MSVC_COMPAT_VERSION "${MSVC_COMPAT_VERSION}") + if (MSVC_COMPAT_VERSION MATCHES "^[0-9].+$") + set(MSVC_VERSION_FLAG "-fms-compatibility-version=${MSVC_COMPAT_VERSION}") + # Add this flag into the host build if this is clang-cl. + if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") + append("${MSVC_VERSION_FLAG}" CMAKE_C_FLAGS CMAKE_CXX_FLAGS) + elseif (COMPILER_RT_TEST_COMPILER_ID MATCHES "Clang") + # Add this flag to test compiles to suppress clang's auto-detection + # logic. + append("${MSVC_VERSION_FLAG}" COMPILER_RT_TEST_COMPILER_CFLAGS) + endif() + endif() + endif() + + # Generate the COMPILER_RT_SUPPORTED_ARCH list. + if(ANDROID) + # Examine compiler output to determine target architecture. + detect_target_arch() + set(COMPILER_RT_OS_SUFFIX "-android") + elseif(NOT APPLE) # Supported archs for Apple platforms are generated later + if(COMPILER_RT_DEFAULT_TARGET_ONLY) + add_default_target_arch(${COMPILER_RT_DEFAULT_TARGET_ARCH}) + elseif("${COMPILER_RT_DEFAULT_TARGET_ARCH}" MATCHES "i[2-6]86|x86|amd64") + if(NOT MSVC) + test_target_arch(x86_64 "" "-m64") + test_target_arch(i386 __i386__ "-m32") + else() + if (CMAKE_SIZEOF_VOID_P EQUAL 4) + test_target_arch(i386 "" "") + else() + test_target_arch(x86_64 "" "") + endif() + endif() + elseif("${COMPILER_RT_DEFAULT_TARGET_ARCH}" MATCHES "powerpc") + # Strip out -nodefaultlibs when calling TEST_BIG_ENDIAN. Configuration + # will fail with this option when building with a sanitizer. + cmake_push_check_state() + string(REPLACE "-nodefaultlibs" "" CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS}) + TEST_BIG_ENDIAN(HOST_IS_BIG_ENDIAN) + cmake_pop_check_state() + + if(HOST_IS_BIG_ENDIAN) + test_target_arch(powerpc64 "" "-m64") + else() + test_target_arch(powerpc64le "" "-m64") + endif() + elseif("${COMPILER_RT_DEFAULT_TARGET_ARCH}" MATCHES "s390x") + test_target_arch(s390x "" "") + elseif("${COMPILER_RT_DEFAULT_TARGET_ARCH}" MATCHES "mipsel|mips64el") + # Gcc doesn't accept -m32/-m64 so we do the next best thing and use + # -mips32r2/-mips64r2. We don't use -mips1/-mips3 because we want to match + # clang's default CPU's. In the 64-bit case, we must also specify the ABI + # since the default ABI differs between gcc and clang. + # FIXME: Ideally, we would build the N32 library too. + test_target_arch(mipsel "" "-mips32r2" "--target=mipsel-linux-gnu") + test_target_arch(mips64el "" "-mips64r2" "--target=mips64el-linux-gnu" "-mabi=64") + elseif("${COMPILER_RT_DEFAULT_TARGET_ARCH}" MATCHES "mips") + test_target_arch(mips "" "-mips32r2" "--target=mips-linux-gnu") + test_target_arch(mips64 "" "-mips64r2" "--target=mips64-linux-gnu" "-mabi=64") + elseif("${COMPILER_RT_DEFAULT_TARGET_ARCH}" MATCHES "arm") + if(WIN32) + test_target_arch(arm "" "" "") + else() + test_target_arch(arm "" "-march=armv7-a" "-mfloat-abi=soft") + test_target_arch(armhf "" "-march=armv7-a" "-mfloat-abi=hard") + test_target_arch(armv6m "" "-march=armv6m" "-mfloat-abi=soft") + endif() + elseif("${COMPILER_RT_DEFAULT_TARGET_ARCH}" MATCHES "aarch32") + test_target_arch(aarch32 "" "-march=armv8-a") + elseif("${COMPILER_RT_DEFAULT_TARGET_ARCH}" MATCHES "aarch64") + test_target_arch(aarch64 "" "-march=armv8-a") + elseif("${COMPILER_RT_DEFAULT_TARGET_ARCH}" MATCHES "wasm32") + test_target_arch(wasm32 "" "--target=wasm32-unknown-unknown") + elseif("${COMPILER_RT_DEFAULT_TARGET_ARCH}" MATCHES "wasm64") + test_target_arch(wasm64 "" "--target=wasm64-unknown-unknown") + endif() + set(COMPILER_RT_OS_SUFFIX "") + endif() +endmacro() diff --git a/cmake/builtin-config-ix.cmake b/cmake/builtin-config-ix.cmake new file mode 100644 index 00000000..bdb2529b --- /dev/null +++ b/cmake/builtin-config-ix.cmake @@ -0,0 +1,178 @@ +include(BuiltinTests) +include(CheckCSourceCompiles) + +# Make all the tests only check the compiler +set(TEST_COMPILE_ONLY On) + +# Check host compiler support for certain flags +builtin_check_c_compiler_flag(-fPIC COMPILER_RT_HAS_FPIC_FLAG) +builtin_check_c_compiler_flag(-fPIE COMPILER_RT_HAS_FPIE_FLAG) +builtin_check_c_compiler_flag(-fno-builtin COMPILER_RT_HAS_FNO_BUILTIN_FLAG) +builtin_check_c_compiler_flag(-std=c11 COMPILER_RT_HAS_STD_C11_FLAG) +builtin_check_c_compiler_flag(-fvisibility=hidden COMPILER_RT_HAS_VISIBILITY_HIDDEN_FLAG) +builtin_check_c_compiler_flag(-fomit-frame-pointer COMPILER_RT_HAS_OMIT_FRAME_POINTER_FLAG) +builtin_check_c_compiler_flag(-ffreestanding COMPILER_RT_HAS_FREESTANDING_FLAG) +builtin_check_c_compiler_flag(-fxray-instrument COMPILER_RT_HAS_XRAY_COMPILER_FLAG) + +builtin_check_c_compiler_source(COMPILER_RT_HAS_ATOMIC_KEYWORD +" +int foo(int x, int y) { + _Atomic int result = x * y; + return result; +} +") + + +set(ARM64 aarch64) +set(ARM32 arm armhf armv6m armv7m armv7em armv7 armv7s armv7k) +set(X86 i386) +set(X86_64 x86_64) +set(MIPS32 mips mipsel) +set(MIPS64 mips64 mips64el) +set(PPC64 powerpc64 powerpc64le) +set(WASM32 wasm32) +set(WASM64 wasm64) + +if(APPLE) + set(ARM64 arm64) + set(ARM32 armv7 armv7k armv7s) + set(X86_64 x86_64 x86_64h) +endif() + +set(ALL_BUILTIN_SUPPORTED_ARCH ${X86} ${X86_64} ${ARM32} ${ARM64} + ${MIPS32} ${MIPS64} ${PPC64} ${WASM32} ${WASM64}) + +include(CompilerRTUtils) +include(CompilerRTDarwinUtils) + +if(APPLE) + + find_darwin_sdk_dir(DARWIN_osx_SYSROOT macosx) + find_darwin_sdk_dir(DARWIN_iossim_SYSROOT iphonesimulator) + find_darwin_sdk_dir(DARWIN_ios_SYSROOT iphoneos) + find_darwin_sdk_dir(DARWIN_watchossim_SYSROOT watchsimulator) + find_darwin_sdk_dir(DARWIN_watchos_SYSROOT watchos) + find_darwin_sdk_dir(DARWIN_tvossim_SYSROOT appletvsimulator) + find_darwin_sdk_dir(DARWIN_tvos_SYSROOT appletvos) + + set(DARWIN_EMBEDDED_PLATFORMS) + set(DARWIN_osx_BUILTIN_MIN_VER 10.5) + set(DARWIN_osx_BUILTIN_MIN_VER_FLAG + -mmacosx-version-min=${DARWIN_osx_BUILTIN_MIN_VER}) + + if(COMPILER_RT_ENABLE_IOS) + list(APPEND DARWIN_EMBEDDED_PLATFORMS ios) + set(DARWIN_ios_MIN_VER_FLAG -miphoneos-version-min) + set(DARWIN_ios_BUILTIN_MIN_VER 6.0) + set(DARWIN_ios_BUILTIN_MIN_VER_FLAG + ${DARWIN_ios_MIN_VER_FLAG}=${DARWIN_ios_BUILTIN_MIN_VER}) + endif() + if(COMPILER_RT_ENABLE_WATCHOS) + list(APPEND DARWIN_EMBEDDED_PLATFORMS watchos) + set(DARWIN_watchos_MIN_VER_FLAG -mwatchos-version-min) + set(DARWIN_watchos_BUILTIN_MIN_VER 2.0) + set(DARWIN_watchos_BUILTIN_MIN_VER_FLAG + ${DARWIN_watchos_MIN_VER_FLAG}=${DARWIN_watchos_BUILTIN_MIN_VER}) + endif() + if(COMPILER_RT_ENABLE_TVOS) + list(APPEND DARWIN_EMBEDDED_PLATFORMS tvos) + set(DARWIN_tvos_MIN_VER_FLAG -mtvos-version-min) + set(DARWIN_tvos_BUILTIN_MIN_VER 9.0) + set(DARWIN_tvos_BUILTIN_MIN_VER_FLAG + ${DARWIN_tvos_MIN_VER_FLAG}=${DARWIN_tvos_BUILTIN_MIN_VER}) + endif() + + set(BUILTIN_SUPPORTED_OS osx) + + # We're setting the flag manually for each target OS + set(CMAKE_OSX_DEPLOYMENT_TARGET "") + + if(NOT DARWIN_osx_ARCHS) + set(DARWIN_osx_ARCHS i386 x86_64 x86_64h) + endif() + + set(DARWIN_sim_ARCHS i386 x86_64) + set(DARWIN_device_ARCHS armv7 armv7s armv7k arm64) + + message(STATUS "OSX supported arches: ${DARWIN_osx_ARCHS}") + foreach(arch ${DARWIN_osx_ARCHS}) + list(APPEND COMPILER_RT_SUPPORTED_ARCH ${arch}) + set(CAN_TARGET_${arch} 1) + endforeach() + + # Need to build a 10.4 compatible libclang_rt + set(DARWIN_10.4_SYSROOT ${DARWIN_osx_SYSROOT}) + set(DARWIN_10.4_BUILTIN_MIN_VER 10.4) + set(DARWIN_10.4_BUILTIN_MIN_VER_FLAG + -mmacosx-version-min=${DARWIN_10.4_BUILTIN_MIN_VER}) + set(DARWIN_10.4_SKIP_CC_KEXT On) + darwin_test_archs(10.4 DARWIN_10.4_ARCHS i386 x86_64) + message(STATUS "OSX 10.4 supported builtin arches: ${DARWIN_10.4_ARCHS}") + if(DARWIN_10.4_ARCHS) + # don't include the Haswell slice in the 10.4 compatibility library + list(REMOVE_ITEM DARWIN_10.4_ARCHS x86_64h) + list(APPEND BUILTIN_SUPPORTED_OS 10.4) + endif() + + foreach(platform ${DARWIN_EMBEDDED_PLATFORMS}) + if(DARWIN_${platform}sim_SYSROOT) + set(DARWIN_${platform}sim_BUILTIN_MIN_VER + ${DARWIN_${platform}_BUILTIN_MIN_VER}) + set(DARWIN_${platform}sim_BUILTIN_MIN_VER_FLAG + ${DARWIN_${platform}_BUILTIN_MIN_VER_FLAG}) + + set(DARWIN_${platform}sim_SKIP_CC_KEXT On) + + set(test_arches ${DARWIN_sim_ARCHS}) + if(DARWIN_${platform}sim_ARCHS) + set(test_arches DARWIN_${platform}sim_ARCHS) + endif() + + darwin_test_archs(${platform}sim + DARWIN_${platform}sim_ARCHS + ${test_arches}) + message(STATUS "${platform} Simulator supported builtin arches: ${DARWIN_${platform}sim_ARCHS}") + if(DARWIN_${platform}sim_ARCHS) + list(APPEND BUILTIN_SUPPORTED_OS ${platform}sim) + endif() + foreach(arch ${DARWIN_${platform}sim_ARCHS}) + list(APPEND COMPILER_RT_SUPPORTED_ARCH ${arch}) + set(CAN_TARGET_${arch} 1) + endforeach() + endif() + + if(DARWIN_${platform}_SYSROOT) + set(test_arches ${DARWIN_device_ARCHS}) + if(DARWIN_${platform}_ARCHS) + set(test_arches DARWIN_${platform}_ARCHS) + endif() + + darwin_test_archs(${platform} + DARWIN_${platform}_ARCHS + ${test_arches}) + message(STATUS "${platform} supported builtin arches: ${DARWIN_${platform}_ARCHS}") + if(DARWIN_${platform}_ARCHS) + list(APPEND BUILTIN_SUPPORTED_OS ${platform}) + endif() + foreach(arch ${DARWIN_${platform}_ARCHS}) + list(APPEND COMPILER_RT_SUPPORTED_ARCH ${arch}) + set(CAN_TARGET_${arch} 1) + endforeach() + endif() + endforeach() + + list_intersect(BUILTIN_SUPPORTED_ARCH ALL_BUILTIN_SUPPORTED_ARCH COMPILER_RT_SUPPORTED_ARCH) + +else() + # If we're not building the builtins standalone, just rely on the tests in + # config-ix.cmake to tell us what to build. Otherwise we need to do some leg + # work here... + if(COMPILER_RT_BUILTINS_STANDALONE_BUILD) + test_targets() + endif() + # Architectures supported by compiler-rt libraries. + filter_available_targets(BUILTIN_SUPPORTED_ARCH + ${ALL_BUILTIN_SUPPORTED_ARCH}) +endif() + +message(STATUS "Builtin supported architectures: ${BUILTIN_SUPPORTED_ARCH}") diff --git a/cmake/caches/Apple.cmake b/cmake/caches/Apple.cmake new file mode 100644 index 00000000..cdee3c08 --- /dev/null +++ b/cmake/caches/Apple.cmake @@ -0,0 +1,15 @@ +# This file sets up a CMakeCache for Apple-style builds of compiler-rt. +# This configuration matches Apple uses when shipping Xcode releases. + +set(COMPILER_RT_INCLUDE_TESTS OFF CACHE BOOL "") +set(COMPILER_RT_HAS_SAFESTACK OFF CACHE BOOL "") +set(COMPILER_RT_EXTERNALIZE_DEBUGINFO ON CACHE BOOL "") +set(CMAKE_MACOSX_RPATH ON CACHE BOOL "") + +set(CMAKE_C_FLAGS_RELEASE "-O3" CACHE STRING "") +set(CMAKE_CXX_FLAGS_RELEASE "-O3" CACHE STRING "") +set(CMAKE_ASM_FLAGS_RELEASE "-O3" CACHE STRING "") +set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O3 -gline-tables-only -DNDEBUG" CACHE STRING "") +set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 -gline-tables-only -DNDEBUG" CACHE STRING "") +set(CMAKE_ASM_FLAGS_RELWITHDEBINFO "-O3 -gline-tables-only -DNDEBUG" CACHE STRING "") +set(CMAKE_BUILD_TYPE RELEASE CACHE STRING "") diff --git a/cmake/config-ix.cmake b/cmake/config-ix.cmake new file mode 100644 index 00000000..9e0c4774 --- /dev/null +++ b/cmake/config-ix.cmake @@ -0,0 +1,611 @@ +include(CMakePushCheckState) +include(CheckCCompilerFlag) +include(CheckCXXCompilerFlag) +include(CheckLibraryExists) +include(CheckSymbolExists) +include(TestBigEndian) + +function(check_linker_flag flag out_var) + cmake_push_check_state() + set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} ${flag}") + check_cxx_compiler_flag("" ${out_var}) + cmake_pop_check_state() +endfunction() + +check_library_exists(c fopen "" COMPILER_RT_HAS_LIBC) +if (NOT SANITIZER_USE_COMPILER_RT) + if (ANDROID) + check_library_exists(gcc __gcc_personality_v0 "" COMPILER_RT_HAS_GCC_LIB) + else() + check_library_exists(gcc_s __gcc_personality_v0 "" COMPILER_RT_HAS_GCC_S_LIB) + endif() +endif() + +check_c_compiler_flag(-nodefaultlibs COMPILER_RT_HAS_NODEFAULTLIBS_FLAG) +if (COMPILER_RT_HAS_NODEFAULTLIBS_FLAG) + set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -nodefaultlibs") + if (COMPILER_RT_HAS_LIBC) + list(APPEND CMAKE_REQUIRED_LIBRARIES c) + endif () + if (SANITIZER_USE_COMPILER_RT) + list(APPEND CMAKE_REQUIRED_FLAGS -rtlib=compiler-rt) + find_compiler_rt_library(builtins COMPILER_RT_BUILTINS_LIBRARY) + list(APPEND CMAKE_REQUIRED_LIBRARIES "${COMPILER_RT_BUILTINS_LIBRARY}") + elseif (COMPILER_RT_HAS_GCC_S_LIB) + list(APPEND CMAKE_REQUIRED_LIBRARIES gcc_s) + elseif (COMPILER_RT_HAS_GCC_LIB) + list(APPEND CMAKE_REQUIRED_LIBRARIES gcc) + endif () +endif () + +# CodeGen options. +check_cxx_compiler_flag(-fPIC COMPILER_RT_HAS_FPIC_FLAG) +check_cxx_compiler_flag(-fPIE COMPILER_RT_HAS_FPIE_FLAG) +check_cxx_compiler_flag(-fno-builtin COMPILER_RT_HAS_FNO_BUILTIN_FLAG) +check_cxx_compiler_flag(-fno-exceptions COMPILER_RT_HAS_FNO_EXCEPTIONS_FLAG) +check_cxx_compiler_flag(-fomit-frame-pointer COMPILER_RT_HAS_FOMIT_FRAME_POINTER_FLAG) +check_cxx_compiler_flag(-funwind-tables COMPILER_RT_HAS_FUNWIND_TABLES_FLAG) +check_cxx_compiler_flag(-fno-stack-protector COMPILER_RT_HAS_FNO_STACK_PROTECTOR_FLAG) +check_cxx_compiler_flag(-fno-sanitize=safe-stack COMPILER_RT_HAS_FNO_SANITIZE_SAFE_STACK_FLAG) +check_cxx_compiler_flag(-fvisibility=hidden COMPILER_RT_HAS_FVISIBILITY_HIDDEN_FLAG) +check_cxx_compiler_flag(-frtti COMPILER_RT_HAS_FRTTI_FLAG) +check_cxx_compiler_flag(-fno-rtti COMPILER_RT_HAS_FNO_RTTI_FLAG) +check_cxx_compiler_flag(-ffreestanding COMPILER_RT_HAS_FFREESTANDING_FLAG) +check_cxx_compiler_flag("-Werror -fno-function-sections" COMPILER_RT_HAS_FNO_FUNCTION_SECTIONS_FLAG) +check_cxx_compiler_flag(-std=c++11 COMPILER_RT_HAS_STD_CXX11_FLAG) +check_cxx_compiler_flag(-ftls-model=initial-exec COMPILER_RT_HAS_FTLS_MODEL_INITIAL_EXEC) +check_cxx_compiler_flag(-fno-lto COMPILER_RT_HAS_FNO_LTO_FLAG) +check_cxx_compiler_flag("-Werror -msse3" COMPILER_RT_HAS_MSSE3_FLAG) +check_cxx_compiler_flag("-Werror -msse4.2" COMPILER_RT_HAS_MSSE4_2_FLAG) +check_cxx_compiler_flag(--sysroot=. COMPILER_RT_HAS_SYSROOT_FLAG) +check_cxx_compiler_flag("-Werror -mcrc" COMPILER_RT_HAS_MCRC_FLAG) + +if(NOT WIN32 AND NOT CYGWIN) + # MinGW warns if -fvisibility-inlines-hidden is used. + check_cxx_compiler_flag("-fvisibility-inlines-hidden" COMPILER_RT_HAS_FVISIBILITY_INLINES_HIDDEN_FLAG) +endif() + +check_cxx_compiler_flag(/GR COMPILER_RT_HAS_GR_FLAG) +check_cxx_compiler_flag(/GS COMPILER_RT_HAS_GS_FLAG) +check_cxx_compiler_flag(/MT COMPILER_RT_HAS_MT_FLAG) +check_cxx_compiler_flag(/Oy COMPILER_RT_HAS_Oy_FLAG) + +# Debug info flags. +check_cxx_compiler_flag(-gline-tables-only COMPILER_RT_HAS_GLINE_TABLES_ONLY_FLAG) +check_cxx_compiler_flag(-g COMPILER_RT_HAS_G_FLAG) +check_cxx_compiler_flag(/Zi COMPILER_RT_HAS_Zi_FLAG) + +# Warnings. +check_cxx_compiler_flag(-Wall COMPILER_RT_HAS_WALL_FLAG) +check_cxx_compiler_flag(-Werror COMPILER_RT_HAS_WERROR_FLAG) +check_cxx_compiler_flag("-Werror -Wframe-larger-than=512" COMPILER_RT_HAS_WFRAME_LARGER_THAN_FLAG) +check_cxx_compiler_flag("-Werror -Wglobal-constructors" COMPILER_RT_HAS_WGLOBAL_CONSTRUCTORS_FLAG) +check_cxx_compiler_flag("-Werror -Wc99-extensions" COMPILER_RT_HAS_WC99_EXTENSIONS_FLAG) +check_cxx_compiler_flag("-Werror -Wgnu" COMPILER_RT_HAS_WGNU_FLAG) +check_cxx_compiler_flag("-Werror -Wnon-virtual-dtor" COMPILER_RT_HAS_WNON_VIRTUAL_DTOR_FLAG) +check_cxx_compiler_flag("-Werror -Wvariadic-macros" COMPILER_RT_HAS_WVARIADIC_MACROS_FLAG) +check_cxx_compiler_flag("-Werror -Wunused-parameter" COMPILER_RT_HAS_WUNUSED_PARAMETER_FLAG) +check_cxx_compiler_flag("-Werror -Wcovered-switch-default" COMPILER_RT_HAS_WCOVERED_SWITCH_DEFAULT_FLAG) + +check_cxx_compiler_flag(/W4 COMPILER_RT_HAS_W4_FLAG) +check_cxx_compiler_flag(/WX COMPILER_RT_HAS_WX_FLAG) +check_cxx_compiler_flag(/wd4146 COMPILER_RT_HAS_WD4146_FLAG) +check_cxx_compiler_flag(/wd4291 COMPILER_RT_HAS_WD4291_FLAG) +check_cxx_compiler_flag(/wd4221 COMPILER_RT_HAS_WD4221_FLAG) +check_cxx_compiler_flag(/wd4391 COMPILER_RT_HAS_WD4391_FLAG) +check_cxx_compiler_flag(/wd4722 COMPILER_RT_HAS_WD4722_FLAG) +check_cxx_compiler_flag(/wd4800 COMPILER_RT_HAS_WD4800_FLAG) + +# Symbols. +check_symbol_exists(__func__ "" COMPILER_RT_HAS_FUNC_SYMBOL) + +# Libraries. +check_library_exists(dl dlopen "" COMPILER_RT_HAS_LIBDL) +check_library_exists(rt shm_open "" COMPILER_RT_HAS_LIBRT) +check_library_exists(m pow "" COMPILER_RT_HAS_LIBM) +check_library_exists(pthread pthread_create "" COMPILER_RT_HAS_LIBPTHREAD) +if (ANDROID AND COMPILER_RT_HAS_LIBDL) + # Android's libstdc++ has a dependency on libdl. + list(APPEND CMAKE_REQUIRED_LIBRARIES dl) +endif() +check_library_exists(stdc++ __cxa_throw "" COMPILER_RT_HAS_LIBSTDCXX) + +# Linker flags. +if(ANDROID) + check_linker_flag("-Wl,-z,global" COMPILER_RT_HAS_Z_GLOBAL) + check_library_exists(log __android_log_write "" COMPILER_RT_HAS_LIBLOG) +endif() + +# Architectures. + +# List of all architectures we can target. +set(COMPILER_RT_SUPPORTED_ARCH) + +# Try to compile a very simple source file to ensure we can target the given +# platform. We use the results of these tests to build only the various target +# runtime libraries supported by our current compilers cross-compiling +# abilities. +set(SIMPLE_SOURCE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/simple.cc) +file(WRITE ${SIMPLE_SOURCE} "#include \n#include \nint main() { printf(\"hello, world\"); }\n") + +# Detect whether the current target platform is 32-bit or 64-bit, and setup +# the correct commandline flags needed to attempt to target 32-bit and 64-bit. +if (NOT CMAKE_SIZEOF_VOID_P EQUAL 4 AND + NOT CMAKE_SIZEOF_VOID_P EQUAL 8) + message(FATAL_ERROR "Please use architecture with 4 or 8 byte pointers.") +endif() + +test_targets() + +# Returns a list of architecture specific target cflags in @out_var list. +function(get_target_flags_for_arch arch out_var) + list(FIND COMPILER_RT_SUPPORTED_ARCH ${arch} ARCH_INDEX) + if(ARCH_INDEX EQUAL -1) + message(FATAL_ERROR "Unsupported architecture: ${arch}") + else() + if (NOT APPLE) + set(${out_var} ${TARGET_${arch}_CFLAGS} PARENT_SCOPE) + else() + # This is only called in constructing cflags for tests executing on the + # host. This will need to all be cleaned up to support building tests + # for cross-targeted hardware (i.e. iOS). + set(${out_var} -arch ${arch} PARENT_SCOPE) + endif() + endif() +endfunction() + +# Returns a compiler and CFLAGS that should be used to run tests for the +# specific architecture. When cross-compiling, this is controled via +# COMPILER_RT_TEST_COMPILER and COMPILER_RT_TEST_COMPILER_CFLAGS. +macro(get_test_cc_for_arch arch cc_out cflags_out) + if(ANDROID OR ${arch} MATCHES "arm|aarch64") + # This is only true if we are cross-compiling. + # Build all tests with host compiler and use host tools. + set(${cc_out} ${COMPILER_RT_TEST_COMPILER}) + set(${cflags_out} ${COMPILER_RT_TEST_COMPILER_CFLAGS}) + else() + get_target_flags_for_arch(${arch} ${cflags_out}) + if(APPLE) + list(APPEND ${cflags_out} ${DARWIN_osx_CFLAGS}) + endif() + string(REPLACE ";" " " ${cflags_out} "${${cflags_out}}") + endif() +endmacro() + +set(ARM64 aarch64) +set(ARM32 arm armhf) +set(X86 i386) +set(X86_64 x86_64) +set(MIPS32 mips mipsel) +set(MIPS64 mips64 mips64el) +set(PPC64 powerpc64 powerpc64le) +set(S390X s390x) +set(WASM32 wasm32) +set(WASM64 wasm64) + +if(APPLE) + set(ARM64 arm64) + set(ARM32 armv7 armv7s armv7k) + set(X86_64 x86_64 x86_64h) +endif() + +set(ALL_SANITIZER_COMMON_SUPPORTED_ARCH ${X86} ${X86_64} ${PPC64} + ${ARM32} ${ARM64} ${MIPS32} ${MIPS64} ${S390X}) +set(ALL_ASAN_SUPPORTED_ARCH ${X86} ${X86_64} ${ARM32} ${ARM64} + ${MIPS32} ${MIPS64} ${PPC64} ${S390X}) +set(ALL_DFSAN_SUPPORTED_ARCH ${X86_64} ${MIPS64} ${ARM64}) +set(ALL_FUZZER_SUPPORTED_ARCH x86_64) + +if(APPLE) + set(ALL_LSAN_SUPPORTED_ARCH ${X86} ${X86_64} ${MIPS64} ${ARM64}) +else() + set(ALL_LSAN_SUPPORTED_ARCH ${X86} ${X86_64} ${MIPS64} ${ARM64} ${ARM32} ${PPC64}) +endif() +set(ALL_MSAN_SUPPORTED_ARCH ${X86_64} ${MIPS64} ${ARM64} ${PPC64}) +set(ALL_HWASAN_SUPPORTED_ARCH ${ARM64}) +set(ALL_PROFILE_SUPPORTED_ARCH ${X86} ${X86_64} ${ARM32} ${ARM64} ${PPC64} + ${MIPS32} ${MIPS64} ${S390X}) +set(ALL_TSAN_SUPPORTED_ARCH ${X86_64} ${MIPS64} ${ARM64} ${PPC64}) +set(ALL_UBSAN_SUPPORTED_ARCH ${X86} ${X86_64} ${ARM32} ${ARM64} + ${MIPS32} ${MIPS64} ${PPC64} ${S390X}) +set(ALL_SAFESTACK_SUPPORTED_ARCH ${X86} ${X86_64} ${ARM64} ${MIPS32} ${MIPS64}) +set(ALL_CFI_SUPPORTED_ARCH ${X86} ${X86_64} ${ARM32} ${ARM64} ${MIPS64}) +set(ALL_ESAN_SUPPORTED_ARCH ${X86_64} ${MIPS64}) +set(ALL_SCUDO_SUPPORTED_ARCH ${X86} ${X86_64} ${ARM32} ${ARM64} ${MIPS32} ${MIPS64}) +if(APPLE) +set(ALL_XRAY_SUPPORTED_ARCH ${X86_64}) +else() +set(ALL_XRAY_SUPPORTED_ARCH ${X86_64} ${ARM32} ${ARM64} ${MIPS32} ${MIPS64} powerpc64le) +endif() + +if(APPLE) + include(CompilerRTDarwinUtils) + + find_darwin_sdk_dir(DARWIN_osx_SYSROOT macosx) + find_darwin_sdk_dir(DARWIN_iossim_SYSROOT iphonesimulator) + find_darwin_sdk_dir(DARWIN_ios_SYSROOT iphoneos) + find_darwin_sdk_dir(DARWIN_watchossim_SYSROOT watchsimulator) + find_darwin_sdk_dir(DARWIN_watchos_SYSROOT watchos) + find_darwin_sdk_dir(DARWIN_tvossim_SYSROOT appletvsimulator) + find_darwin_sdk_dir(DARWIN_tvos_SYSROOT appletvos) + + if(NOT DARWIN_osx_SYSROOT) + if(EXISTS /usr/include) + set(DARWIN_osx_SYSROOT /) + else() + message(ERROR "Could not detect OS X Sysroot. Either install Xcode or the Apple Command Line Tools") + endif() + endif() + + if(COMPILER_RT_ENABLE_IOS) + list(APPEND DARWIN_EMBEDDED_PLATFORMS ios) + set(DARWIN_ios_MIN_VER_FLAG -miphoneos-version-min) + set(DARWIN_ios_SANITIZER_MIN_VER_FLAG + ${DARWIN_ios_MIN_VER_FLAG}=8.0) + endif() + if(COMPILER_RT_ENABLE_WATCHOS) + list(APPEND DARWIN_EMBEDDED_PLATFORMS watchos) + set(DARWIN_watchos_MIN_VER_FLAG -mwatchos-version-min) + set(DARWIN_watchos_SANITIZER_MIN_VER_FLAG + ${DARWIN_watchos_MIN_VER_FLAG}=2.0) + endif() + if(COMPILER_RT_ENABLE_TVOS) + list(APPEND DARWIN_EMBEDDED_PLATFORMS tvos) + set(DARWIN_tvos_MIN_VER_FLAG -mtvos-version-min) + set(DARWIN_tvos_SANITIZER_MIN_VER_FLAG + ${DARWIN_tvos_MIN_VER_FLAG}=9.0) + endif() + + # Note: In order to target x86_64h on OS X the minimum deployment target must + # be 10.8 or higher. + set(SANITIZER_COMMON_SUPPORTED_OS osx) + set(PROFILE_SUPPORTED_OS osx) + set(TSAN_SUPPORTED_OS osx) + set(XRAY_SUPPORTED_OS osx) + if(NOT SANITIZER_MIN_OSX_VERSION) + string(REGEX MATCH "-mmacosx-version-min=([.0-9]+)" + MACOSX_VERSION_MIN_FLAG "${CMAKE_CXX_FLAGS}") + if(MACOSX_VERSION_MIN_FLAG) + set(SANITIZER_MIN_OSX_VERSION "${CMAKE_MATCH_1}") + elseif(CMAKE_OSX_DEPLOYMENT_TARGET) + set(SANITIZER_MIN_OSX_VERSION ${CMAKE_OSX_DEPLOYMENT_TARGET}) + else() + set(SANITIZER_MIN_OSX_VERSION 10.9) + endif() + if(SANITIZER_MIN_OSX_VERSION VERSION_LESS "10.7") + message(FATAL_ERROR "macOS deployment target '${SANITIZER_MIN_OSX_VERSION}' is too old.") + endif() + if(SANITIZER_MIN_OSX_VERSION VERSION_GREATER "10.9") + message(WARNING "macOS deployment target '${SANITIZER_MIN_OSX_VERSION}' is too new, setting to '10.9' instead.") + set(SANITIZER_MIN_OSX_VERSION 10.9) + endif() + endif() + + # We're setting the flag manually for each target OS + set(CMAKE_OSX_DEPLOYMENT_TARGET "") + + set(DARWIN_COMMON_CFLAGS -stdlib=libc++) + set(DARWIN_COMMON_LINK_FLAGS + -stdlib=libc++ + -lc++ + -lc++abi) + + check_linker_flag("-fapplication-extension" COMPILER_RT_HAS_APP_EXTENSION) + if(COMPILER_RT_HAS_APP_EXTENSION) + list(APPEND DARWIN_COMMON_LINK_FLAGS "-fapplication-extension") + endif() + + set(DARWIN_osx_CFLAGS + ${DARWIN_COMMON_CFLAGS} + -mmacosx-version-min=${SANITIZER_MIN_OSX_VERSION}) + set(DARWIN_osx_LINK_FLAGS + ${DARWIN_COMMON_LINK_FLAGS} + -mmacosx-version-min=${SANITIZER_MIN_OSX_VERSION}) + + if(DARWIN_osx_SYSROOT) + list(APPEND DARWIN_osx_CFLAGS -isysroot ${DARWIN_osx_SYSROOT}) + list(APPEND DARWIN_osx_LINK_FLAGS -isysroot ${DARWIN_osx_SYSROOT}) + endif() + + # Figure out which arches to use for each OS + darwin_get_toolchain_supported_archs(toolchain_arches) + message(STATUS "Toolchain supported arches: ${toolchain_arches}") + + if(NOT MACOSX_VERSION_MIN_FLAG) + darwin_test_archs(osx + DARWIN_osx_ARCHS + ${toolchain_arches}) + message(STATUS "OSX supported arches: ${DARWIN_osx_ARCHS}") + foreach(arch ${DARWIN_osx_ARCHS}) + list(APPEND COMPILER_RT_SUPPORTED_ARCH ${arch}) + set(CAN_TARGET_${arch} 1) + endforeach() + + foreach(platform ${DARWIN_EMBEDDED_PLATFORMS}) + if(DARWIN_${platform}sim_SYSROOT) + set(DARWIN_${platform}sim_CFLAGS + ${DARWIN_COMMON_CFLAGS} + ${DARWIN_${platform}_SANITIZER_MIN_VER_FLAG} + -isysroot ${DARWIN_${platform}sim_SYSROOT}) + set(DARWIN_${platform}sim_LINK_FLAGS + ${DARWIN_COMMON_LINK_FLAGS} + ${DARWIN_${platform}_SANITIZER_MIN_VER_FLAG} + -isysroot ${DARWIN_${platform}sim_SYSROOT}) + + set(DARWIN_${platform}sim_SKIP_CC_KEXT On) + darwin_test_archs(${platform}sim + DARWIN_${platform}sim_ARCHS + ${toolchain_arches}) + message(STATUS "${platform} Simulator supported arches: ${DARWIN_${platform}sim_ARCHS}") + if(DARWIN_${platform}sim_ARCHS) + list(APPEND SANITIZER_COMMON_SUPPORTED_OS ${platform}sim) + list(APPEND PROFILE_SUPPORTED_OS ${platform}sim) + list(APPEND TSAN_SUPPORTED_OS ${platform}sim) + endif() + foreach(arch ${DARWIN_${platform}sim_ARCHS}) + list(APPEND COMPILER_RT_SUPPORTED_ARCH ${arch}) + set(CAN_TARGET_${arch} 1) + endforeach() + endif() + + if(DARWIN_${platform}_SYSROOT) + set(DARWIN_${platform}_CFLAGS + ${DARWIN_COMMON_CFLAGS} + ${DARWIN_${platform}_SANITIZER_MIN_VER_FLAG} + -isysroot ${DARWIN_${platform}_SYSROOT}) + set(DARWIN_${platform}_LINK_FLAGS + ${DARWIN_COMMON_LINK_FLAGS} + ${DARWIN_${platform}_SANITIZER_MIN_VER_FLAG} + -isysroot ${DARWIN_${platform}_SYSROOT}) + + darwin_test_archs(${platform} + DARWIN_${platform}_ARCHS + ${toolchain_arches}) + message(STATUS "${platform} supported arches: ${DARWIN_${platform}_ARCHS}") + if(DARWIN_${platform}_ARCHS) + list(APPEND SANITIZER_COMMON_SUPPORTED_OS ${platform}) + list(APPEND PROFILE_SUPPORTED_OS ${platform}) + list(APPEND TSAN_SUPPORTED_OS ${platform}) + endif() + foreach(arch ${DARWIN_${platform}_ARCHS}) + list(APPEND COMPILER_RT_SUPPORTED_ARCH ${arch}) + set(CAN_TARGET_${arch} 1) + endforeach() + endif() + endforeach() + endif() + + # for list_intersect + include(CompilerRTUtils) + + + list_intersect(SANITIZER_COMMON_SUPPORTED_ARCH + ALL_SANITIZER_COMMON_SUPPORTED_ARCH + COMPILER_RT_SUPPORTED_ARCH + ) + set(LSAN_COMMON_SUPPORTED_ARCH ${SANITIZER_COMMON_SUPPORTED_ARCH}) + set(UBSAN_COMMON_SUPPORTED_ARCH ${SANITIZER_COMMON_SUPPORTED_ARCH}) + list_intersect(ASAN_SUPPORTED_ARCH + ALL_ASAN_SUPPORTED_ARCH + SANITIZER_COMMON_SUPPORTED_ARCH) + list_intersect(DFSAN_SUPPORTED_ARCH + ALL_DFSAN_SUPPORTED_ARCH + SANITIZER_COMMON_SUPPORTED_ARCH) + list_intersect(LSAN_SUPPORTED_ARCH + ALL_LSAN_SUPPORTED_ARCH + SANITIZER_COMMON_SUPPORTED_ARCH) + list_intersect(MSAN_SUPPORTED_ARCH + ALL_MSAN_SUPPORTED_ARCH + SANITIZER_COMMON_SUPPORTED_ARCH) + list_intersect(HWASAN_SUPPORTED_ARCH + ALL_HWASAN_SUPPORTED_ARCH + SANITIZER_COMMON_SUPPORTED_ARCH) + list_intersect(PROFILE_SUPPORTED_ARCH + ALL_PROFILE_SUPPORTED_ARCH + SANITIZER_COMMON_SUPPORTED_ARCH) + list_intersect(TSAN_SUPPORTED_ARCH + ALL_TSAN_SUPPORTED_ARCH + SANITIZER_COMMON_SUPPORTED_ARCH) + list_intersect(UBSAN_SUPPORTED_ARCH + ALL_UBSAN_SUPPORTED_ARCH + SANITIZER_COMMON_SUPPORTED_ARCH) + list_intersect(SAFESTACK_SUPPORTED_ARCH + ALL_SAFESTACK_SUPPORTED_ARCH + SANITIZER_COMMON_SUPPORTED_ARCH) + list_intersect(CFI_SUPPORTED_ARCH + ALL_CFI_SUPPORTED_ARCH + SANITIZER_COMMON_SUPPORTED_ARCH) + list_intersect(ESAN_SUPPORTED_ARCH + ALL_ESAN_SUPPORTED_ARCH + SANITIZER_COMMON_SUPPORTED_ARCH) + list_intersect(SCUDO_SUPPORTED_ARCH + ALL_SCUDO_SUPPORTED_ARCH + SANITIZER_COMMON_SUPPORTED_ARCH) + list_intersect(FUZZER_SUPPORTED_ARCH + ALL_FUZZER_SUPPORTED_ARCH + ALL_SANITIZER_COMMON_SUPPORTED_ARCH) + list_intersect(XRAY_SUPPORTED_ARCH + ALL_XRAY_SUPPORTED_ARCH + SANITIZER_COMMON_SUPPORTED_ARCH) + +else() + # Architectures supported by compiler-rt libraries. + filter_available_targets(SANITIZER_COMMON_SUPPORTED_ARCH + ${ALL_SANITIZER_COMMON_SUPPORTED_ARCH}) + # LSan and UBSan common files should be available on all architectures + # supported by other sanitizers (even if they build into dummy object files). + filter_available_targets(LSAN_COMMON_SUPPORTED_ARCH + ${SANITIZER_COMMON_SUPPORTED_ARCH}) + filter_available_targets(UBSAN_COMMON_SUPPORTED_ARCH + ${SANITIZER_COMMON_SUPPORTED_ARCH}) + filter_available_targets(ASAN_SUPPORTED_ARCH ${ALL_ASAN_SUPPORTED_ARCH}) + filter_available_targets(FUZZER_SUPPORTED_ARCH ${ALL_FUZZER_SUPPORTED_ARCH}) + filter_available_targets(DFSAN_SUPPORTED_ARCH ${ALL_DFSAN_SUPPORTED_ARCH}) + filter_available_targets(LSAN_SUPPORTED_ARCH ${ALL_LSAN_SUPPORTED_ARCH}) + filter_available_targets(MSAN_SUPPORTED_ARCH ${ALL_MSAN_SUPPORTED_ARCH}) + filter_available_targets(HWASAN_SUPPORTED_ARCH ${ALL_HWASAN_SUPPORTED_ARCH}) + filter_available_targets(PROFILE_SUPPORTED_ARCH ${ALL_PROFILE_SUPPORTED_ARCH}) + filter_available_targets(TSAN_SUPPORTED_ARCH ${ALL_TSAN_SUPPORTED_ARCH}) + filter_available_targets(UBSAN_SUPPORTED_ARCH ${ALL_UBSAN_SUPPORTED_ARCH}) + filter_available_targets(SAFESTACK_SUPPORTED_ARCH + ${ALL_SAFESTACK_SUPPORTED_ARCH}) + filter_available_targets(CFI_SUPPORTED_ARCH ${ALL_CFI_SUPPORTED_ARCH}) + filter_available_targets(ESAN_SUPPORTED_ARCH ${ALL_ESAN_SUPPORTED_ARCH}) + filter_available_targets(SCUDO_SUPPORTED_ARCH ${ALL_SCUDO_SUPPORTED_ARCH}) + filter_available_targets(XRAY_SUPPORTED_ARCH ${ALL_XRAY_SUPPORTED_ARCH}) +endif() + +if (MSVC) + # See if the DIA SDK is available and usable. + set(MSVC_DIA_SDK_DIR "$ENV{VSINSTALLDIR}DIA SDK") + if (IS_DIRECTORY ${MSVC_DIA_SDK_DIR}) + set(CAN_SYMBOLIZE 1) + else() + set(CAN_SYMBOLIZE 0) + endif() +else() + set(CAN_SYMBOLIZE 1) +endif() + +find_program(GOLD_EXECUTABLE NAMES ${LLVM_DEFAULT_TARGET_TRIPLE}-ld.gold ld.gold ${LLVM_DEFAULT_TARGET_TRIPLE}-ld ld DOC "The gold linker") + +if(COMPILER_RT_SUPPORTED_ARCH) + list(REMOVE_DUPLICATES COMPILER_RT_SUPPORTED_ARCH) +endif() +message(STATUS "Compiler-RT supported architectures: ${COMPILER_RT_SUPPORTED_ARCH}") + +if(ANDROID) + set(OS_NAME "Android") +else() + set(OS_NAME "${CMAKE_SYSTEM_NAME}") +endif() + +set(ALL_SANITIZERS asan;dfsan;msan;hwasan;tsan;safestack;cfi;esan;scudo;ubsan_minimal) +set(COMPILER_RT_SANITIZERS_TO_BUILD all CACHE STRING + "sanitizers to build if supported on the target (all;${ALL_SANITIZERS})") +list_replace(COMPILER_RT_SANITIZERS_TO_BUILD all "${ALL_SANITIZERS}") + +if (SANITIZER_COMMON_SUPPORTED_ARCH AND NOT LLVM_USE_SANITIZER AND + (OS_NAME MATCHES "Android|Darwin|Linux|FreeBSD|NetBSD|Fuchsia|SunOS" OR + (OS_NAME MATCHES "Windows" AND (NOT MINGW AND NOT CYGWIN)))) + set(COMPILER_RT_HAS_SANITIZER_COMMON TRUE) +else() + set(COMPILER_RT_HAS_SANITIZER_COMMON FALSE) +endif() + +if (COMPILER_RT_HAS_SANITIZER_COMMON) + set(COMPILER_RT_HAS_INTERCEPTION TRUE) +else() + set(COMPILER_RT_HAS_INTERCEPTION FALSE) +endif() + +if (COMPILER_RT_HAS_SANITIZER_COMMON AND ASAN_SUPPORTED_ARCH) + set(COMPILER_RT_HAS_ASAN TRUE) +else() + set(COMPILER_RT_HAS_ASAN FALSE) +endif() + +if (OS_NAME MATCHES "Linux|FreeBSD|Windows|NetBSD|SunOS") + set(COMPILER_RT_ASAN_HAS_STATIC_RUNTIME TRUE) +else() + set(COMPILER_RT_ASAN_HAS_STATIC_RUNTIME FALSE) +endif() + +# TODO: Add builtins support. + +if (COMPILER_RT_HAS_SANITIZER_COMMON AND DFSAN_SUPPORTED_ARCH AND + OS_NAME MATCHES "Linux") + set(COMPILER_RT_HAS_DFSAN TRUE) +else() + set(COMPILER_RT_HAS_DFSAN FALSE) +endif() + +if (COMPILER_RT_HAS_SANITIZER_COMMON AND LSAN_SUPPORTED_ARCH AND + OS_NAME MATCHES "Darwin|Linux|FreeBSD|NetBSD") + set(COMPILER_RT_HAS_LSAN TRUE) +else() + set(COMPILER_RT_HAS_LSAN FALSE) +endif() + +if (COMPILER_RT_HAS_SANITIZER_COMMON AND MSAN_SUPPORTED_ARCH AND + OS_NAME MATCHES "Linux|NetBSD") + set(COMPILER_RT_HAS_MSAN TRUE) +else() + set(COMPILER_RT_HAS_MSAN FALSE) +endif() + +if (COMPILER_RT_HAS_SANITIZER_COMMON AND HWASAN_SUPPORTED_ARCH AND + OS_NAME MATCHES "Linux|Android") + set(COMPILER_RT_HAS_HWASAN TRUE) +else() + set(COMPILER_RT_HAS_HWASAN FALSE) +endif() + +if (PROFILE_SUPPORTED_ARCH AND NOT LLVM_USE_SANITIZER AND + OS_NAME MATCHES "Darwin|Linux|FreeBSD|Windows|Android|SunOS") + set(COMPILER_RT_HAS_PROFILE TRUE) +else() + set(COMPILER_RT_HAS_PROFILE FALSE) +endif() + +if (COMPILER_RT_HAS_SANITIZER_COMMON AND TSAN_SUPPORTED_ARCH AND + OS_NAME MATCHES "Darwin|Linux|FreeBSD|Android|NetBSD") + set(COMPILER_RT_HAS_TSAN TRUE) +else() + set(COMPILER_RT_HAS_TSAN FALSE) +endif() + +if (COMPILER_RT_HAS_SANITIZER_COMMON AND UBSAN_SUPPORTED_ARCH AND + OS_NAME MATCHES "Darwin|Linux|FreeBSD|NetBSD|Windows|Android|Fuchsia|SunOS") + set(COMPILER_RT_HAS_UBSAN TRUE) +else() + set(COMPILER_RT_HAS_UBSAN FALSE) +endif() + +if (COMPILER_RT_HAS_SANITIZER_COMMON AND UBSAN_SUPPORTED_ARCH AND + OS_NAME MATCHES "Linux|FreeBSD|NetBSD|Android|Darwin") + set(COMPILER_RT_HAS_UBSAN_MINIMAL TRUE) +else() + set(COMPILER_RT_HAS_UBSAN_MINIMAL FALSE) +endif() + +if (COMPILER_RT_HAS_SANITIZER_COMMON AND SAFESTACK_SUPPORTED_ARCH AND + OS_NAME MATCHES "Darwin|Linux|FreeBSD|NetBSD") + set(COMPILER_RT_HAS_SAFESTACK TRUE) +else() + set(COMPILER_RT_HAS_SAFESTACK FALSE) +endif() + +if (COMPILER_RT_HAS_SANITIZER_COMMON AND CFI_SUPPORTED_ARCH) + set(COMPILER_RT_HAS_CFI TRUE) +else() + set(COMPILER_RT_HAS_CFI FALSE) +endif() + +if (COMPILER_RT_HAS_SANITIZER_COMMON AND ESAN_SUPPORTED_ARCH AND + OS_NAME MATCHES "Linux") + set(COMPILER_RT_HAS_ESAN TRUE) +else() + set(COMPILER_RT_HAS_ESAN FALSE) +endif() + +if (COMPILER_RT_HAS_SANITIZER_COMMON AND SCUDO_SUPPORTED_ARCH AND + OS_NAME MATCHES "Linux|Android") + set(COMPILER_RT_HAS_SCUDO TRUE) +else() + set(COMPILER_RT_HAS_SCUDO FALSE) +endif() + +if (COMPILER_RT_HAS_SANITIZER_COMMON AND XRAY_SUPPORTED_ARCH AND + OS_NAME MATCHES "Darwin|Linux") + set(COMPILER_RT_HAS_XRAY TRUE) +else() + set(COMPILER_RT_HAS_XRAY FALSE) +endif() + +if (COMPILER_RT_HAS_SANITIZER_COMMON AND FUZZER_SUPPORTED_ARCH AND + OS_NAME MATCHES "Android|Darwin|Linux|NetBSD") + set(COMPILER_RT_HAS_FUZZER TRUE) +else() + set(COMPILER_RT_HAS_FUZZER FALSE) +endif() diff --git a/docs/TestingGuide.rst b/docs/TestingGuide.rst new file mode 100644 index 00000000..4edda673 --- /dev/null +++ b/docs/TestingGuide.rst @@ -0,0 +1,66 @@ +======================================== +Compiler-rt Testing Infrastructure Guide +======================================== + +.. contents:: + :local: + +Overview +======== + +This document is the reference manual for the compiler-rt modifications to the +testing infrastructure. Documentation for the infrastructure itself can be found at +:ref:`llvm_testing_guide`. + +LLVM testing infrastructure organization +======================================== + +The compiler-rt testing infrastructure contains regression tests which are run +as part of the usual ``make check-all`` and are expected to always pass -- they +should be run before every commit. + +Quick start +=========== + +The regressions tests are in the "compiler-rt" module and are normally checked +out in the directory ``llvm/projects/compiler-rt/test``. Use ``make check-all`` +to run the regression tests after building compiler-rt. + +REQUIRES, XFAIL, etc. +--------------------- + +Sometimes it is necessary to restrict a test to a specific target or mark it as +an "expected fail" or XFAIL. This is normally achieved using ``REQUIRES:`` or +``XFAIL:`` with a substring of LLVM's default target triple. Unfortunately, the +behaviour of this is somewhat quirky in compiler-rt. There are two main +pitfalls to avoid. + +The first pitfall is that these directives perform a substring match on the +triple and as such ``XFAIL: mips`` affects more triples than expected. For +example, ``mips-linux-gnu``, ``mipsel-linux-gnu``, ``mips64-linux-gnu``, and +``mips64el-linux-gnu`` will all match a ``XFAIL: mips`` directive. Including a +trailing ``-`` such as in ``XFAIL: mips-`` can help to mitigate this quirk but +even that has issues as described below. + +The second pitfall is that the default target triple is often inappropriate for +compiler-rt tests since compiler-rt tests may be compiled for multiple targets. +For example, a typical build on an ``x86_64-linux-gnu`` host will often run the +tests for both x86_64 and i386. In this situation ``XFAIL: x86_64`` will mark +both the x86_64 and i386 tests as an expected failure while ``XFAIL: i386`` +will have no effect at all. + +To remedy both pitfalls, compiler-rt tests provide a feature string which can +be used to specify a single target. This string is of the form +``target-is-${arch}`` where ``${arch}}`` is one of the values from the +following lines of the CMake output:: + + -- Compiler-RT supported architectures: x86_64;i386 + -- Builtin supported architectures: i386;x86_64 + +So for example ``XFAIL: target-is-x86_64`` will mark a test as expected to fail +on x86_64 without also affecting the i386 test and ``XFAIL: target-is-i386`` +will mark a test as expected to fail on i386 even if the default target triple +is ``x86_64-linux-gnu``. Directives that use these ``target-is-${arch}`` string +require exact matches so ``XFAIL: target-is-mips``, +``XFAIL: target-is-mipsel``, ``XFAIL: target-is-mips64``, and +``XFAIL: target-is-mips64el`` all refer to different MIPS targets. diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt new file mode 100644 index 00000000..f7efb102 --- /dev/null +++ b/include/CMakeLists.txt @@ -0,0 +1,71 @@ +if (COMPILER_RT_BUILD_SANITIZERS) + set(SANITIZER_HEADERS + sanitizer/allocator_interface.h + sanitizer/asan_interface.h + sanitizer/common_interface_defs.h + sanitizer/coverage_interface.h + sanitizer/dfsan_interface.h + sanitizer/esan_interface.h + sanitizer/hwasan_interface.h + sanitizer/linux_syscall_hooks.h + sanitizer/lsan_interface.h + sanitizer/msan_interface.h + sanitizer/scudo_interface.h + sanitizer/tsan_interface.h + sanitizer/tsan_interface_atomic.h) +endif(COMPILER_RT_BUILD_SANITIZERS) + +if (COMPILER_RT_BUILD_XRAY) + set(XRAY_HEADERS + xray/xray_interface.h + xray/xray_log_interface.h) +endif(COMPILER_RT_BUILD_XRAY) + +set(COMPILER_RT_HEADERS + ${SANITIZER_HEADERS} + ${XRAY_HEADERS}) + +set(output_dir ${COMPILER_RT_OUTPUT_DIR}/include) + +# Copy compiler-rt headers to the build tree. +set(out_files) +foreach( f ${COMPILER_RT_HEADERS} ) + set( src ${CMAKE_CURRENT_SOURCE_DIR}/${f} ) + set( dst ${output_dir}/${f} ) + add_custom_command(OUTPUT ${dst} + DEPENDS ${src} + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src} ${dst} + COMMENT "Copying compiler-rt's ${f}...") + list(APPEND out_files ${dst}) +endforeach( f ) + +add_custom_target(compiler-rt-headers ALL DEPENDS ${out_files}) +add_dependencies(compiler-rt compiler-rt-headers) +set_target_properties(compiler-rt-headers PROPERTIES FOLDER "Compiler-RT Misc") + +# Install sanitizer headers. +install(FILES ${SANITIZER_HEADERS} + COMPONENT compiler-rt-headers + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ + DESTINATION ${COMPILER_RT_INSTALL_PATH}/include/sanitizer) +# Install xray headers. +install(FILES ${XRAY_HEADERS} + COMPONENT compiler-rt-headers + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ + DESTINATION ${COMPILER_RT_INSTALL_PATH}/include/xray) + +if (NOT CMAKE_CONFIGURATION_TYPES) # don't add this for IDEs. + add_custom_target(install-compiler-rt-headers + DEPENDS compiler-rt-headers + COMMAND "${CMAKE_COMMAND}" + -DCMAKE_INSTALL_COMPONENT="compiler-rt-headers" + -P "${CMAKE_BINARY_DIR}/cmake_install.cmake" + USES_TERMINAL) + add_custom_target(install-compiler-rt-headers-stripped + DEPENDS compiler-rt-headers + COMMAND "${CMAKE_COMMAND}" + -DCMAKE_INSTALL_COMPONENT="compiler-rt-headers" + -DCMAKE_INSTALL_DO_STRIP=1 + -P "${CMAKE_BINARY_DIR}/cmake_install.cmake" + USES_TERMINAL) +endif() diff --git a/include/sanitizer/allocator_interface.h b/include/sanitizer/allocator_interface.h new file mode 100644 index 00000000..89f32830 --- /dev/null +++ b/include/sanitizer/allocator_interface.h @@ -0,0 +1,90 @@ +//===-- allocator_interface.h ---------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// Public interface header for allocator used in sanitizers (ASan/TSan/MSan). +//===----------------------------------------------------------------------===// +#ifndef SANITIZER_ALLOCATOR_INTERFACE_H +#define SANITIZER_ALLOCATOR_INTERFACE_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + /* Returns the estimated number of bytes that will be reserved by allocator + for request of "size" bytes. If allocator can't allocate that much + memory, returns the maximal possible allocation size, otherwise returns + "size". */ + size_t __sanitizer_get_estimated_allocated_size(size_t size); + + /* Returns true if p was returned by the allocator and + is not yet freed. */ + int __sanitizer_get_ownership(const volatile void *p); + + /* Returns the number of bytes reserved for the pointer p. + Requires (get_ownership(p) == true) or (p == 0). */ + size_t __sanitizer_get_allocated_size(const volatile void *p); + + /* Number of bytes, allocated and not yet freed by the application. */ + size_t __sanitizer_get_current_allocated_bytes(void); + + /* Number of bytes, mmaped by the allocator to fulfill allocation requests. + Generally, for request of X bytes, allocator can reserve and add to free + lists a large number of chunks of size X to use them for future requests. + All these chunks count toward the heap size. Currently, allocator never + releases memory to OS (instead, it just puts freed chunks to free + lists). */ + size_t __sanitizer_get_heap_size(void); + + /* Number of bytes, mmaped by the allocator, which can be used to fulfill + allocation requests. When a user program frees memory chunk, it can first + fall into quarantine and will count toward __sanitizer_get_free_bytes() + later. */ + size_t __sanitizer_get_free_bytes(void); + + /* Number of bytes in unmapped pages, that are released to OS. Currently, + always returns 0. */ + size_t __sanitizer_get_unmapped_bytes(void); + + /* Malloc hooks that may be optionally provided by user. + __sanitizer_malloc_hook(ptr, size) is called immediately after + allocation of "size" bytes, which returned "ptr". + __sanitizer_free_hook(ptr) is called immediately before + deallocation of "ptr". */ + void __sanitizer_malloc_hook(const volatile void *ptr, size_t size); + void __sanitizer_free_hook(const volatile void *ptr); + + /* Installs a pair of hooks for malloc/free. + Several (currently, 5) hook pairs may be installed, they are executed + in the order they were installed and after calling + __sanitizer_malloc_hook/__sanitizer_free_hook. + Unlike __sanitizer_malloc_hook/__sanitizer_free_hook these hooks can be + chained and do not rely on weak symbols working on the platform, but + require __sanitizer_install_malloc_and_free_hooks to be called at startup + and thus will not be called on malloc/free very early in the process. + Returns the number of hooks currently installed or 0 on failure. + Not thread-safe, should be called in the main thread before starting + other threads. + */ + int __sanitizer_install_malloc_and_free_hooks( + void (*malloc_hook)(const volatile void *, size_t), + void (*free_hook)(const volatile void *)); + + /* Drains allocator quarantines (calling thread's and global ones), returns + freed memory back to OS and releases other non-essential internal allocator + resources in attempt to reduce process RSS. + Currently available with ASan only. + */ + void __sanitizer_purge_allocator(void); + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif diff --git a/include/sanitizer/asan_interface.h b/include/sanitizer/asan_interface.h new file mode 100644 index 00000000..f2d77143 --- /dev/null +++ b/include/sanitizer/asan_interface.h @@ -0,0 +1,155 @@ +//===-- sanitizer/asan_interface.h ------------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file is a part of AddressSanitizer. +// +// Public interface header. +//===----------------------------------------------------------------------===// +#ifndef SANITIZER_ASAN_INTERFACE_H +#define SANITIZER_ASAN_INTERFACE_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + // Marks memory region [addr, addr+size) as unaddressable. + // This memory must be previously allocated by the user program. Accessing + // addresses in this region from instrumented code is forbidden until + // this region is unpoisoned. This function is not guaranteed to poison + // the whole region - it may poison only subregion of [addr, addr+size) due + // to ASan alignment restrictions. + // Method is NOT thread-safe in the sense that no two threads can + // (un)poison memory in the same memory region simultaneously. + void __asan_poison_memory_region(void const volatile *addr, size_t size); + // Marks memory region [addr, addr+size) as addressable. + // This memory must be previously allocated by the user program. Accessing + // addresses in this region is allowed until this region is poisoned again. + // This function may unpoison a superregion of [addr, addr+size) due to + // ASan alignment restrictions. + // Method is NOT thread-safe in the sense that no two threads can + // (un)poison memory in the same memory region simultaneously. + void __asan_unpoison_memory_region(void const volatile *addr, size_t size); + +// User code should use macros instead of functions. +#if __has_feature(address_sanitizer) || defined(__SANITIZE_ADDRESS__) +#define ASAN_POISON_MEMORY_REGION(addr, size) \ + __asan_poison_memory_region((addr), (size)) +#define ASAN_UNPOISON_MEMORY_REGION(addr, size) \ + __asan_unpoison_memory_region((addr), (size)) +#else +#define ASAN_POISON_MEMORY_REGION(addr, size) \ + ((void)(addr), (void)(size)) +#define ASAN_UNPOISON_MEMORY_REGION(addr, size) \ + ((void)(addr), (void)(size)) +#endif + + // Returns 1 if addr is poisoned (i.e. 1-byte read/write access to this + // address will result in error report from AddressSanitizer). + // Otherwise returns 0. + int __asan_address_is_poisoned(void const volatile *addr); + + // If at least one byte in [beg, beg+size) is poisoned, return the address + // of the first such byte. Otherwise return 0. + void *__asan_region_is_poisoned(void *beg, size_t size); + + // Print the description of addr (useful when debugging in gdb). + void __asan_describe_address(void *addr); + + // Useful for calling from a debugger to get information about an ASan error. + // Returns 1 if an error has been (or is being) reported, otherwise returns 0. + int __asan_report_present(void); + + // Useful for calling from a debugger to get information about an ASan error. + // If an error has been (or is being) reported, the following functions return + // the pc, bp, sp, address, access type (0 = read, 1 = write), access size and + // bug description (e.g. "heap-use-after-free"). Otherwise they return 0. + void *__asan_get_report_pc(void); + void *__asan_get_report_bp(void); + void *__asan_get_report_sp(void); + void *__asan_get_report_address(void); + int __asan_get_report_access_type(void); + size_t __asan_get_report_access_size(void); + const char *__asan_get_report_description(void); + + // Useful for calling from the debugger to get information about a pointer. + // Returns the category of the given pointer as a constant string. + // Possible return values are "global", "stack", "stack-fake", "heap", + // "heap-invalid", "shadow-low", "shadow-gap", "shadow-high", "unknown". + // If global or stack, tries to also return the variable name, address and + // size. If heap, tries to return the chunk address and size. 'name' should + // point to an allocated buffer of size 'name_size'. + const char *__asan_locate_address(void *addr, char *name, size_t name_size, + void **region_address, size_t *region_size); + + // Useful for calling from the debugger to get the allocation stack trace + // and thread ID for a heap address. Stores up to 'size' frames into 'trace', + // returns the number of stored frames or 0 on error. + size_t __asan_get_alloc_stack(void *addr, void **trace, size_t size, + int *thread_id); + + // Useful for calling from the debugger to get the free stack trace + // and thread ID for a heap address. Stores up to 'size' frames into 'trace', + // returns the number of stored frames or 0 on error. + size_t __asan_get_free_stack(void *addr, void **trace, size_t size, + int *thread_id); + + // Useful for calling from the debugger to get the current shadow memory + // mapping. + void __asan_get_shadow_mapping(size_t *shadow_scale, size_t *shadow_offset); + + // This is an internal function that is called to report an error. + // However it is still a part of the interface because users may want to + // set a breakpoint on this function in a debugger. + void __asan_report_error(void *pc, void *bp, void *sp, + void *addr, int is_write, size_t access_size); + + // Deprecated. Call __sanitizer_set_death_callback instead. + void __asan_set_death_callback(void (*callback)(void)); + + void __asan_set_error_report_callback(void (*callback)(const char*)); + + // User may provide function that would be called right when ASan detects + // an error. This can be used to notice cases when ASan detects an error, but + // the program crashes before ASan report is printed. + void __asan_on_error(void); + + // Prints accumulated stats to stderr. Used for debugging. + void __asan_print_accumulated_stats(void); + + // This function may be optionally provided by user and should return + // a string containing ASan runtime options. See asan_flags.h for details. + const char* __asan_default_options(void); + + // The following 2 functions facilitate garbage collection in presence of + // asan's fake stack. + + // Returns an opaque handler to be used later in __asan_addr_is_in_fake_stack. + // Returns NULL if the current thread does not have a fake stack. + void *__asan_get_current_fake_stack(void); + + // If fake_stack is non-NULL and addr belongs to a fake frame in + // fake_stack, returns the address on real stack that corresponds to + // the fake frame and sets beg/end to the boundaries of this fake frame. + // Otherwise returns NULL and does not touch beg/end. + // If beg/end are NULL, they are not touched. + // This function may be called from a thread other than the owner of + // fake_stack, but the owner thread need to be alive. + void *__asan_addr_is_in_fake_stack(void *fake_stack, void *addr, void **beg, + void **end); + + // Performs cleanup before a [[noreturn]] function. Must be called + // before things like _exit and execl to avoid false positives on stack. + void __asan_handle_no_return(void); + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // SANITIZER_ASAN_INTERFACE_H diff --git a/include/sanitizer/common_interface_defs.h b/include/sanitizer/common_interface_defs.h new file mode 100644 index 00000000..6d4326f7 --- /dev/null +++ b/include/sanitizer/common_interface_defs.h @@ -0,0 +1,198 @@ +//===-- sanitizer/common_interface_defs.h -----------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// Common part of the public sanitizer interface. +//===----------------------------------------------------------------------===// + +#ifndef SANITIZER_COMMON_INTERFACE_DEFS_H +#define SANITIZER_COMMON_INTERFACE_DEFS_H + +#include +#include + +// GCC does not understand __has_feature. +#if !defined(__has_feature) +# define __has_feature(x) 0 +#endif + +#ifdef __cplusplus +extern "C" { +#endif + // Arguments for __sanitizer_sandbox_on_notify() below. + typedef struct { + // Enable sandbox support in sanitizer coverage. + int coverage_sandboxed; + // File descriptor to write coverage data to. If -1 is passed, a file will + // be pre-opened by __sanitizer_sandobx_on_notify(). This field has no + // effect if coverage_sandboxed == 0. + intptr_t coverage_fd; + // If non-zero, split the coverage data into well-formed blocks. This is + // useful when coverage_fd is a socket descriptor. Each block will contain + // a header, allowing data from multiple processes to be sent over the same + // socket. + unsigned int coverage_max_block_size; + } __sanitizer_sandbox_arguments; + + // Tell the tools to write their reports to "path." instead of stderr. + void __sanitizer_set_report_path(const char *path); + // Tell the tools to write their reports to the provided file descriptor + // (casted to void *). + void __sanitizer_set_report_fd(void *fd); + + // Notify the tools that the sandbox is going to be turned on. The reserved + // parameter will be used in the future to hold a structure with functions + // that the tools may call to bypass the sandbox. + void __sanitizer_sandbox_on_notify(__sanitizer_sandbox_arguments *args); + + // This function is called by the tool when it has just finished reporting + // an error. 'error_summary' is a one-line string that summarizes + // the error message. This function can be overridden by the client. + void __sanitizer_report_error_summary(const char *error_summary); + + // Some of the sanitizers (e.g. asan/tsan) may miss bugs that happen + // in unaligned loads/stores. In order to find such bugs reliably one needs + // to replace plain unaligned loads/stores with these calls. + uint16_t __sanitizer_unaligned_load16(const void *p); + uint32_t __sanitizer_unaligned_load32(const void *p); + uint64_t __sanitizer_unaligned_load64(const void *p); + void __sanitizer_unaligned_store16(void *p, uint16_t x); + void __sanitizer_unaligned_store32(void *p, uint32_t x); + void __sanitizer_unaligned_store64(void *p, uint64_t x); + + // Annotate the current state of a contiguous container, such as + // std::vector, std::string or similar. + // A contiguous container is a container that keeps all of its elements + // in a contiguous region of memory. The container owns the region of memory + // [beg, end); the memory [beg, mid) is used to store the current elements + // and the memory [mid, end) is reserved for future elements; + // beg <= mid <= end. For example, in "std::vector<> v" + // beg = &v[0]; + // end = beg + v.capacity() * sizeof(v[0]); + // mid = beg + v.size() * sizeof(v[0]); + // + // This annotation tells the Sanitizer tool about the current state of the + // container so that the tool can report errors when memory from [mid, end) + // is accessed. Insert this annotation into methods like push_back/pop_back. + // Supply the old and the new values of mid (old_mid/new_mid). + // In the initial state mid == end and so should be the final + // state when the container is destroyed or when it reallocates the storage. + // + // Use with caution and don't use for anything other than vector-like classes. + // + // For AddressSanitizer, 'beg' should be 8-aligned and 'end' should + // be either 8-aligned or it should point to the end of a separate heap-, + // stack-, or global- allocated buffer. I.e. the following will not work: + // int64_t x[2]; // 16 bytes, 8-aligned. + // char *beg = (char *)&x[0]; + // char *end = beg + 12; // Not 8 aligned, not the end of the buffer. + // This however will work fine: + // int32_t x[3]; // 12 bytes, but 8-aligned under AddressSanitizer. + // char *beg = (char*)&x[0]; + // char *end = beg + 12; // Not 8-aligned, but is the end of the buffer. + void __sanitizer_annotate_contiguous_container(const void *beg, + const void *end, + const void *old_mid, + const void *new_mid); + // Returns true if the contiguous container [beg, end) is properly poisoned + // (e.g. with __sanitizer_annotate_contiguous_container), i.e. if + // - [beg, mid) is addressable, + // - [mid, end) is unaddressable. + // Full verification requires O(end-beg) time; this function tries to avoid + // such complexity by touching only parts of the container around beg/mid/end. + int __sanitizer_verify_contiguous_container(const void *beg, const void *mid, + const void *end); + + // Similar to __sanitizer_verify_contiguous_container but returns the address + // of the first improperly poisoned byte otherwise. Returns null if the area + // is poisoned properly. + const void *__sanitizer_contiguous_container_find_bad_address( + const void *beg, const void *mid, const void *end); + + // Print the stack trace leading to this call. Useful for debugging user code. + void __sanitizer_print_stack_trace(void); + + // Symbolizes the supplied 'pc' using the format string 'fmt'. + // Outputs at most 'out_buf_size' bytes into 'out_buf'. + // The format syntax is described in + // lib/sanitizer_common/sanitizer_stacktrace_printer.h. + void __sanitizer_symbolize_pc(void *pc, const char *fmt, char *out_buf, + size_t out_buf_size); + // Same as __sanitizer_symbolize_pc, but for data section (i.e. globals). + void __sanitizer_symbolize_global(void *data_ptr, const char *fmt, + char *out_buf, size_t out_buf_size); + + // Sets the callback to be called right before death on error. + // Passing 0 will unset the callback. + void __sanitizer_set_death_callback(void (*callback)(void)); + + // Interceptor hooks. + // Whenever a libc function interceptor is called it checks if the + // corresponding weak hook is defined, and it so -- calls it. + // The primary use case is data-flow-guided fuzzing, where the fuzzer needs + // to know what is being passed to libc functions, e.g. memcmp. + // FIXME: implement more hooks. + void __sanitizer_weak_hook_memcmp(void *called_pc, const void *s1, + const void *s2, size_t n, int result); + void __sanitizer_weak_hook_strncmp(void *called_pc, const char *s1, + const char *s2, size_t n, int result); + void __sanitizer_weak_hook_strncasecmp(void *called_pc, const char *s1, + const char *s2, size_t n, int result); + void __sanitizer_weak_hook_strcmp(void *called_pc, const char *s1, + const char *s2, int result); + void __sanitizer_weak_hook_strcasecmp(void *called_pc, const char *s1, + const char *s2, int result); + void __sanitizer_weak_hook_strstr(void *called_pc, const char *s1, + const char *s2, char *result); + void __sanitizer_weak_hook_strcasestr(void *called_pc, const char *s1, + const char *s2, char *result); + void __sanitizer_weak_hook_memmem(void *called_pc, + const void *s1, size_t len1, + const void *s2, size_t len2, void *result); + + // Prints stack traces for all live heap allocations ordered by total + // allocation size until `top_percent` of total live heap is shown. + // `top_percent` should be between 1 and 100. + // At most `max_number_of_contexts` contexts (stack traces) is printed. + // Experimental feature currently available only with asan on Linux/x86_64. + void __sanitizer_print_memory_profile(size_t top_percent, + size_t max_number_of_contexts); + + // Fiber annotation interface. + // Before switching to a different stack, one must call + // __sanitizer_start_switch_fiber with a pointer to the bottom of the + // destination stack and its size. When code starts running on the new stack, + // it must call __sanitizer_finish_switch_fiber to finalize the switch. + // The start_switch function takes a void** to store the current fake stack if + // there is one (it is needed when detect_stack_use_after_return is enabled). + // When restoring a stack, this pointer must be given to the finish_switch + // function. In most cases, this void* can be stored on the stack just before + // switching. When leaving a fiber definitely, null must be passed as first + // argument to the start_switch function so that the fake stack is destroyed. + // If you do not want support for stack use-after-return detection, you can + // always pass null to these two functions. + // Note that the fake stack mechanism is disabled during fiber switch, so if a + // signal callback runs during the switch, it will not benefit from the stack + // use-after-return detection. + void __sanitizer_start_switch_fiber(void **fake_stack_save, + const void *bottom, size_t size); + void __sanitizer_finish_switch_fiber(void *fake_stack_save, + const void **bottom_old, + size_t *size_old); + + // Get full module name and calculate pc offset within it. + // Returns 1 if pc belongs to some module, 0 if module was not found. + int __sanitizer_get_module_and_offset_for_pc(void *pc, char *module_path, + size_t module_path_len, + void **pc_offset); + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // SANITIZER_COMMON_INTERFACE_DEFS_H diff --git a/include/sanitizer/coverage_interface.h b/include/sanitizer/coverage_interface.h new file mode 100644 index 00000000..bc95a5ca --- /dev/null +++ b/include/sanitizer/coverage_interface.h @@ -0,0 +1,36 @@ +//===-- sanitizer/coverage_interface.h --------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// Public interface for sanitizer coverage. +//===----------------------------------------------------------------------===// + +#ifndef SANITIZER_COVERAG_INTERFACE_H +#define SANITIZER_COVERAG_INTERFACE_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + + // Record and dump coverage info. + void __sanitizer_cov_dump(void); + + // Clear collected coverage info. + void __sanitizer_cov_reset(void); + + // Dump collected coverage info. Sorts pcs by module into individual .sancov + // files. + void __sanitizer_dump_coverage(const uintptr_t *pcs, uintptr_t len); + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // SANITIZER_COVERAG_INTERFACE_H diff --git a/include/sanitizer/dfsan_interface.h b/include/sanitizer/dfsan_interface.h new file mode 100644 index 00000000..05666f73 --- /dev/null +++ b/include/sanitizer/dfsan_interface.h @@ -0,0 +1,116 @@ +//===-- dfsan_interface.h -------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file is a part of DataFlowSanitizer. +// +// Public interface header. +//===----------------------------------------------------------------------===// +#ifndef DFSAN_INTERFACE_H +#define DFSAN_INTERFACE_H + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef uint16_t dfsan_label; + +/// Stores information associated with a specific label identifier. A label +/// may be a base label created using dfsan_create_label, with associated +/// text description and user data, or an automatically created union label, +/// which represents the union of two label identifiers (which may themselves +/// be base or union labels). +struct dfsan_label_info { + // Fields for union labels, set to 0 for base labels. + dfsan_label l1; + dfsan_label l2; + + // Fields for base labels. + const char *desc; + void *userdata; +}; + +/// Signature of the callback argument to dfsan_set_write_callback(). +typedef void (*dfsan_write_callback_t)(int fd, const void *buf, size_t count); + +/// Computes the union of \c l1 and \c l2, possibly creating a union label in +/// the process. +dfsan_label dfsan_union(dfsan_label l1, dfsan_label l2); + +/// Creates and returns a base label with the given description and user data. +dfsan_label dfsan_create_label(const char *desc, void *userdata); + +/// Sets the label for each address in [addr,addr+size) to \c label. +void dfsan_set_label(dfsan_label label, void *addr, size_t size); + +/// Sets the label for each address in [addr,addr+size) to the union of the +/// current label for that address and \c label. +void dfsan_add_label(dfsan_label label, void *addr, size_t size); + +/// Retrieves the label associated with the given data. +/// +/// The type of 'data' is arbitrary. The function accepts a value of any type, +/// which can be truncated or extended (implicitly or explicitly) as necessary. +/// The truncation/extension operations will preserve the label of the original +/// value. +dfsan_label dfsan_get_label(long data); + +/// Retrieves the label associated with the data at the given address. +dfsan_label dfsan_read_label(const void *addr, size_t size); + +/// Retrieves a pointer to the dfsan_label_info struct for the given label. +const struct dfsan_label_info *dfsan_get_label_info(dfsan_label label); + +/// Returns whether the given label label contains the label elem. +int dfsan_has_label(dfsan_label label, dfsan_label elem); + +/// If the given label label contains a label with the description desc, returns +/// that label, else returns 0. +dfsan_label dfsan_has_label_with_desc(dfsan_label label, const char *desc); + +/// Returns the number of labels allocated. +size_t dfsan_get_label_count(void); + +/// Sets a callback to be invoked on calls to write(). The callback is invoked +/// before the write is done. The write is not guaranteed to succeed when the +/// callback executes. Pass in NULL to remove any callback. +void dfsan_set_write_callback(dfsan_write_callback_t labeled_write_callback); + +/// Writes the labels currently used by the program to the given file +/// descriptor. The lines of the output have the following format: +/// +///