From ca9211ecdede9bdedb812b2243a4abdb8dacd1b9 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Wed, 7 Jan 2015 19:55:37 +0000 Subject: [PATCH] Import compiler-rt trunk r224034. https://llvm.org/svn/llvm-project/compiler-rt/trunk@224034 --- .arcconfig | 2 +- .gitignore | 1 + CMakeLists.txt | 381 ++- CODE_OWNERS.TXT | 57 + CREDITS.TXT | 12 + LICENSE.TXT | 10 +- Makefile | 4 +- README.txt | 332 --- SDKs/darwin/README.txt | 3 - SDKs/darwin/usr/include/errno.h | 17 - SDKs/darwin/usr/include/fcntl.h | 17 - SDKs/darwin/usr/include/limits.h | 23 - SDKs/darwin/usr/include/stdio.h | 89 - SDKs/darwin/usr/include/stdlib.h | 32 - SDKs/darwin/usr/include/string.h | 52 - SDKs/darwin/usr/include/sys/errno.h | 31 - SDKs/darwin/usr/include/sys/fcntl.h | 52 - SDKs/darwin/usr/include/sys/mman.h | 42 - SDKs/darwin/usr/include/sys/stat.h | 25 - SDKs/darwin/usr/include/sys/types.h | 20 - SDKs/linux/usr/include/stdio.h | 1 + cmake/Modules/AddCompilerRT.cmake | 164 +- cmake/Modules/CompilerRTCompile.cmake | 71 +- cmake/Modules/CompilerRTLink.cmake | 10 +- cmake/Modules/CompilerRTUtils.cmake | 37 +- cmake/Modules/SanitizerUtils.cmake | 32 +- cmake/config-ix.cmake | 258 ++ include/CMakeLists.txt | 21 +- include/sanitizer/allocator_interface.h | 66 + include/sanitizer/asan_interface.h | 109 +- include/sanitizer/common_interface_defs.h | 56 +- include/sanitizer/dfsan_interface.h | 17 + include/sanitizer/lsan_interface.h | 31 +- include/sanitizer/msan_interface.h | 90 +- .../sanitizer}/tsan_interface_atomic.h | 163 +- {BlocksRuntime => lib/BlocksRuntime}/Block.h | 0 .../BlocksRuntime}/Block_private.h | 0 {BlocksRuntime => lib/BlocksRuntime}/data.c | 0 .../BlocksRuntime}/runtime.c | 0 lib/CMakeLists.txt | 240 +- lib/Makefile.mk | 21 +- lib/adddf3.c | 152 - lib/arm/udivmodsi4.S | 96 - lib/arm/udivsi3.S | 93 - lib/arm/umodsi3.S | 72 - lib/asan/CMakeLists.txt | 172 +- lib/asan/Makefile.mk | 11 +- lib/asan/README.txt | 7 +- lib/asan/asan_activation.cc | 88 + ...hared-lib-test-so.cc => asan_activation.h} | 21 +- lib/asan/asan_allocator.h | 82 +- lib/asan/asan_allocator2.cc | 203 +- lib/asan/asan_blacklist.txt | 3 + lib/asan/asan_debugging.cc | 141 + lib/asan/asan_dll_thunk.cc | 196 -- lib/asan/asan_fake_stack.cc | 65 +- lib/asan/asan_fake_stack.h | 8 +- lib/asan/asan_flags.h | 68 +- lib/asan/asan_globals.cc | 99 +- lib/asan/asan_init_version.h | 32 + lib/asan/asan_intercepted_functions.h | 79 - lib/asan/asan_interceptors.cc | 471 +-- lib/asan/asan_interceptors.h | 72 +- lib/asan/asan_interface_internal.h | 112 +- lib/asan/asan_internal.h | 64 +- lib/asan/asan_linux.cc | 149 +- lib/asan/asan_mac.cc | 97 +- lib/asan/asan_mac.h | 59 - lib/asan/asan_malloc_linux.cc | 115 +- lib/asan/asan_malloc_mac.cc | 40 +- lib/asan/asan_malloc_win.cc | 122 +- lib/asan/asan_mapping.h | 93 +- lib/asan/asan_new_delete.cc | 74 +- lib/asan/asan_poisoning.cc | 181 +- lib/asan/asan_poisoning.h | 32 +- lib/asan/asan_posix.cc | 105 +- lib/asan/asan_preinit.cc | 16 +- lib/asan/asan_report.cc | 719 +++-- lib/asan/asan_report.h | 74 +- lib/asan/asan_rtl.cc | 598 ++-- lib/asan/asan_stack.cc | 34 +- lib/asan/asan_stack.h | 92 +- lib/asan/asan_stats.cc | 13 +- lib/asan/asan_stats.h | 4 +- lib/asan/asan_suppressions.cc | 87 + lib/asan/asan_suppressions.h | 29 + lib/asan/asan_thread.cc | 92 +- lib/asan/asan_thread.h | 51 +- lib/asan/asan_win.cc | 142 +- lib/asan/asan_win_dll_thunk.cc | 376 +++ lib/asan/asan_win_dynamic_runtime_thunk.cc | 52 + .../lit_tests/32bitConfig/lit.site.cfg.in | 13 - .../lit_tests/64bitConfig/lit.site.cfg.in | 12 - lib/asan/lit_tests/CMakeLists.txt | 42 - .../lit_tests/TestCases/Linux/coverage.cc | 45 - .../TestCases/Linux/heap-overflow-large.cc | 23 - .../TestCases/Linux/heavy_uar_test.cc | 54 - .../TestCases/Linux/time_null_regtest.cc | 20 - .../TestCases/Linux/zero-base-shadow32.cc | 24 - .../TestCases/Linux/zero-base-shadow64.cc | 24 - .../SharedLibs/darwin-dummy-shared-lib-so.cc | 13 - .../TestCases/SharedLibs/dlclose-test-so.cc | 33 - .../SharedLibs/init-order-dlopen-so.cc | 12 - .../TestCases/SharedLibs/lit.local.cfg | 4 - .../assign_large_valloc_to_global.cc | 8 - .../TestCases/contiguous_container.cc | 47 - lib/asan/lit_tests/TestCases/heap-overflow.cc | 24 - .../lit_tests/TestCases/interface_test.cc | 8 - .../TestCases/malloc_context_size.cc | 27 - lib/asan/lit_tests/TestCases/malloc_hook.cc | 36 - lib/asan/lit_tests/TestCases/null_deref.cc | 19 - .../lit_tests/TestCases/shared-lib-test.cc | 42 - .../stack-buffer-overflow-with-position.cc | 45 - .../lit_tests/TestCases/stack-overflow.cc | 16 - .../TestCases/stack-use-after-return.cc | 77 - .../lit_tests/TestCases/strdup_oob_test.cc | 19 - .../lit_tests/TestCases/symbolize_callback.cc | 17 - .../lit_tests/TestCases/use-after-free.cc | 31 - lib/asan/lit_tests/TestCases/wait.cc | 63 - lib/asan/lit_tests/lit.cfg | 95 - lib/asan/scripts/CMakeLists.txt | 4 + lib/asan/scripts/asan_device_setup | 267 ++ lib/asan/scripts/asan_symbolize.py | 199 +- lib/asan/tests/CMakeLists.txt | 215 +- lib/asan/tests/asan_asm_test.cc | 267 ++ lib/asan/tests/asan_fake_stack_test.cc | 10 +- lib/asan/tests/asan_interface_test.cc | 67 +- lib/asan/tests/asan_mem_test.cc | 15 +- lib/asan/tests/asan_noinst_test.cc | 110 +- lib/asan/tests/asan_oob_test.cc | 4 +- lib/asan/tests/asan_racy_double_free_test.cc | 4 +- lib/asan/tests/asan_str_test.cc | 52 +- lib/asan/tests/asan_test.cc | 193 +- lib/asan/tests/asan_test_config.h | 12 +- lib/asan/tests/asan_test_utils.h | 20 +- lib/assembly.h | 73 - lib/builtins/CMakeLists.txt | 278 ++ lib/builtins/Makefile.mk | 25 + lib/builtins/README.txt | 343 +++ lib/{ => builtins}/absvdi2.c | 0 lib/{ => builtins}/absvsi2.c | 0 lib/{ => builtins}/absvti2.c | 7 +- lib/builtins/adddf3.c | 22 + lib/builtins/addsf3.c | 22 + lib/builtins/addtf3.c | 25 + lib/{ => builtins}/addvdi3.c | 2 +- lib/{ => builtins}/addvsi3.c | 2 +- lib/{ => builtins}/addvti3.c | 8 +- lib/{ => builtins}/apple_versioning.c | 0 lib/{ => builtins}/arm/Makefile.mk | 4 +- lib/{ => builtins}/arm/adddf3vfp.S | 3 +- lib/{ => builtins}/arm/addsf3vfp.S | 3 +- lib/{ => builtins}/arm/aeabi_dcmp.S | 5 +- lib/builtins/arm/aeabi_div0.c | 43 + lib/{ => builtins}/arm/aeabi_fcmp.S | 5 +- lib/{ => builtins}/arm/aeabi_idivmod.S | 3 +- lib/{ => builtins}/arm/aeabi_ldivmod.S | 3 +- lib/{ => builtins}/arm/aeabi_memcmp.S | 3 +- lib/{ => builtins}/arm/aeabi_memcpy.S | 3 +- lib/{ => builtins}/arm/aeabi_memmove.S | 3 +- lib/{ => builtins}/arm/aeabi_memset.S | 6 +- lib/{ => builtins}/arm/aeabi_uidivmod.S | 3 +- lib/{ => builtins}/arm/aeabi_uldivmod.S | 5 +- lib/{ => builtins}/arm/bswapdi2.S | 17 +- lib/{ => builtins}/arm/bswapsi2.S | 17 +- lib/builtins/arm/clzdi2.S | 97 + lib/builtins/arm/clzsi2.S | 76 + lib/{ => builtins}/arm/comparesf2.S | 47 +- lib/{ => builtins}/arm/divdf3vfp.S | 3 +- lib/{ => builtins}/arm/divmodsi4.S | 18 +- lib/{ => builtins}/arm/divsf3vfp.S | 3 +- lib/{ => builtins}/arm/divsi3.S | 18 +- lib/{ => builtins}/arm/eqdf2vfp.S | 3 +- lib/{ => builtins}/arm/eqsf2vfp.S | 4 +- lib/{ => builtins}/arm/extendsfdf2vfp.S | 3 +- lib/{ => builtins}/arm/fixdfsivfp.S | 3 +- lib/{ => builtins}/arm/fixsfsivfp.S | 3 +- lib/{ => builtins}/arm/fixunsdfsivfp.S | 3 +- lib/{ => builtins}/arm/fixunssfsivfp.S | 3 +- lib/{ => builtins}/arm/floatsidfvfp.S | 3 +- lib/{ => builtins}/arm/floatsisfvfp.S | 3 +- lib/{ => builtins}/arm/floatunssidfvfp.S | 3 +- lib/{ => builtins}/arm/floatunssisfvfp.S | 3 +- lib/{ => builtins}/arm/gedf2vfp.S | 3 +- lib/{ => builtins}/arm/gesf2vfp.S | 4 +- lib/{ => builtins}/arm/gtdf2vfp.S | 3 +- lib/{ => builtins}/arm/gtsf2vfp.S | 4 +- lib/{ => builtins}/arm/ledf2vfp.S | 3 +- lib/{ => builtins}/arm/lesf2vfp.S | 4 +- lib/{ => builtins}/arm/ltdf2vfp.S | 3 +- lib/{ => builtins}/arm/ltsf2vfp.S | 4 +- lib/{ => builtins}/arm/modsi3.S | 17 +- lib/{ => builtins}/arm/muldf3vfp.S | 3 +- lib/{ => builtins}/arm/mulsf3vfp.S | 3 +- lib/{ => builtins}/arm/nedf2vfp.S | 3 +- lib/{ => builtins}/arm/negdf2vfp.S | 3 +- lib/{ => builtins}/arm/negsf2vfp.S | 3 +- lib/{ => builtins}/arm/nesf2vfp.S | 4 +- .../arm/restore_vfp_d8_d15_regs.S | 8 +- lib/{ => builtins}/arm/save_vfp_d8_d15_regs.S | 6 +- lib/{ => builtins}/arm/softfloat-alias.list | 0 lib/{ => builtins}/arm/subdf3vfp.S | 3 +- lib/{ => builtins}/arm/subsf3vfp.S | 3 +- lib/{ => builtins}/arm/switch16.S | 5 +- lib/{ => builtins}/arm/switch32.S | 7 +- lib/{ => builtins}/arm/switch8.S | 6 +- lib/{ => builtins}/arm/switchu8.S | 6 +- lib/builtins/arm/sync-ops.h | 64 + lib/builtins/arm/sync_fetch_and_add_4.S | 21 + lib/builtins/arm/sync_fetch_and_add_8.S | 24 + lib/builtins/arm/sync_fetch_and_and_4.S | 19 + lib/builtins/arm/sync_fetch_and_and_8.S | 23 + lib/builtins/arm/sync_fetch_and_max_4.S | 20 + lib/builtins/arm/sync_fetch_and_max_8.S | 21 + lib/builtins/arm/sync_fetch_and_min_4.S | 20 + lib/builtins/arm/sync_fetch_and_min_8.S | 21 + lib/builtins/arm/sync_fetch_and_nand_4.S | 20 + lib/builtins/arm/sync_fetch_and_nand_8.S | 24 + lib/builtins/arm/sync_fetch_and_or_4.S | 20 + lib/builtins/arm/sync_fetch_and_or_8.S | 24 + lib/builtins/arm/sync_fetch_and_sub_4.S | 21 + lib/builtins/arm/sync_fetch_and_sub_8.S | 24 + lib/builtins/arm/sync_fetch_and_umax_4.S | 20 + lib/builtins/arm/sync_fetch_and_umax_8.S | 21 + lib/builtins/arm/sync_fetch_and_umin_4.S | 20 + lib/builtins/arm/sync_fetch_and_umin_8.S | 21 + lib/builtins/arm/sync_fetch_and_xor_4.S | 20 + lib/builtins/arm/sync_fetch_and_xor_8.S | 24 + lib/{ => builtins}/arm/sync_synchronize.S | 3 +- lib/{ => builtins}/arm/truncdfsf2vfp.S | 3 +- lib/builtins/arm/udivmodsi4.S | 184 ++ lib/builtins/arm/udivsi3.S | 170 ++ lib/builtins/arm/umodsi3.S | 161 + lib/{ => builtins}/arm/unorddf2vfp.S | 3 +- lib/{ => builtins}/arm/unordsf2vfp.S | 4 +- lib/{x86_64 => builtins/arm64}/Makefile.mk | 4 +- lib/builtins/armv6m/Makefile.mk | 20 + lib/{ => builtins}/ashldi3.c | 0 lib/{ => builtins}/ashlti3.c | 6 +- lib/{ => builtins}/ashrdi3.c | 0 lib/{ => builtins}/ashrti3.c | 6 +- lib/builtins/assembly.h | 149 + lib/{ => builtins}/atomic.c | 0 lib/builtins/clear_cache.c | 96 + lib/{ => builtins}/clzdi2.c | 0 lib/{ => builtins}/clzsi2.c | 0 lib/{ => builtins}/clzti2.c | 6 +- lib/{ => builtins}/cmpdi2.c | 0 lib/{ => builtins}/cmpti2.c | 6 +- lib/{ => builtins}/comparedf2.c | 23 +- lib/{ => builtins}/comparesf2.c | 23 +- lib/builtins/comparetf2.c | 133 + lib/{ => builtins}/ctzdi2.c | 0 lib/{ => builtins}/ctzsi2.c | 0 lib/{ => builtins}/ctzti2.c | 6 +- lib/{ => builtins}/divdc3.c | 2 +- lib/{ => builtins}/divdf3.c | 5 +- lib/{ => builtins}/divdi3.c | 2 - lib/{ => builtins}/divmoddi4.c | 2 - lib/{ => builtins}/divmodsi4.c | 3 - lib/{ => builtins}/divsc3.c | 2 +- lib/{ => builtins}/divsf3.c | 3 +- lib/{ => builtins}/divsi3.c | 2 - lib/builtins/divtf3.c | 203 ++ lib/{ => builtins}/divti3.c | 8 +- lib/{ => builtins}/divxc3.c | 2 +- lib/{ => builtins}/enable_execute_stack.c | 5 +- lib/{ => builtins}/eprintf.c | 5 +- lib/builtins/extenddftf2.c | 23 + lib/builtins/extendsfdf2.c | 19 + lib/builtins/extendsftf2.c | 23 + lib/{ => builtins}/ffsdi2.c | 0 lib/{ => builtins}/ffsti2.c | 6 +- lib/{ => builtins}/fixdfdi.c | 2 +- lib/{ => builtins}/fixdfsi.c | 3 +- lib/{ => builtins}/fixdfti.c | 6 +- lib/{ => builtins}/fixsfdi.c | 0 lib/{ => builtins}/fixsfsi.c | 0 lib/{ => builtins}/fixsfti.c | 6 +- lib/{ => builtins}/fixunsdfdi.c | 0 lib/{ => builtins}/fixunsdfsi.c | 0 lib/{ => builtins}/fixunsdfti.c | 6 +- lib/{ => builtins}/fixunssfdi.c | 0 lib/{ => builtins}/fixunssfsi.c | 0 lib/{ => builtins}/fixunssfti.c | 6 +- lib/{ => builtins}/fixunsxfdi.c | 2 +- lib/{ => builtins}/fixunsxfsi.c | 2 +- lib/{ => builtins}/fixunsxfti.c | 6 +- lib/{ => builtins}/fixxfdi.c | 2 +- lib/{ => builtins}/fixxfti.c | 6 +- lib/{ => builtins}/floatdidf.c | 0 lib/{ => builtins}/floatdisf.c | 0 lib/{ => builtins}/floatdixf.c | 2 +- lib/{ => builtins}/floatsidf.c | 3 +- lib/{ => builtins}/floatsisf.c | 3 +- lib/builtins/floatsitf.c | 52 + lib/{ => builtins}/floattidf.c | 8 +- lib/{ => builtins}/floattisf.c | 8 +- lib/{ => builtins}/floattixf.c | 10 +- lib/{ => builtins}/floatundidf.c | 1 - lib/{ => builtins}/floatundisf.c | 0 lib/{ => builtins}/floatundixf.c | 2 +- lib/{ => builtins}/floatunsidf.c | 3 +- lib/{ => builtins}/floatunsisf.c | 3 +- lib/builtins/floatunsitf.c | 40 + lib/{ => builtins}/floatuntidf.c | 10 +- lib/{ => builtins}/floatuntisf.c | 8 +- lib/{ => builtins}/floatuntixf.c | 6 +- lib/{addsf3.c => builtins/fp_add_impl.inc} | 57 +- lib/builtins/fp_extend.h | 76 + .../fp_extend_impl.inc} | 61 +- lib/builtins/fp_lib.h | 270 ++ lib/{muldf3.c => builtins/fp_mul_impl.inc} | 52 +- lib/builtins/fp_trunc.h | 64 + .../fp_trunc_impl.inc} | 69 +- lib/{ => builtins}/gcc_personality_v0.c | 34 +- lib/{ => builtins}/i386/Makefile.mk | 2 +- lib/{ => builtins}/i386/ashldi3.S | 8 +- lib/{ => builtins}/i386/ashrdi3.S | 8 +- lib/{ => builtins}/i386/divdi3.S | 3 +- lib/{ => builtins}/i386/floatdidf.S | 20 +- lib/{ => builtins}/i386/floatdisf.S | 3 +- lib/{ => builtins}/i386/floatdixf.S | 3 +- lib/{ => builtins}/i386/floatundidf.S | 24 +- lib/{ => builtins}/i386/floatundisf.S | 40 +- lib/{ => builtins}/i386/floatundixf.S | 24 +- lib/{ => builtins}/i386/lshrdi3.S | 8 +- lib/{ => builtins}/i386/moddi3.S | 4 +- lib/{ => builtins}/i386/muldi3.S | 5 +- lib/{ => builtins}/i386/udivdi3.S | 5 +- lib/{ => builtins}/i386/umoddi3.S | 5 +- lib/{ => builtins}/int_endianness.h | 15 +- lib/{ => builtins}/int_lib.h | 32 +- lib/{ => builtins}/int_math.h | 0 lib/{ => builtins}/int_types.h | 7 +- lib/{ => builtins}/int_util.c | 0 lib/{ => builtins}/int_util.h | 2 +- lib/{ => builtins}/lshrdi3.c | 0 lib/{ => builtins}/lshrti3.c | 6 +- lib/{ => builtins}/moddi3.c | 8 +- lib/{ => builtins}/modsi3.c | 2 - lib/{ => builtins}/modti3.c | 14 +- lib/{ => builtins}/muldc3.c | 2 +- lib/builtins/muldf3.c | 22 + lib/{ => builtins}/muldi3.c | 0 lib/{ => builtins}/mulodi4.c | 2 +- lib/{ => builtins}/mulosi4.c | 2 +- lib/{ => builtins}/muloti4.c | 6 +- lib/{ => builtins}/mulsc3.c | 2 +- lib/builtins/mulsf3.c | 22 + lib/builtins/multf3.c | 25 + lib/{ => builtins}/multi3.c | 6 +- lib/{ => builtins}/mulvdi3.c | 2 +- lib/{ => builtins}/mulvsi3.c | 2 +- lib/{ => builtins}/mulvti3.c | 6 +- lib/{ => builtins}/mulxc3.c | 2 +- lib/{ => builtins}/negdf2.c | 3 +- lib/{ => builtins}/negdi2.c | 2 +- lib/{ => builtins}/negsf2.c | 0 lib/{ => builtins}/negti2.c | 6 +- lib/{ => builtins}/negvdi2.c | 0 lib/{ => builtins}/negvsi2.c | 0 lib/{ => builtins}/negvti2.c | 6 +- lib/{ => builtins}/paritydi2.c | 2 - lib/{ => builtins}/paritysi2.c | 0 lib/{ => builtins}/parityti2.c | 8 +- lib/{ => builtins}/popcountdi2.c | 0 lib/{ => builtins}/popcountsi2.c | 0 lib/{ => builtins}/popcountti2.c | 6 +- lib/{ => builtins}/powidf2.c | 0 lib/{ => builtins}/powisf2.c | 0 lib/{ => builtins}/powitf2.c | 2 +- lib/{ => builtins}/powixf2.c | 2 +- lib/{ => builtins}/ppc/DD.h | 2 +- lib/{ => builtins}/ppc/Makefile.mk | 2 +- lib/{ => builtins}/ppc/divtc3.c | 0 lib/{ => builtins}/ppc/fixtfdi.c | 2 +- lib/{ => builtins}/ppc/fixunstfdi.c | 0 lib/{ => builtins}/ppc/floatditf.c | 0 lib/{ => builtins}/ppc/floatunditf.c | 0 lib/{ => builtins}/ppc/gcc_qadd.c | 4 +- lib/{ => builtins}/ppc/gcc_qdiv.c | 0 lib/{ => builtins}/ppc/gcc_qmul.c | 0 lib/{ => builtins}/ppc/gcc_qsub.c | 4 +- lib/{ => builtins}/ppc/multc3.c | 0 lib/{ => builtins}/ppc/restFP.S | 0 lib/{ => builtins}/ppc/saveFP.S | 0 lib/{ => builtins}/subdf3.c | 3 - lib/{ => builtins}/subsf3.c | 2 - lib/builtins/subtf3.c | 27 + lib/{ => builtins}/subvdi3.c | 2 +- lib/{ => builtins}/subvsi3.c | 2 +- lib/{ => builtins}/subvti3.c | 8 +- lib/{ => builtins}/trampoline_setup.c | 5 +- lib/builtins/truncdfsf2.c | 18 + lib/builtins/trunctfdf2.c | 22 + lib/builtins/trunctfsf2.c | 22 + lib/{ => builtins}/ucmpdi2.c | 0 lib/{ => builtins}/ucmpti2.c | 6 +- lib/{ => builtins}/udivdi3.c | 2 - lib/{ => builtins}/udivmoddi4.c | 92 +- lib/{ => builtins}/udivmodsi4.c | 3 - lib/{ => builtins}/udivmodti4.c | 100 +- lib/{ => builtins}/udivsi3.c | 0 lib/{ => builtins}/udivti3.c | 8 +- lib/{ => builtins}/umoddi3.c | 2 - lib/{ => builtins}/umodsi3.c | 2 - lib/{ => builtins}/umodti3.c | 8 +- lib/builtins/x86_64/Makefile.mk | 20 + lib/{ => builtins}/x86_64/floatdidf.c | 0 lib/{ => builtins}/x86_64/floatdisf.c | 0 lib/{ => builtins}/x86_64/floatdixf.c | 0 lib/{ => builtins}/x86_64/floatundidf.S | 24 +- lib/{ => builtins}/x86_64/floatundisf.S | 14 +- lib/{ => builtins}/x86_64/floatundixf.S | 32 +- lib/clear_cache.c | 40 - lib/dfsan/CMakeLists.txt | 48 +- lib/dfsan/dfsan.cc | 119 +- lib/dfsan/dfsan.h | 12 + lib/dfsan/dfsan_custom.cc | 833 +++++- lib/dfsan/done_abilist.txt | 277 +- ...bilist.txt => libc_ubuntu1404_abilist.txt} | 340 +-- lib/dfsan/lit_tests/CMakeLists.txt | 21 - lib/dfsan/lit_tests/custom.c | 154 - lib/dfsan/lit_tests/lit.cfg | 69 - lib/dfsan/lit_tests/lit.site.cfg.in | 5 - lib/dfsan/scripts/build-libc-list.py | 36 +- lib/dfsan/scripts/check_custom_wrappers.sh | 50 + lib/fp_lib.h | 144 - lib/interception/CMakeLists.txt | 5 +- lib/interception/interception.h | 31 +- lib/interception/interception_linux.cc | 6 +- lib/interception/interception_linux.h | 20 +- lib/interception/interception_type_test.cc | 12 +- lib/interception/interception_win.cc | 185 +- lib/interception/interception_win.h | 32 +- lib/lit.common.configured.in | 27 - lib/lsan/CMakeLists.txt | 27 +- lib/lsan/lit_tests/AsanConfig/lit.cfg | 32 - lib/lsan/lit_tests/AsanConfig/lit.site.cfg.in | 8 - lib/lsan/lit_tests/CMakeLists.txt | 37 - lib/lsan/lit_tests/LsanConfig/lit.cfg | 30 - lib/lsan/lit_tests/LsanConfig/lit.site.cfg.in | 8 - .../TestCases/SharedLibs/huge_tls_lib_so.cc | 12 - .../TestCases/SharedLibs/lit.local.cfg | 4 - .../lit_tests/TestCases/leak_check_at_exit.cc | 19 - .../TestCases/suppressions_file.cc.supp | 1 - .../lit_tests/TestCases/use_tls_dynamic.cc | 33 - lib/lsan/lit_tests/Unit/lit.site.cfg.in | 12 - lib/lsan/lit_tests/lit.common.cfg | 43 - lib/lsan/lsan.cc | 26 +- lib/lsan/lsan.h | 20 + lib/lsan/lsan_allocator.cc | 50 +- lib/lsan/lsan_allocator.h | 2 +- lib/lsan/lsan_common.cc | 430 ++- lib/lsan/lsan_common.h | 49 +- lib/lsan/lsan_common_linux.cc | 32 +- lib/lsan/lsan_interceptors.cc | 50 +- lib/lsan/lsan_preinit.cc | 6 +- lib/lsan/tests/CMakeLists.txt | 58 - lib/lsan/tests/lsan_dummy_unittest.cc | 22 - lib/lsan/tests/lsan_testlib.cc | 25 - lib/msan/CMakeLists.txt | 42 +- lib/msan/lit_tests/CMakeLists.txt | 31 - .../lit_tests/SharedLibs/dso-origin-so.cc | 14 - lib/msan/lit_tests/SharedLibs/dso-origin.h | 4 - lib/msan/lit_tests/SharedLibs/lit.local.cfg | 4 - lib/msan/lit_tests/getline.cc | 30 - lib/msan/lit_tests/getline_test_data | 2 - lib/msan/lit_tests/lit.cfg | 74 - lib/msan/lit_tests/lit.site.cfg.in | 5 - lib/msan/lit_tests/no_sanitize_memory.cc | 34 - lib/msan/lit_tests/no_sanitize_memory_prop.cc | 33 - lib/msan/lit_tests/wrap_indirect_calls.cc | 64 - .../lit_tests/wrap_indirect_calls/caller.cc | 51 - .../wrap_indirect_calls/lit.local.cfg | 3 - lib/msan/lit_tests/wrap_indirect_calls/one.cc | 3 - lib/msan/lit_tests/wrap_indirect_calls/two.cc | 11 - .../lit_tests/wrap_indirect_calls/wrapper.cc | 11 - lib/msan/msan.cc | 404 +-- lib/msan/msan.h | 158 +- lib/msan/msan_allocator.cc | 154 +- lib/msan/msan_allocator.h | 33 + lib/msan/msan_chained_origin_depot.cc | 126 + lib/msan/msan_chained_origin_depot.h | 29 + lib/msan/msan_flags.h | 5 + lib/msan/msan_interceptors.cc | 1066 ++++--- lib/msan/msan_interface_internal.h | 75 +- lib/msan/msan_linux.cc | 158 +- lib/msan/msan_new_delete.cc | 13 +- lib/msan/msan_origin.h | 169 ++ lib/msan/msan_report.cc | 219 +- lib/msan/msan_thread.cc | 93 + lib/msan/msan_thread.h | 71 + lib/msan/tests/CMakeLists.txt | 137 +- lib/msan/tests/msan_loadable.cc | 18 - lib/msan/tests/msan_test.cc | 1310 +++++--- lib/msan/tests/msandr_test_so.cc | 38 - lib/msan/tests/msandr_test_so.h | 24 - lib/msandr/CMakeLists.txt | 26 - lib/msandr/README.txt | 40 - lib/msandr/msandr.cc | 871 ------ lib/mulsf3.c | 112 - lib/profile/CMakeLists.txt | 20 +- lib/profile/GCDAProfiling.c | 127 +- lib/profile/InstrProfiling.c | 48 + lib/profile/InstrProfiling.h | 92 + lib/profile/InstrProfilingBuffer.c | 104 + lib/profile/InstrProfilingFile.c | 194 ++ lib/profile/InstrProfilingInternal.h | 40 + lib/profile/InstrProfilingPlatformDarwin.c | 43 + lib/profile/InstrProfilingPlatformOther.c | 74 + lib/profile/InstrProfilingRuntime.cc | 30 + lib/profile/Makefile.mk | 4 +- lib/sanitizer_common/CMakeLists.txt | 92 +- lib/sanitizer_common/sanitizer_addrhashmap.h | 342 +++ lib/sanitizer_common/sanitizer_allocator.cc | 4 +- lib/sanitizer_common/sanitizer_allocator.h | 128 +- .../sanitizer_allocator_interface.h | 38 + .../sanitizer_allocator_internal.h | 34 +- lib/sanitizer_common/sanitizer_asm.h | 40 + lib/sanitizer_common/sanitizer_atomic.h | 3 +- lib/sanitizer_common/sanitizer_atomic_clang.h | 71 +- .../sanitizer_atomic_clang_other.h | 97 + .../sanitizer_atomic_clang_x86.h | 116 + lib/sanitizer_common/sanitizer_atomic_msvc.h | 100 +- lib/sanitizer_common/sanitizer_bitvector.h | 351 +++ lib/sanitizer_common/sanitizer_bvgraph.h | 165 ++ lib/sanitizer_common/sanitizer_common.cc | 187 +- lib/sanitizer_common/sanitizer_common.h | 156 +- .../sanitizer_common_interceptors.inc | 2624 ++++++++++++++--- .../sanitizer_common_interceptors_format.inc | 559 ++++ .../sanitizer_common_interceptors_ioctl.inc | 60 +- .../sanitizer_common_interceptors_scanf.inc | 311 -- .../sanitizer_common_libcdep.cc | 56 +- .../sanitizer_common_syscalls.inc | 163 +- lib/sanitizer_common/sanitizer_coverage.cc | 113 - .../sanitizer_coverage_libcdep.cc | 581 ++++ .../sanitizer_coverage_mapping_libcdep.cc | 125 + .../sanitizer_deadlock_detector.h | 412 +++ .../sanitizer_deadlock_detector1.cc | 189 ++ .../sanitizer_deadlock_detector2.cc | 428 +++ .../sanitizer_deadlock_detector_interface.h | 93 + lib/sanitizer_common/sanitizer_flags.cc | 214 +- lib/sanitizer_common/sanitizer_flags.h | 59 +- lib/sanitizer_common/sanitizer_freebsd.h | 137 + .../sanitizer_internal_defs.h | 53 +- lib/sanitizer_common/sanitizer_libc.cc | 34 +- lib/sanitizer_common/sanitizer_libc.h | 8 + lib/sanitizer_common/sanitizer_libignore.cc | 17 +- lib/sanitizer_common/sanitizer_linux.cc | 642 ++-- lib/sanitizer_common/sanitizer_linux.h | 27 +- .../sanitizer_linux_libcdep.cc | 295 +- lib/sanitizer_common/sanitizer_list.h | 17 + lib/sanitizer_common/sanitizer_mac.cc | 258 +- lib/sanitizer_common/sanitizer_mac.h | 37 + lib/sanitizer_common/sanitizer_mutex.h | 84 + .../sanitizer_persistent_allocator.cc} | 17 +- .../sanitizer_persistent_allocator.h | 71 + lib/sanitizer_common/sanitizer_platform.h | 73 +- .../sanitizer_platform_interceptors.h | 264 +- .../sanitizer_platform_limits_linux.cc | 26 +- .../sanitizer_platform_limits_posix.cc | 448 ++- .../sanitizer_platform_limits_posix.h | 510 +++- lib/sanitizer_common/sanitizer_posix.cc | 154 +- .../sanitizer_posix_libcdep.cc | 135 +- lib/sanitizer_common/sanitizer_printf.cc | 31 +- lib/sanitizer_common/sanitizer_procmaps.h | 75 +- .../sanitizer_procmaps_common.cc | 178 ++ .../sanitizer_procmaps_freebsd.cc | 88 + .../sanitizer_procmaps_linux.cc | 90 + .../sanitizer_procmaps_mac.cc | 190 ++ .../sanitizer_report_decorator.h | 12 +- lib/sanitizer_common/sanitizer_stackdepot.cc | 276 +- lib/sanitizer_common/sanitizer_stackdepot.h | 35 +- .../sanitizer_stackdepotbase.h | 176 ++ lib/sanitizer_common/sanitizer_stacktrace.cc | 177 +- lib/sanitizer_common/sanitizer_stacktrace.h | 65 +- .../sanitizer_stacktrace_libcdep.cc | 57 +- .../sanitizer_stacktrace_printer.cc | 132 + .../sanitizer_stacktrace_printer.h | 62 + .../sanitizer_stoptheworld_linux_libcdep.cc | 73 +- .../sanitizer_suppressions.cc | 45 +- lib/sanitizer_common/sanitizer_suppressions.h | 16 +- lib/sanitizer_common/sanitizer_symbolizer.cc | 59 +- lib/sanitizer_common/sanitizer_symbolizer.h | 92 +- .../sanitizer_symbolizer_libbacktrace.cc | 211 ++ .../sanitizer_symbolizer_libbacktrace.h | 50 + .../sanitizer_symbolizer_libcdep.cc | 21 +- .../sanitizer_symbolizer_posix_libcdep.cc | 613 ++-- .../sanitizer_symbolizer_win.cc | 101 +- .../sanitizer_syscall_generic.inc | 12 +- .../sanitizer_syscall_linux_x86_64.inc | 2 + .../sanitizer_thread_registry.cc | 20 +- .../sanitizer_thread_registry.h | 8 +- .../sanitizer_tls_get_addr.cc | 131 + lib/sanitizer_common/sanitizer_tls_get_addr.h | 60 + .../sanitizer_unwind_posix_libcdep.cc | 158 + lib/sanitizer_common/sanitizer_win.cc | 179 +- lib/sanitizer_common/scripts/check_lint.sh | 63 +- lib/sanitizer_common/scripts/cpplint.py | 4 +- .../scripts/gen_dynamic_list.py | 14 +- lib/sanitizer_common/scripts/litlint.py | 72 + lib/sanitizer_common/scripts/litlint_test.py | 23 + lib/sanitizer_common/scripts/sancov.py | 105 +- lib/sanitizer_common/tests/CMakeLists.txt | 109 +- .../tests/sanitizer_allocator_test.cc | 81 +- .../tests/sanitizer_allocator_testlib.cc | 4 +- .../tests/sanitizer_atomic_test.cc | 73 + .../tests/sanitizer_bitvector_test.cc | 176 ++ .../tests/sanitizer_bvgraph_test.cc | 339 +++ .../tests/sanitizer_common_test.cc | 46 +- .../tests/sanitizer_deadlock_detector_test.cc | 496 ++++ .../tests/sanitizer_flags_test.cc | 12 +- ...c => sanitizer_format_interceptor_test.cc} | 141 +- .../tests/sanitizer_ioctl_test.cc | 26 + .../tests/sanitizer_libc_test.cc | 3 + .../tests/sanitizer_mutex_test.cc | 15 +- .../tests/sanitizer_posix_test.cc | 18 + .../tests/sanitizer_printf_test.cc | 23 +- .../tests/sanitizer_procmaps_test.cc | 37 +- .../tests/sanitizer_pthread_wrappers.h | 66 + .../tests/sanitizer_stackdepot_test.cc | 87 +- .../sanitizer_stacktrace_printer_test.cc | 122 + .../tests/sanitizer_stacktrace_test.cc | 65 +- .../tests/sanitizer_suppressions_test.cc | 26 +- .../tests/sanitizer_test_config.h | 30 + .../tests/sanitizer_test_utils.h | 67 +- .../tests/sanitizer_thread_registry_test.cc | 13 +- lib/tsan/CMakeLists.txt | 74 +- lib/tsan/Makefile.old | 9 +- lib/tsan/check_analyze.sh | 20 +- lib/tsan/check_cmake.sh | 8 +- lib/tsan/check_memcpy.sh | 31 + lib/tsan/dd/CMakeLists.txt | 41 + lib/tsan/dd/dd_interceptors.cc | 333 +++ lib/tsan/dd/dd_rtl.cc | 151 + lib/tsan/dd/dd_rtl.h | 67 + lib/tsan/go/build.bat | 4 + lib/tsan/go/buildgo.sh | 48 +- lib/tsan/go/test.c | 20 +- lib/tsan/go/tsan_go.cc | 138 +- lib/tsan/lit_tests/CMakeLists.txt | 35 - lib/tsan/lit_tests/Helpers/blacklist.txt | 1 - lib/tsan/lit_tests/Helpers/lit.local.cfg | 2 - lib/tsan/lit_tests/SharedLibs/lit.local.cfg | 4 - lib/tsan/lit_tests/Unit/lit.cfg | 23 - lib/tsan/lit_tests/Unit/lit.site.cfg.in | 8 - lib/tsan/lit_tests/global_race.cc | 42 - lib/tsan/lit_tests/java_race.cc | 23 - lib/tsan/lit_tests/lit.cfg | 81 - lib/tsan/lit_tests/oob_race.cc | 24 - lib/tsan/lit_tests/thread_end_with_ignore.cc | 19 - lib/tsan/lit_tests/thread_end_with_ignore2.cc | 9 - lib/tsan/rtl/Makefile.old | 4 +- lib/tsan/rtl/tsan_clock.cc | 454 ++- lib/tsan/rtl/tsan_clock.h | 95 +- lib/tsan/rtl/tsan_defs.h | 30 +- lib/tsan/rtl/tsan_dense_alloc.h | 137 + lib/tsan/rtl/tsan_fd.cc | 26 +- lib/tsan/rtl/tsan_fd.h | 4 +- lib/tsan/rtl/tsan_flags.cc | 82 +- lib/tsan/rtl/tsan_flags.h | 24 +- lib/tsan/rtl/tsan_ignoreset.cc | 47 + lib/tsan/rtl/tsan_ignoreset.h | 38 + lib/tsan/rtl/tsan_interceptors.cc | 1146 ++++--- lib/tsan/rtl/tsan_interface_ann.cc | 35 +- lib/tsan/rtl/tsan_interface_atomic.cc | 470 ++- lib/tsan/rtl/tsan_interface_java.cc | 166 +- lib/tsan/rtl/tsan_interface_java.h | 7 +- lib/tsan/rtl/tsan_md5.cc | 14 +- lib/tsan/rtl/tsan_mman.cc | 174 +- lib/tsan/rtl/tsan_mman.h | 10 +- lib/tsan/rtl/tsan_mutex.cc | 53 +- lib/tsan/rtl/tsan_mutex.h | 10 +- lib/tsan/rtl/tsan_mutexset.h | 11 +- lib/tsan/rtl/tsan_platform.h | 338 ++- lib/tsan/rtl/tsan_platform_linux.cc | 340 ++- lib/tsan/rtl/tsan_platform_mac.cc | 57 +- lib/tsan/rtl/tsan_platform_windows.cc | 12 +- lib/tsan/rtl/tsan_report.cc | 182 +- lib/tsan/rtl/tsan_report.h | 40 +- lib/tsan/rtl/tsan_rtl.cc | 534 +++- lib/tsan/rtl/tsan_rtl.h | 322 +- lib/tsan/rtl/tsan_rtl_amd64.S | 271 +- lib/tsan/rtl/tsan_rtl_mutex.cc | 297 +- lib/tsan/rtl/tsan_rtl_report.cc | 454 ++- lib/tsan/rtl/tsan_rtl_thread.cc | 123 +- lib/tsan/rtl/tsan_stack_trace.cc | 46 + lib/tsan/rtl/tsan_stack_trace.h | 39 + lib/tsan/rtl/tsan_stat.cc | 354 +-- lib/tsan/rtl/tsan_stat.h | 355 +-- lib/tsan/rtl/tsan_suppressions.cc | 100 +- lib/tsan/rtl/tsan_suppressions.h | 1 - lib/tsan/rtl/tsan_symbolize.cc | 104 +- lib/tsan/rtl/tsan_symbolize.h | 8 +- .../rtl/tsan_symbolize_addr2line_linux.cc | 193 -- lib/tsan/rtl/tsan_sync.cc | 433 ++- lib/tsan/rtl/tsan_sync.h | 100 +- lib/tsan/rtl/tsan_trace.h | 22 +- lib/tsan/rtl/tsan_update_shadow_word_inl.h | 13 +- lib/tsan/rtl/tsan_vector.h | 22 +- lib/tsan/tests/CMakeLists.txt | 22 +- lib/tsan/tests/rtl/tsan_test.cc | 3 + lib/tsan/tests/rtl/tsan_test_util.h | 2 +- lib/tsan/tests/rtl/tsan_test_util_linux.cc | 11 +- lib/tsan/tests/unit/tsan_clock_test.cc | 451 ++- lib/tsan/tests/unit/tsan_dense_alloc_test.cc | 55 + lib/tsan/tests/unit/tsan_flags_test.cc | 146 +- lib/tsan/tests/unit/tsan_mman_test.cc | 78 +- lib/tsan/tests/unit/tsan_stack_test.cc | 104 +- lib/tsan/tests/unit/tsan_sync_test.cc | 142 +- lib/tsan/tests/unit/tsan_vector_test.cc | 2 - lib/ubsan/CMakeLists.txt | 27 +- lib/ubsan/lit_tests/AsanConfig/lit.cfg | 25 - .../lit_tests/AsanConfig/lit.site.cfg.in | 9 - lib/ubsan/lit_tests/CMakeLists.txt | 23 - lib/ubsan/lit_tests/TestCases/Misc/bounds.cpp | 15 - .../TestCases/Misc/missing_return.cpp | 9 - .../TestCases/TypeCheck/Function/function.cpp | 17 - .../lit_tests/TestCases/TypeCheck/vptr.cpp | 117 - lib/ubsan/lit_tests/UbsanConfig/lit.cfg | 23 - .../lit_tests/UbsanConfig/lit.site.cfg.in | 8 - lib/ubsan/lit_tests/lit.common.cfg | 31 - lib/ubsan/ubsan_diag.cc | 151 +- lib/ubsan/ubsan_diag.h | 29 + lib/ubsan/ubsan_flags.cc | 63 + lib/ubsan/ubsan_flags.h | 40 + lib/ubsan/ubsan_handlers.cc | 307 +- lib/ubsan/ubsan_handlers.h | 29 +- lib/ubsan/ubsan_handlers_cxx.cc | 36 +- lib/ubsan/ubsan_init.cc | 61 + lib/ubsan/ubsan_init.h | 24 + lib/ubsan/ubsan_type_hash.cc | 47 +- lib/ubsan/ubsan_value.cc | 1 + lib/ubsan/ubsan_value.h | 10 +- make/config.mk | 6 +- make/platform/clang_darwin.mk | 186 +- make/platform/clang_linux.mk | 62 +- ...in_embedded.mk => clang_macho_embedded.mk} | 56 +- .../clang_macho_embedded_test_input.c | 0 make/platform/darwin_bni.mk | 10 + make/platform/darwin_fat.mk | 2 +- make/subdir.mk | 11 +- .../BlocksRuntime}/block-static.c | 0 .../BlocksRuntime}/blockimport.c | 0 .../BlocksRuntime}/byrefaccess.c | 0 .../tests => test/BlocksRuntime}/byrefcopy.c | 0 .../BlocksRuntime}/byrefcopycopy.c | 0 .../BlocksRuntime}/byrefcopyinner.c | 0 .../BlocksRuntime}/byrefcopyint.c | 0 .../BlocksRuntime}/byrefcopystack.c | 0 .../BlocksRuntime}/byrefsanity.c | 0 .../BlocksRuntime}/byrefstruct.c | 0 .../tests => test/BlocksRuntime}/c99.c | 0 .../tests => test/BlocksRuntime}/cast.c | 0 .../BlocksRuntime}/constassign.c | 0 .../copy-block-literal-rdar6439600.c | 0 .../BlocksRuntime}/copyconstructor.C | 0 .../tests => test/BlocksRuntime}/copynull.c | 0 .../BlocksRuntime}/dispatch_async.c | 0 .../dispatch_call_Block_with_release.c | 0 .../tests => test/BlocksRuntime}/fail.c | 0 .../tests => test/BlocksRuntime}/flagsisa.c | 0 .../BlocksRuntime}/globalexpression.c | 0 .../tests => test/BlocksRuntime}/goto.c | 0 .../BlocksRuntime}/hasdescriptor.c | 0 .../tests => test/BlocksRuntime}/josh.C | 0 .../tests => test/BlocksRuntime}/k-and-r.c | 0 .../BlocksRuntime}/large-struct.c | 0 .../BlocksRuntime}/localisglobal.c | 0 .../tests => test/BlocksRuntime}/macro.c | 0 .../tests => test/BlocksRuntime}/makefile | 0 .../tests => test/BlocksRuntime}/modglobal.c | 0 .../BlocksRuntime}/nestedimport.c | 0 .../BlocksRuntime}/nullblockisa.c | 0 .../tests => test/BlocksRuntime}/objectRRGC.c | 0 .../BlocksRuntime}/objectassign.c | 0 .../tests => test/BlocksRuntime}/orbars.c | 0 .../BlocksRuntime}/rdar6396238.c | 0 .../BlocksRuntime}/rdar6405500.c | 0 .../BlocksRuntime}/rdar6414583.c | 0 .../BlocksRuntime}/recursive-block.c | 0 .../BlocksRuntime}/recursive-test.c | 0 .../BlocksRuntime}/recursiveassign.c | 0 .../tests => test/BlocksRuntime}/reference.C | 0 .../BlocksRuntime}/rettypepromotion.c | 0 .../BlocksRuntime}/returnfunctionptr.c | 0 .../BlocksRuntime}/shorthandexpression.c | 0 .../tests => test/BlocksRuntime}/sizeof.c | 0 .../BlocksRuntime}/small-struct.c | 0 .../BlocksRuntime}/structmember.c | 0 .../BlocksRuntime}/testfilerunner.h | 0 .../BlocksRuntime}/testfilerunner.m | 0 .../BlocksRuntime}/varargs-bad-assign.c | 0 .../tests => test/BlocksRuntime}/varargs.c | 0 .../tests => test/BlocksRuntime}/variadic.c | 0 .../tests => test/BlocksRuntime}/voidarg.c | 0 test/CMakeLists.txt | 65 + test/asan/CMakeLists.txt | 156 + .../TestCases/Android/coverage-android.cc | 67 + test/asan/TestCases/Android/lit.local.cfg | 11 + .../TestCases/Darwin/asan_gen_prefixes.cc | 14 + .../Darwin/cstring_literals_regtest.mm | 23 + .../Darwin/dyld_insert_libraries_reexec.cc | 33 + .../Darwin/interception-in-shared-lib-test.cc | 32 + .../Darwin/interface_symbols_darwin.c | 14 +- .../asan}/TestCases/Darwin/lit.local.cfg | 0 .../Darwin/malloc_set_zone_name-mprotect.cc | 2 +- .../TestCases/Darwin/malloc_zone-protected.cc | 2 +- test/asan/TestCases/Darwin/objc-odr.mm | 23 + .../Darwin/reexec-insert-libraries-env.cc | 9 +- .../TestCases/Darwin/suppressions-darwin.cc | 34 + .../Darwin/unset-insert-libraries-on-exec.cc | 11 +- .../TestCases/Helpers/blacklist-extra.cc | 0 .../asan}/TestCases/Helpers/echo-env.cc | 0 .../Helpers/init-order-atexit-extra.cc | 0 .../init-order-pthread-create-extra.cc | 0 .../Helpers/initialization-blacklist-extra.cc | 0 .../initialization-blacklist-extra2.cc | 0 .../Helpers/initialization-blacklist.txt | 0 .../Helpers/initialization-bug-extra.cc | 0 .../Helpers/initialization-bug-extra2.cc | 0 .../Helpers/initialization-constexpr-extra.cc | 0 .../Helpers/initialization-nobug-extra.cc | 0 .../asan}/TestCases/Helpers/lit.local.cfg | 0 .../Linux/asan-asm-stacktrace-test.cc | 33 + test/asan/TestCases/Linux/asan_dlopen_test.cc | 15 + .../TestCases/Linux/asan_prelink_test.cc | 5 +- .../TestCases/Linux/asan_preload_test-1.cc | 30 + .../TestCases/Linux/asan_preload_test-2.cc | 24 + .../TestCases/Linux/asan_rt_confict_test-1.cc | 13 + .../TestCases/Linux/asan_rt_confict_test-2.cc | 25 + test/asan/TestCases/Linux/clang_gcc_abi.cc | 44 + .../asan}/TestCases/Linux/clone_test.cc | 11 +- .../asan/TestCases/Linux/coverage-and-lsan.cc | 20 + .../coverage-caller-callee-total-count.cc | 41 + .../TestCases/Linux/coverage-caller-callee.cc | 74 + .../TestCases/Linux/coverage-direct-large.cc | 45 + test/asan/TestCases/Linux/coverage-direct.cc | 44 + .../asan/TestCases/Linux/coverage-disabled.cc | 18 + .../TestCases/Linux/coverage-fork-direct.cc | 38 + test/asan/TestCases/Linux/coverage-fork.cc | 38 + test/asan/TestCases/Linux/coverage-levels.cc | 20 + .../Linux/coverage-maybe-open-file.cc | 31 + .../Linux/coverage-module-unloaded.cc | 56 + .../TestCases/Linux/coverage-sandboxing.cc | 85 + test/asan/TestCases/Linux/coverage-tracing.cc | 22 + test/asan/TestCases/Linux/coverage.cc | 71 + .../Linux/function-sections-are-bad.cc | 41 + .../TestCases/Linux/globals-gc-sections.cc | 13 + .../Linux/initialization-bug-any-order.cc | 4 +- .../Linux/interception-in-shared-lib-test.cc | 32 + .../Linux/interception_malloc_test.cc | 8 +- .../Linux/interception_readdir_r_test.cc | 19 +- .../TestCases/Linux/interception_test.cc | 8 +- .../TestCases/Linux/interface_symbols_linux.c | 12 +- test/asan/TestCases/Linux/kernel-area.cc | 24 + test/asan/TestCases/Linux/leak.cc | 16 + .../asan}/TestCases/Linux/lit.local.cfg | 0 .../asan}/TestCases/Linux/malloc-in-qsort.cc | 6 +- .../TestCases/Linux/malloc_delete_mismatch.cc | 10 +- test/asan/TestCases/Linux/odr-violation.cc | 42 + .../TestCases/Linux/overflow-in-qsort.cc | 6 +- .../asan}/TestCases/Linux/preinit_test.cc | 8 +- .../asan}/TestCases/Linux/ptrace.cc | 8 +- .../asan}/TestCases/Linux/rlimit_mmap_test.cc | 2 +- test/asan/TestCases/Linux/shmctl.cc | 27 + .../asan/TestCases/Linux/sized_delete_test.cc | 93 + .../TestCases/Linux/stack-trace-dlclose.cc | 45 + test/asan/TestCases/Linux/stress_dtls.c | 116 + .../asan}/TestCases/Linux/swapcontext_test.cc | 8 +- .../asan}/TestCases/Linux/syscalls.cc | 7 +- .../asan}/TestCases/Linux/uar_signals.cc | 8 +- .../asan}/TestCases/Linux/unpoison_tls.cc | 2 +- .../asan/TestCases/Posix}/allow_user_segv.cc | 39 +- .../Posix}/asan-symbolize-sanity-test.cc | 30 +- test/asan/TestCases/Posix/asprintf.cc | 20 + .../Posix/assign_large_valloc_to_global.cc | 9 + .../asan/TestCases/Posix}/glob.cc | 8 +- .../asan/TestCases/Posix}/glob_test_root/aa | 0 .../asan/TestCases/Posix}/glob_test_root/ab | 0 .../asan/TestCases/Posix}/glob_test_root/ba | 0 .../TestCases/Posix}/init-order-dlopen.cc | 25 +- .../asan/TestCases/Posix}/ioctl.cc | 8 +- .../large_allocator_unpoisons_on_free.cc | 39 + test/asan/TestCases/Posix/lit.local.cfg | 9 + .../TestCases/Posix/new_array_cookie_test.cc | 24 + .../Posix/new_array_cookie_uaf_test.cc | 38 + .../new_array_cookie_with_new_from_class.cc | 38 + .../asan/TestCases/Posix}/readv.cc | 4 +- test/asan/TestCases/Posix/shared-lib-test.cc | 57 + .../asan/TestCases/Posix/start-deactivated.cc | 69 + .../asan/TestCases/Posix}/strerror_r_test.cc | 5 +- .../asan/TestCases/Posix}/tsd_dtor_leak.cc | 8 +- test/asan/TestCases/Posix/wait.cc | 45 + test/asan/TestCases/Posix/wait4.cc | 43 + test/asan/TestCases/Posix/waitid.cc | 28 + .../asan/TestCases/Windows/aligned_mallocs.cc | 29 + .../TestCases/Windows/allocators_sanity.cc | 37 + test/asan/TestCases/Windows/beginthreadex.cc | 21 + 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 + .../TestCases/Windows/crt_initializers.cc | 31 + .../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_host.cc | 49 + .../TestCases/Windows/dll_intercept_memchr.cc | 21 + .../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 + test/asan/TestCases/Windows/dll_seh.cc | 60 + .../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/global_const_string.cc | 12 + .../Windows/global_const_string_oob.cc | 20 + test/asan/TestCases/Windows/hello_world.cc | 9 + .../TestCases/Windows/intercept_memcpy.cc | 31 + .../TestCases/Windows/intercept_strdup.cc | 27 + .../TestCases/Windows/intercept_strlen.cc | 27 + 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 + .../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/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 | 19 + test/asan/TestCases/Windows/seh.cc | 56 + .../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/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 + test/asan/TestCases/Windows/throw_catch.cc | 73 + .../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 + .../TestCases/alloca_detect_custom_size_.cc | 23 + .../alloca_instruments_all_paddings.cc | 23 + .../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 + .../asan}/TestCases/allocator_returns_null.cc | 24 +- .../TestCases/asan_and_llvm_coverage_test.cc | 10 + .../asan}/TestCases/atexit_stats.cc | 9 +- .../asan}/TestCases/blacklist.cc | 8 +- test/asan/TestCases/contiguous_container.cc | 75 + .../TestCases/contiguous_container_crash.cc | 41 + .../TestCases/current_allocated_bytes.cc | 13 +- test/asan/TestCases/debug_locate.cc | 80 + test/asan/TestCases/debug_mapping.cc | 24 + test/asan/TestCases/debug_ppc64_mapping.cc | 37 + test/asan/TestCases/debug_report.cc | 48 + test/asan/TestCases/debug_stacks.cc | 62 + .../asan}/TestCases/deep_call_stack.cc | 12 +- .../asan}/TestCases/deep_stack_uaf.cc | 13 +- .../asan}/TestCases/deep_tail_call.cc | 8 +- .../asan}/TestCases/deep_thread_stack.cc | 9 +- .../asan}/TestCases/default_blacklist.cc | 3 + .../asan}/TestCases/default_options.cc | 5 +- test/asan/TestCases/describe_address.cc | 19 + .../asan}/TestCases/dlclose-test.cc | 44 +- .../asan}/TestCases/double-free.cc | 8 +- test/asan/TestCases/dump_instruction_bytes.cc | 20 + .../asan}/TestCases/force_inline_opt0.cc | 4 +- .../asan}/TestCases/free_hook_realloc.cc | 9 +- test/asan/TestCases/frexp_interceptor.cc | 16 + test/asan/TestCases/gc-test.cc | 50 + .../asan}/TestCases/global-demangle.cc | 2 +- test/asan/TestCases/global-location.cc | 38 + .../asan}/TestCases/global-overflow.cc | 8 +- test/asan/TestCases/heap-overflow-large.cc | 23 + test/asan/TestCases/heap-overflow.cc | 24 + test/asan/TestCases/heavy_uar_test.cc | 60 + .../asan}/TestCases/huge_negative_hea_oob.cc | 4 +- .../asan}/TestCases/init-order-atexit.cc | 5 +- .../TestCases/init-order-pthread-create.cc | 4 +- .../TestCases/initialization-blacklist.cc | 15 +- .../asan}/TestCases/initialization-bug.cc | 2 +- .../TestCases/initialization-constexpr.cc | 20 +- .../asan}/TestCases/initialization-nobug.cc | 16 +- .../asan}/TestCases/inline.cc | 2 +- .../TestCases}/interception_failure_test.cc | 8 +- test/asan/TestCases/interface_test.cc | 10 + test/asan/TestCases/intra-object-overflow.cc | 31 + .../asan}/TestCases/invalid-free.cc | 8 +- .../asan}/TestCases/large_func_test.cc | 10 +- .../asan}/TestCases/log-path_test.cc | 17 +- .../TestCases/log_path_fork_test.cc.disabled | 2 +- test/asan/TestCases/longjmp.cc | 25 + .../asan}/TestCases/lsan_annotations.cc | 4 +- test/asan/TestCases/malloc_context_size.cc | 27 + .../asan}/TestCases/malloc_fill.cc | 6 +- test/asan/TestCases/max_redzone.cc | 26 + .../asan}/TestCases/memcmp_strict_test.cc | 6 +- .../asan}/TestCases/memcmp_test.cc | 8 +- test/asan/TestCases/memset_test.cc | 71 + test/asan/TestCases/mmap_limit_mb.cc | 33 + test/asan/TestCases/no_asan_gen_globals.c | 11 + test/asan/TestCases/null_deref.cc | 19 + .../asan}/TestCases/on_error_callback.cc | 5 +- .../asan}/TestCases/partial_right.cc | 8 +- .../asan}/TestCases/poison_partial.cc | 8 +- .../asan}/TestCases/print_summary.cc | 4 +- test/asan/TestCases/printf-1.c | 25 + test/asan/TestCases/printf-2.c | 27 + test/asan/TestCases/printf-3.c | 22 + test/asan/TestCases/printf-4.c | 23 + test/asan/TestCases/printf-5.c | 25 + .../asan}/TestCases/sanity_check_pure_c.c | 8 +- .../asan}/TestCases/sleep_before_dying.c | 2 +- .../stack-buffer-overflow-with-position.cc | 44 + test/asan/TestCases/stack-buffer-overflow.cc | 16 + .../asan}/TestCases/stack-frame-demangle.cc | 2 +- .../asan}/TestCases/stack-oob-frames.cc | 8 +- test/asan/TestCases/stack-overflow.cc | 114 + test/asan/TestCases/stack-use-after-return.cc | 80 + test/asan/TestCases/strdup_oob_test.cc | 20 + .../asan}/TestCases/strip_path_prefix.c | 2 +- .../asan}/TestCases/strncpy-overflow.cc | 10 +- test/asan/TestCases/suppressions-function.cc | 29 + .../TestCases/suppressions-interceptor.cc | 24 + test/asan/TestCases/suppressions-library.cc | 39 + .../asan}/TestCases/throw_call_test.cc | 11 +- test/asan/TestCases/throw_catch.cc | 64 + .../asan}/TestCases/throw_invoke_test.cc | 8 +- .../asan}/TestCases/time_interceptor.cc | 8 +- .../asan}/TestCases/uar_and_exceptions.cc | 5 +- .../TestCases/unaligned_loads_and_stores.cc | 20 +- test/asan/TestCases/use-after-delete.cc | 31 + .../asan}/TestCases/use-after-free-right.cc | 20 +- test/asan/TestCases/use-after-free.cc | 36 + .../asan}/TestCases/use-after-poison.cc | 4 +- .../TestCases/use-after-scope-dtor-order.cc | 3 +- .../TestCases/use-after-scope-inlined.cc | 3 +- .../asan}/TestCases/use-after-scope-nobug.cc | 3 +- .../asan}/TestCases/use-after-scope-temp.cc | 2 +- .../asan}/TestCases/use-after-scope.cc | 5 +- test/asan/TestCases/zero_page_pc.cc | 12 + test/asan/Unit/lit.site.cfg.in | 24 + test/asan/android_commands/android_common.py | 29 + test/asan/android_commands/android_compile.py | 36 + test/asan/android_commands/android_run.py | 34 + test/asan/lit.cfg | 153 + test/asan/lit.site.cfg.in | 19 + test/{ => builtins}/Unit/absvdi2_test.c | 0 test/{ => builtins}/Unit/absvsi2_test.c | 0 test/{ => builtins}/Unit/absvti2_test.c | 6 +- test/{ => builtins}/Unit/adddf3vfp_test.c | 0 test/{ => builtins}/Unit/addsf3vfp_test.c | 0 test/builtins/Unit/addtf3_test.c | 81 + test/{ => builtins}/Unit/addvdi3_test.c | 0 test/{ => builtins}/Unit/addvsi3_test.c | 0 test/{ => builtins}/Unit/addvti3_test.c | 6 +- test/{ => builtins}/Unit/ashldi3_test.c | 0 test/{ => builtins}/Unit/ashlti3_test.c | 6 +- test/{ => builtins}/Unit/ashrdi3_test.c | 0 test/{ => builtins}/Unit/ashrti3_test.c | 6 +- test/{ => builtins}/Unit/bswapdi2_test.c | 0 test/{ => builtins}/Unit/bswapsi2_test.c | 0 test/{ => builtins}/Unit/clear_cache_test.c | 0 test/{ => builtins}/Unit/clzdi2_test.c | 0 test/{ => builtins}/Unit/clzsi2_test.c | 0 test/{ => builtins}/Unit/clzti2_test.c | 6 +- test/{ => builtins}/Unit/cmpdi2_test.c | 0 test/{ => builtins}/Unit/cmpti2_test.c | 6 +- test/{ => builtins}/Unit/comparedf2_test.c | 0 test/{ => builtins}/Unit/comparesf2_test.c | 0 test/{ => builtins}/Unit/ctzdi2_test.c | 0 test/{ => builtins}/Unit/ctzsi2_test.c | 0 test/{ => builtins}/Unit/ctzti2_test.c | 6 +- test/{ => builtins}/Unit/divdc3_test.c | 0 test/{ => builtins}/Unit/divdf3vfp_test.c | 0 test/{ => builtins}/Unit/divdi3_test.c | 0 test/{ => builtins}/Unit/divmodsi4_test.c | 0 test/{ => builtins}/Unit/divsc3_test.c | 0 test/{ => builtins}/Unit/divsf3vfp_test.c | 0 test/{ => builtins}/Unit/divsi3_test.c | 0 test/{ => builtins}/Unit/divtc3_test.c | 0 test/builtins/Unit/divtf3_test.c | 94 + test/{ => builtins}/Unit/divti3_test.c | 6 +- test/{ => builtins}/Unit/divxc3_test.c | 0 .../Unit/enable_execute_stack_test.c | 0 test/{ => builtins}/Unit/endianness.h | 0 test/{ => builtins}/Unit/eqdf2vfp_test.c | 0 test/{ => builtins}/Unit/eqsf2vfp_test.c | 0 test/builtins/Unit/eqtf2_test.c | 89 + .../{ => builtins}/Unit/extebdsfdf2vfp_test.c | 0 test/builtins/Unit/extenddftf2_test.c | 82 + test/builtins/Unit/extendsftf2_test.c | 83 + test/{ => builtins}/Unit/ffsdi2_test.c | 0 test/{ => builtins}/Unit/ffsti2_test.c | 6 +- test/{ => builtins}/Unit/fixdfdi_test.c | 0 test/{ => builtins}/Unit/fixdfsivfp_test.c | 0 test/{ => builtins}/Unit/fixdfti_test.c | 6 +- test/{ => builtins}/Unit/fixsfdi_test.c | 0 test/{ => builtins}/Unit/fixsfsivfp_test.c | 0 test/{ => builtins}/Unit/fixsfti_test.c | 6 +- test/{ => builtins}/Unit/fixunsdfdi_test.c | 0 test/{ => builtins}/Unit/fixunsdfsi_test.c | 0 test/{ => builtins}/Unit/fixunsdfsivfp_test.c | 0 test/{ => builtins}/Unit/fixunsdfti_test.c | 4 +- test/{ => builtins}/Unit/fixunssfdi_test.c | 0 test/{ => builtins}/Unit/fixunssfsi_test.c | 0 test/{ => builtins}/Unit/fixunssfsivfp_test.c | 0 test/{ => builtins}/Unit/fixunssfti_test.c | 6 +- test/{ => builtins}/Unit/fixunstfdi_test.c | 0 test/{ => builtins}/Unit/fixunsxfdi_test.c | 0 test/{ => builtins}/Unit/fixunsxfsi_test.c | 0 test/{ => builtins}/Unit/fixunsxfti_test.c | 6 +- test/{ => builtins}/Unit/fixxfdi_test.c | 0 test/{ => builtins}/Unit/fixxfti_test.c | 6 +- test/{ => builtins}/Unit/floatdidf_test.c | 0 test/{ => builtins}/Unit/floatdisf_test.c | 0 test/{ => builtins}/Unit/floatdixf_test.c | 0 test/{ => builtins}/Unit/floatsidfvfp_test.c | 0 test/{ => builtins}/Unit/floatsisfvfp_test.c | 0 test/builtins/Unit/floatsitf_test.c | 58 + test/{ => builtins}/Unit/floattidf_test.c | 6 +- test/{ => builtins}/Unit/floattisf_test.c | 6 +- test/{ => builtins}/Unit/floattixf_test.c | 6 +- test/{ => builtins}/Unit/floatundidf_test.c | 0 test/{ => builtins}/Unit/floatundisf_test.c | 0 test/{ => builtins}/Unit/floatundixf_test.c | 0 test/builtins/Unit/floatunsitf_test.c | 55 + .../Unit/floatunssidfvfp_test.c | 0 .../Unit/floatunssisfvfp_test.c | 0 test/{ => builtins}/Unit/floatuntidf_test.c | 6 +- test/{ => builtins}/Unit/floatuntisf_test.c | 6 +- test/{ => builtins}/Unit/floatuntixf_test.c | 6 +- test/builtins/Unit/fp_test.h | 223 ++ .../Unit/gcc_personality_test.c | 0 .../Unit/gcc_personality_test_helper.cxx | 0 test/{ => builtins}/Unit/gedf2vfp_test.c | 0 test/{ => builtins}/Unit/gesf2vfp_test.c | 0 test/builtins/Unit/getf2_test.c | 89 + test/{ => builtins}/Unit/gtdf2vfp_test.c | 0 test/{ => builtins}/Unit/gtsf2vfp_test.c | 0 test/builtins/Unit/gttf2_test.c | 89 + test/{ => builtins}/Unit/ledf2vfp_test.c | 0 test/{ => builtins}/Unit/lesf2vfp_test.c | 0 test/builtins/Unit/letf2_test.c | 89 + test/{ => builtins}/Unit/lshrdi3_test.c | 0 test/{ => builtins}/Unit/lshrti3_test.c | 6 +- test/{ => builtins}/Unit/ltdf2vfp_test.c | 0 test/{ => builtins}/Unit/ltsf2vfp_test.c | 0 test/builtins/Unit/lttf2_test.c | 89 + test/{ => builtins}/Unit/moddi3_test.c | 0 test/{ => builtins}/Unit/modsi3_test.c | 0 test/{ => builtins}/Unit/modti3_test.c | 6 +- test/{ => builtins}/Unit/muldc3_test.c | 0 test/{ => builtins}/Unit/muldf3vfp_test.c | 0 test/{ => builtins}/Unit/muldi3_test.c | 0 test/{ => builtins}/Unit/mulodi4_test.c | 0 test/{ => builtins}/Unit/mulosi4_test.c | 0 test/{ => builtins}/Unit/muloti4_test.c | 6 +- test/{ => builtins}/Unit/mulsc3_test.c | 0 test/{ => builtins}/Unit/mulsf3vfp_test.c | 0 test/{ => builtins}/Unit/multc3_test.c | 0 test/builtins/Unit/multf3_test.c | 95 + test/{ => builtins}/Unit/multi3_test.c | 6 +- test/{ => builtins}/Unit/mulvdi3_test.c | 0 test/{ => builtins}/Unit/mulvsi3_test.c | 0 test/{ => builtins}/Unit/mulvti3_test.c | 6 +- test/{ => builtins}/Unit/mulxc3_test.c | 0 test/{ => builtins}/Unit/nedf2vfp_test.c | 0 test/{ => builtins}/Unit/negdf2vfp_test.c | 0 test/{ => builtins}/Unit/negdi2_test.c | 0 test/{ => builtins}/Unit/negsf2vfp_test.c | 0 test/{ => builtins}/Unit/negti2_test.c | 6 +- test/{ => builtins}/Unit/negvdi2_test.c | 0 test/{ => builtins}/Unit/negvsi2_test.c | 0 test/{ => builtins}/Unit/negvti2_test.c | 6 +- test/{ => builtins}/Unit/nesf2vfp_test.c | 0 test/builtins/Unit/netf2_test.c | 89 + test/{ => builtins}/Unit/paritydi2_test.c | 0 test/{ => builtins}/Unit/paritysi2_test.c | 0 test/{ => builtins}/Unit/parityti2_test.c | 6 +- test/{ => builtins}/Unit/popcountdi2_test.c | 0 test/{ => builtins}/Unit/popcountsi2_test.c | 0 test/{ => builtins}/Unit/popcountti2_test.c | 6 +- test/{ => builtins}/Unit/powidf2_test.c | 0 test/{ => builtins}/Unit/powisf2_test.c | 0 test/{ => builtins}/Unit/powitf2_test.c | 0 test/{ => builtins}/Unit/powixf2_test.c | 0 test/{ => builtins}/Unit/ppc/DD.h | 0 test/{ => builtins}/Unit/ppc/fixtfdi_test.c | 0 test/{ => builtins}/Unit/ppc/floatditf_test.c | 0 test/{ => builtins}/Unit/ppc/floatditf_test.h | 0 .../Unit/ppc/floatunditf_test.c | 0 .../Unit/ppc/floatunditf_test.h | 0 test/{ => builtins}/Unit/ppc/qadd_test.c | 0 test/{ => builtins}/Unit/ppc/qdiv_test.c | 0 test/{ => builtins}/Unit/ppc/qmul_test.c | 0 test/{ => builtins}/Unit/ppc/qsub_test.c | 0 test/{ => builtins}/Unit/ppc/test | 0 test/{ => builtins}/Unit/subdf3vfp_test.c | 0 test/{ => builtins}/Unit/subsf3vfp_test.c | 0 test/builtins/Unit/subtf3_test.c | 74 + test/{ => builtins}/Unit/subvdi3_test.c | 0 test/{ => builtins}/Unit/subvsi3_test.c | 0 test/{ => builtins}/Unit/subvti3_test.c | 6 +- test/{ => builtins}/Unit/test | 0 .../Unit/trampoline_setup_test.c | 0 test/{ => builtins}/Unit/truncdfsf2vfp_test.c | 0 test/builtins/Unit/trunctfdf2_test.c | 76 + test/builtins/Unit/trunctfsf2_test.c | 75 + test/{ => builtins}/Unit/ucmpdi2_test.c | 0 test/{ => builtins}/Unit/ucmpti2_test.c | 6 +- test/{ => builtins}/Unit/udivdi3_test.c | 0 test/{ => builtins}/Unit/udivmoddi4_test.c | 0 test/{ => builtins}/Unit/udivmodsi4_test.c | 0 test/{ => builtins}/Unit/udivmodti4_test.c | 6 +- test/{ => builtins}/Unit/udivsi3_test.c | 0 test/{ => builtins}/Unit/udivti3_test.c | 6 +- test/{ => builtins}/Unit/umoddi3_test.c | 0 test/{ => builtins}/Unit/umodsi3_test.c | 0 test/{ => builtins}/Unit/umodti3_test.c | 6 +- test/{ => builtins}/Unit/unorddf2vfp_test.c | 0 test/{ => builtins}/Unit/unordsf2vfp_test.c | 0 test/builtins/Unit/unordtf2_test.c | 65 + test/{ => builtins}/timing/ashldi3.c | 0 test/{ => builtins}/timing/ashrdi3.c | 0 test/{ => builtins}/timing/divdi3.c | 0 test/{ => builtins}/timing/floatdidf.c | 0 test/{ => builtins}/timing/floatdisf.c | 0 test/{ => builtins}/timing/floatdixf.c | 0 test/{ => builtins}/timing/floatundidf.c | 0 test/{ => builtins}/timing/floatundisf.c | 0 test/{ => builtins}/timing/floatundixf.c | 0 test/{ => builtins}/timing/lshrdi3.c | 0 test/{ => builtins}/timing/moddi3.c | 0 test/{ => builtins}/timing/modsi3.c | 0 test/{ => builtins}/timing/muldi3.c | 0 test/{ => builtins}/timing/negdi2.c | 0 test/{ => builtins}/timing/time | 0 test/{ => builtins}/timing/timing.h | 0 test/{ => builtins}/timing/udivdi3.c | 0 test/{ => builtins}/timing/umoddi3.c | 0 test/dfsan/CMakeLists.txt | 15 + .../dfsan}/Inputs/flags_abilist.txt | 0 {lib/dfsan/lit_tests => test/dfsan}/basic.c | 11 +- test/dfsan/custom.cc | 958 ++++++ test/dfsan/dump_labels.c | 69 + {lib/dfsan/lit_tests => test/dfsan}/flags.c | 6 +- {lib/dfsan/lit_tests => test/dfsan}/fncall.c | 4 +- test/dfsan/label_count.c | 75 + test/dfsan/lit.cfg | 26 + test/dfsan/lit.site.cfg.in | 5 + .../lit_tests => test/dfsan}/propagate.c | 4 +- test/dfsan/vararg.c | 24 + test/dfsan/write_callback.c | 110 + {lib => test}/lit.common.cfg | 37 +- test/lit.common.configured.in | 38 + test/lsan/CMakeLists.txt | 23 + .../TestCases/cleanup_in_tsd_destructor.cc | 6 +- .../lsan}/TestCases/disabler.cc | 2 +- .../TestCases/disabler_in_tsd_destructor.cc | 2 +- .../lsan}/TestCases/do_leak_check_override.cc | 4 +- .../lit_tests => test/lsan}/TestCases/fork.cc | 2 +- .../lsan}/TestCases/fork_threaded.cc | 2 +- .../TestCases/high_allocator_contention.cc | 2 +- .../lsan}/TestCases/ignore_object.cc | 10 +- .../lsan}/TestCases/ignore_object_errors.cc | 2 +- .../lsan}/TestCases/large_allocation_leak.cc | 4 +- test/lsan/TestCases/leak_check_at_exit.cc | 21 + .../leak_check_before_thread_started.cc | 32 + .../lsan}/TestCases/link_turned_off.cc | 4 +- test/lsan/TestCases/new_array_with_dtor_0.cc | 19 + .../lsan}/TestCases/pointer_to_self.cc | 4 +- test/lsan/TestCases/print_suppressions.cc | 33 + test/lsan/TestCases/register_root_region.cc | 32 + .../lsan}/TestCases/sanity_check_pure_c.c | 0 .../lsan}/TestCases/stale_stack_leak.cc | 7 +- .../lsan}/TestCases/suppressions_default.cc | 3 +- .../lsan}/TestCases/suppressions_file.cc | 15 +- .../lsan}/TestCases/swapcontext.cc | 9 +- .../lsan}/TestCases/use_after_return.cc | 8 +- .../TestCases/use_globals_initialized.cc | 8 +- .../TestCases/use_globals_uninitialized.cc | 8 +- test/lsan/TestCases/use_poisoned_asan.cc | 25 + .../lsan}/TestCases/use_registers.cc | 13 +- .../lsan}/TestCases/use_stacks.cc | 8 +- .../lsan}/TestCases/use_stacks_threaded.cc | 13 +- test/lsan/TestCases/use_tls_dynamic.cc | 50 + .../use_tls_pthread_specific_dynamic.cc | 8 +- .../use_tls_pthread_specific_static.cc | 8 +- .../lsan}/TestCases/use_tls_static.cc | 8 +- .../lsan}/TestCases/use_unaligned.cc | 6 +- test/lsan/lit.common.cfg | 51 + test/lsan/lit.site.cfg.in | 8 + test/msan/CMakeLists.txt | 23 + test/msan/Linux/getresid.cc | 25 + .../lit_tests => test/msan}/Linux/glob.cc | 6 +- .../msan}/Linux/glob_altdirfunc.cc | 6 +- .../msan}/Linux/glob_nomatch.cc | 4 +- .../ab => test/msan/Linux/glob_test_root/aa | 0 .../ba => test/msan/Linux/glob_test_root/ab | 0 .../aaa => test/msan/Linux/glob_test_root/ba | 0 .../msan}/Linux/lit.local.cfg | 0 test/msan/Linux/sunrpc.cc | 40 + test/msan/Linux/sunrpc_bytes.cc | 38 + test/msan/Linux/sunrpc_string.cc | 35 + .../lit_tests => test/msan}/Linux/syscalls.cc | 35 +- .../msan}/Linux/tcgetattr.cc | 2 +- test/msan/Linux/xattr.cc | 145 + .../aab => test/msan/Linux/xattr_test_root/a | 0 .../msan}/Unit/lit.site.cfg.in | 5 +- .../msan}/allocator_returns_null.cc | 22 +- .../msan/lit_tests => test/msan}/backtrace.cc | 2 +- {lib/msan/lit_tests => test/msan}/c-strdup.c | 8 +- test/msan/chained_origin.cc | 66 + test/msan/chained_origin_empty_stack.cc | 34 + test/msan/chained_origin_limits.cc | 178 ++ test/msan/chained_origin_memcpy.cc | 61 + test/msan/chained_origin_with_signals.cc | 36 + test/msan/check_mem_is_initialized.cc | 33 + test/msan/coverage-levels.cc | 28 + .../lit_tests => test/msan}/cxa_atexit.cc | 2 +- test/msan/death-callback.cc | 39 + .../msan}/default_blacklist.cc | 0 {lib/msan/lit_tests => test/msan}/dlerror.cc | 2 +- .../lit_tests => test/msan}/dso-origin.cc | 37 +- test/msan/dtls_test.c | 60 + {lib/msan/lit_tests => test/msan}/errno.cc | 2 +- test/msan/fork.cc | 121 + test/msan/ftime.cc | 14 + .../msan}/getaddrinfo-positive.cc | 6 +- .../lit_tests => test/msan}/getaddrinfo.cc | 2 +- test/msan/getc_unlocked.c | 32 + test/msan/getline.cc | 36 + .../lit_tests => test/msan}/heap-origin.cc | 16 +- test/msan/iconv.cc | 48 + test/msan/if_indextoname.cc | 23 + test/msan/ifaddrs.cc | 50 + .../lit_tests => test/msan}/initgroups.cc | 2 +- {lib/msan/lit_tests => test/msan}/inline.cc | 2 +- .../msan}/insertvalue_origin.cc | 4 +- {lib/msan/lit_tests => test/msan}/ioctl.cc | 4 +- .../lit_tests => test/msan}/ioctl_custom.cc | 10 +- test/msan/ioctl_sound.cc | 29 + .../lit_tests => test/msan}/keep-going-dso.cc | 12 +- .../lit_tests => test/msan}/keep-going.cc | 16 +- test/msan/lit.cfg | 30 + test/msan/lit.site.cfg.in | 5 + test/msan/mallinfo.cc | 12 + test/msan/mktime.cc | 26 + test/msan/mmap_below_shadow.cc | 28 + test/msan/msan_check_mem_is_initialized.cc | 28 + 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/obstack.cc | 37 + test/msan/param_tls_limit.cc | 74 + .../lit_tests => test/msan}/poison_in_free.cc | 4 +- test/msan/print_stats.cc | 45 + test/msan/pthread_getattr_np_deadlock.cc | 22 + test/msan/rand_r.cc | 18 + .../msan/lit_tests => test/msan}/readdir64.cc | 16 +- test/msan/report-demangling.cc | 19 + {lib/msan/lit_tests => test/msan}/scandir.cc | 6 +- .../lit_tests => test/msan}/scandir_null.cc | 6 +- .../bbb => test/msan/scandir_test_root/aaa | 0 test/msan/scandir_test_root/aab | 0 test/msan/scandir_test_root/bbb | 0 {lib/msan/lit_tests => test/msan}/select.cc | 8 +- test/msan/select_float_origin.cc | 24 + test/msan/select_origin.cc | 22 + .../msan/lit_tests => test/msan}/setlocale.cc | 2 +- .../msan}/signal_stress_test.cc | 2 +- {lib/msan/lit_tests => test/msan}/sigwait.cc | 2 +- .../lit_tests => test/msan}/sigwaitinfo.cc | 2 +- .../lit_tests => test/msan}/stack-origin.cc | 16 +- test/msan/stack-origin2.cc | 41 + test/msan/strerror_r-non-gnu.c | 18 + test/msan/strlen_of_shadow.cc | 24 + test/msan/strxfrm.cc | 15 + .../msan}/sync_lock_set_and_test.cc | 2 +- test/msan/textdomain.cc | 12 + test/msan/times.cc | 20 + test/msan/tls_reuse.cc | 26 + test/msan/tsearch.cc | 36 + {lib/msan/lit_tests => test/msan}/tzset.cc | 2 +- .../msan}/unaligned_read_origin.cc | 4 +- test/msan/unpoison_string.cc | 16 + .../lit_tests => test/msan}/use-after-free.cc | 16 +- .../lit_tests => test/msan}/vector_cvt.cc | 6 +- .../lit_tests => test/msan}/vector_select.cc | 0 test/profile/CMakeLists.txt | 16 + 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 | 5 + .../profile/Inputs/instrprof-dynamic-main.cpp | 9 + test/profile/instrprof-basic.c | 31 + test/profile/instrprof-dlopen.test | 34 + .../profile/instrprof-dynamic-one-shared.test | 23 + .../profile/instrprof-dynamic-two-shared.test | 24 + test/profile/instrprof-reset-counters.c | 19 + test/profile/instrprof-set-filename.c | 14 + test/profile/instrprof-without-libc.c | 60 + .../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 | 53 + test/profile/lit.site.cfg.in | 11 + test/sanitizer_common/CMakeLists.txt | 46 + .../TestCases/Linux/aligned_alloc.c | 8 + .../TestCases/Linux/clock_gettime.c | 11 + .../TestCases/Linux/getpass.cc | 32 + .../Linux/getpwnam_r_invalid_user.cc | 19 + .../TestCases/Linux/lit.local.cfg | 9 + .../TestCases/Linux/mlock_test.cc | 13 + .../TestCases/Linux/open_memstream.cc | 57 + .../TestCases/Linux}/ptrace.cc | 28 +- .../TestCases/Linux/timerfd.cc | 52 + test/sanitizer_common/TestCases/corelimit.cc | 16 + .../TestCases}/malloc_hook.cc | 20 +- .../TestCases/print-stack-trace.cc | 24 + .../TestCases/pthread_mutexattr_get.cc | 19 + .../sanitizer_common/Unit}/lit.site.cfg.in | 3 +- test/sanitizer_common/lit.common.cfg | 38 + test/sanitizer_common/lit.site.cfg.in | 9 + test/tsan/CMakeLists.txt | 27 + test/tsan/Linux/lit.local.cfg | 9 + .../tsan/Linux}/mutex_robust.cc | 2 +- .../tsan/Linux}/mutex_robust2.cc | 2 +- .../tsan/Linux}/user_fopen.cc | 4 +- .../tsan/Linux}/user_malloc.cc | 4 +- .../tsan}/Unit/lit.site.cfg.in | 10 +- .../tsan}/aligned_vs_unaligned_race.cc | 2 +- .../tsan}/allocator_returns_null.cc | 14 +- test/tsan/atexit.cc | 29 + test/tsan/atexit2.cc | 26 + .../lit_tests => test/tsan}/atomic_free.cc | 2 +- .../lit_tests => test/tsan}/atomic_free2.cc | 2 +- .../lit_tests => test/tsan}/atomic_norace.cc | 2 +- .../lit_tests => test/tsan}/atomic_race.cc | 4 +- .../lit_tests => test/tsan}/atomic_stack.cc | 2 +- test/tsan/barrier.cc | 37 + test/tsan/bench.h | 59 + test/tsan/bench_acquire_only.cc | 19 + test/tsan/bench_acquire_release.cc | 18 + test/tsan/bench_local_mutex.cc | 27 + test/tsan/bench_mutex.cc | 28 + test/tsan/bench_release_only.cc | 23 + test/tsan/bench_rwmutex.cc | 25 + test/tsan/bench_shadow_flush.cc | 48 + test/tsan/bench_single_writer.cc | 23 + test/tsan/bench_ten_mutexes.cc | 26 + .../lit_tests => test/tsan}/benign_race.cc | 2 +- .../tsan/lit_tests => test/tsan}/blacklist.cc | 5 +- test/tsan/blacklist2.cc | 49 + {lib/tsan/lit_tests => test/tsan}/cond.c | 2 +- test/tsan/cond_cancel.c | 37 + .../tsan/lit_tests => test/tsan}/cond_race.cc | 6 +- .../lit_tests => test/tsan}/cond_version.c | 2 +- test/tsan/deadlock_detector_stress_test.cc | 596 ++++ .../lit_tests => test/tsan}/deep_stack1.cc | 4 +- .../tsan}/default_options.cc | 2 +- test/tsan/deflake.bash | 17 + test/tsan/dlclose.cc | 58 + .../tsan}/fd_close_norace.cc | 2 +- .../tsan}/fd_close_norace2.cc | 2 +- .../lit_tests => test/tsan}/fd_dup_norace.cc | 2 +- .../lit_tests => test/tsan}/fd_location.cc | 2 +- .../lit_tests => test/tsan}/fd_pipe_norace.cc | 2 +- .../lit_tests => test/tsan}/fd_pipe_race.cc | 2 +- .../tsan}/fd_socket_connect_norace.cc | 2 +- .../tsan}/fd_socket_norace.cc | 2 +- .../tsan}/fd_socketpair_norace.cc | 2 +- .../lit_tests => test/tsan}/fd_stdout_race.cc | 2 +- test/tsan/fork_atexit.cc | 37 + test/tsan/fork_deadlock.cc | 48 + test/tsan/fork_multithreaded.cc | 42 + test/tsan/fork_multithreaded3.cc | 40 + {lib/tsan/lit_tests => test/tsan}/free_race.c | 4 +- .../lit_tests => test/tsan}/free_race.c.supp | 0 .../tsan/lit_tests => test/tsan}/free_race2.c | 2 +- test/tsan/getline_nohang.cc | 39 + test/tsan/global_race.cc | 28 + test/tsan/global_race2.cc | 28 + test/tsan/global_race3.cc | 32 + .../lit_tests => test/tsan}/halt_on_error.cc | 4 +- .../tsan/lit_tests => test/tsan}/heap_race.cc | 2 +- .../lit_tests => test/tsan}/ignore_free.cc | 2 +- .../lit_tests => test/tsan}/ignore_lib0.cc | 4 +- .../tsan}/ignore_lib0.cc.supp | 0 .../lit_tests => test/tsan}/ignore_lib1.cc | 4 +- .../tsan}/ignore_lib1.cc.supp | 0 .../lit_tests => test/tsan}/ignore_lib2.cc | 2 +- .../tsan}/ignore_lib2.cc.supp | 0 .../lit_tests => test/tsan}/ignore_lib3.cc | 2 +- .../tsan}/ignore_lib3.cc.supp | 0 .../lit_tests => test/tsan}/ignore_lib_lib.h | 0 .../lit_tests => test/tsan}/ignore_malloc.cc | 2 +- .../lit_tests => test/tsan}/ignore_race.cc | 2 +- .../lit_tests => test/tsan}/ignore_sync.cc | 2 +- test/tsan/inlined_memcpy_race.cc | 38 + .../tsan/inlined_memcpy_race2.cc | 21 +- test/tsan/interface_atomic_test.c | 16 + {lib/tsan/lit_tests => test/tsan}/java.h | 1 + .../lit_tests => test/tsan}/java_alloc.cc | 14 +- test/tsan/java_finalizer.cc | 27 + .../tsan/lit_tests => test/tsan}/java_lock.cc | 17 +- .../lit_tests => test/tsan}/java_lock_move.cc | 15 +- .../lit_tests => test/tsan}/java_lock_rec.cc | 17 +- .../tsan}/java_lock_rec_race.cc | 17 +- test/tsan/java_move_overlap.cc | 72 + test/tsan/java_move_overlap_race.cc | 53 + test/tsan/java_race.cc | 25 + .../lit_tests => test/tsan}/java_race_move.cc | 12 +- .../lit_tests => test/tsan}/java_rwlock.cc | 17 +- test/tsan/libcxx/lit.local.cfg | 10 + test/tsan/libcxx/std_shared_ptr.cc | 24 + test/tsan/lit.cfg | 65 + .../lit_tests => test/tsan}/lit.site.cfg.in | 4 +- .../tsan}/load_shared_lib.cc | 30 +- {lib/tsan/lit_tests => test/tsan}/longjmp.cc | 2 +- {lib/tsan/lit_tests => test/tsan}/longjmp2.cc | 2 +- {lib/tsan/lit_tests => test/tsan}/longjmp3.cc | 2 +- {lib/tsan/lit_tests => test/tsan}/longjmp4.cc | 2 +- .../tsan}/malloc_overflow.cc | 2 +- .../lit_tests => test/tsan}/malloc_stack.cc | 2 +- test/tsan/map32bit.cc | 41 + .../lit_tests => test/tsan}/memcpy_race.cc | 2 +- test/tsan/mmap_large.cc | 20 + .../tsan}/mop_with_offset.cc | 2 +- .../tsan}/mop_with_offset2.cc | 2 +- test/tsan/must_deadlock.cc | 50 + 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 + .../tsan}/mutex_destroy_locked.cc | 2 +- test/tsan/mutex_double_lock.cc | 29 + .../tsan/lit_tests => test/tsan}/mutexset1.cc | 4 +- .../tsan/lit_tests => test/tsan}/mutexset2.cc | 4 +- .../tsan/lit_tests => test/tsan}/mutexset3.cc | 6 +- .../tsan/lit_tests => test/tsan}/mutexset4.cc | 6 +- .../tsan/lit_tests => test/tsan}/mutexset5.cc | 6 +- .../tsan/lit_tests => test/tsan}/mutexset6.cc | 8 +- .../tsan/lit_tests => test/tsan}/mutexset7.cc | 13 +- .../tsan/lit_tests => test/tsan}/mutexset8.cc | 4 +- test/tsan/printf-1.c | 16 + test/tsan/process_sleep.h | 7 + test/tsan/pthread_atfork_deadlock.c | 33 + .../lit_tests => test/tsan}/race_on_barrier.c | 2 +- .../tsan}/race_on_barrier2.c | 2 +- .../lit_tests => test/tsan}/race_on_heap.cc | 4 +- .../lit_tests => test/tsan}/race_on_mutex.c | 2 +- .../lit_tests => test/tsan}/race_on_mutex2.c | 2 +- test/tsan/race_on_puts.cc | 29 + .../lit_tests => test/tsan}/race_on_read.cc | 13 +- test/tsan/race_on_speculative_load.cc | 27 + .../lit_tests => test/tsan}/race_on_write.cc | 2 +- .../tsan}/race_with_finished_thread.cc | 2 +- .../lit_tests => test/tsan}/signal_errno.cc | 22 +- test/tsan/signal_longjmp.cc | 69 + .../lit_tests => test/tsan}/signal_malloc.cc | 4 +- test/tsan/signal_recursive.cc | 132 + test/tsan/signal_sync.cc | 58 + test/tsan/signal_write.cc | 27 + .../lit_tests => test/tsan}/sigsuspend.cc | 10 +- .../lit_tests => test/tsan}/simple_race.c | 5 +- .../lit_tests => test/tsan}/simple_race.cc | 5 +- .../lit_tests => test/tsan}/simple_stack.c | 4 +- .../lit_tests => test/tsan}/simple_stack2.cc | 14 +- .../lit_tests => test/tsan}/sleep_sync.cc | 2 +- .../lit_tests => test/tsan}/sleep_sync2.cc | 2 +- .../lit_tests => test/tsan}/stack_race.cc | 4 +- .../lit_tests => test/tsan}/stack_race2.cc | 3 +- .../lit_tests => test/tsan}/static_init1.cc | 2 +- .../lit_tests => test/tsan}/static_init2.cc | 2 +- .../lit_tests => test/tsan}/static_init3.cc | 2 +- .../lit_tests => test/tsan}/static_init4.cc | 2 +- .../lit_tests => test/tsan}/static_init5.cc | 2 +- .../lit_tests => test/tsan}/static_init6.cc | 2 +- test/tsan/sunrpc.cc | 25 + .../tsan}/suppress_same_address.cc | 6 +- .../tsan}/suppress_same_stacks.cc | 2 +- .../tsan}/suppressions_global.cc | 2 +- .../tsan}/suppressions_global.cc.supp | 0 .../tsan}/suppressions_race.cc | 2 +- .../tsan}/suppressions_race.cc.supp | 0 .../tsan}/suppressions_race2.cc | 2 +- .../tsan}/suppressions_race2.cc.supp | 0 .../lit_tests => test/tsan}/test_output.sh | 20 +- test/tsan/thread_detach.c | 20 + test/tsan/thread_end_with_ignore.cc | 24 + test/tsan/thread_end_with_ignore2.cc | 12 + test/tsan/thread_end_with_ignore3.cc | 22 + .../lit_tests => test/tsan}/thread_leak.c | 2 +- .../lit_tests => test/tsan}/thread_leak2.c | 2 +- .../lit_tests => test/tsan}/thread_leak3.c | 2 +- .../lit_tests => test/tsan}/thread_leak4.c | 2 +- .../lit_tests => test/tsan}/thread_leak5.c | 5 +- .../lit_tests => test/tsan}/thread_name.cc | 15 +- .../lit_tests => test/tsan}/thread_name2.cc | 8 +- {lib/tsan/lit_tests => test/tsan}/tiny_race.c | 2 +- {lib/tsan/lit_tests => test/tsan}/tls_race.cc | 4 +- .../tsan/lit_tests => test/tsan}/tls_race2.cc | 3 +- .../lit_tests => test/tsan}/tsan-vs-gvn.cc | 6 +- .../tsan}/unaligned_norace.cc | 2 +- .../lit_tests => test/tsan}/unaligned_race.cc | 32 +- test/tsan/vfork.cc | 51 + .../tsan}/virtual_inheritance_compile_bug.cc | 2 +- .../tsan}/vptr_benign_race.cc | 2 +- .../tsan}/vptr_harmful_race.cc | 2 +- .../tsan}/vptr_harmful_race2.cc | 2 +- test/tsan/vptr_harmful_race3.cc | 53 + test/tsan/vptr_harmful_race4.cc | 34 + .../tsan}/write_in_reader_lock.cc | 2 +- test/ubsan/CMakeLists.txt | 25 + .../ubsan}/TestCases/Float/cast-overflow.cpp | 59 +- .../ubsan}/TestCases/Integer/add-overflow.cpp | 6 +- .../ubsan}/TestCases/Integer/div-overflow.cpp | 2 +- .../ubsan}/TestCases/Integer/div-zero.cpp | 8 +- .../TestCases/Integer/incdec-overflow.cpp | 8 +- .../ubsan}/TestCases/Integer/mul-overflow.cpp | 2 +- .../TestCases/Integer/negate-overflow.cpp | 4 +- .../ubsan}/TestCases/Integer/no-recover.cpp | 6 +- .../ubsan}/TestCases/Integer/shift.cpp | 20 +- .../ubsan}/TestCases/Integer/sub-overflow.cpp | 6 +- test/ubsan/TestCases/Integer/summary.cpp | 10 + .../TestCases/Integer/uadd-overflow.cpp | 6 +- .../TestCases/Integer/uincdec-overflow.cpp | 8 +- .../TestCases/Integer/umul-overflow.cpp | 2 +- .../TestCases/Integer/usub-overflow.cpp | 6 +- .../ubsan}/TestCases/Misc/bool.cpp | 2 +- test/ubsan/TestCases/Misc/bounds.cpp | 15 + .../ubsan}/TestCases/Misc/deduplication.cpp | 2 +- .../ubsan}/TestCases/Misc/enum.cpp | 6 +- test/ubsan/TestCases/Misc/missing_return.cpp | 17 + test/ubsan/TestCases/Misc/nonnull-arg.cpp | 58 + test/ubsan/TestCases/Misc/nonnull.cpp | 15 + .../ubsan}/TestCases/Misc/unreachable.cpp | 2 +- .../ubsan}/TestCases/Misc/vla.c | 6 +- .../TestCases/TypeCheck/Function/function.cpp | 24 + .../TypeCheck/Function/lit.local.cfg | 0 .../ubsan}/TestCases/TypeCheck/misaligned.cpp | 52 +- .../ubsan}/TestCases/TypeCheck/null.cpp | 10 +- .../TestCases/TypeCheck/vptr-virtual-base.cpp | 19 + test/ubsan/TestCases/TypeCheck/vptr.cpp | 166 ++ test/ubsan/lit.common.cfg | 56 + test/ubsan/lit.site.cfg.in | 8 + unittests/CMakeLists.txt | 3 + {lib => unittests}/lit.common.unit.cfg | 0 .../lit.common.unit.configured.in | 4 +- www/index.html | 165 +- 1693 files changed, 52793 insertions(+), 19105 deletions(-) create mode 100644 CODE_OWNERS.TXT delete mode 100644 SDKs/darwin/README.txt delete mode 100644 SDKs/darwin/usr/include/errno.h delete mode 100644 SDKs/darwin/usr/include/fcntl.h delete mode 100644 SDKs/darwin/usr/include/limits.h delete mode 100644 SDKs/darwin/usr/include/stdio.h delete mode 100644 SDKs/darwin/usr/include/stdlib.h delete mode 100644 SDKs/darwin/usr/include/string.h delete mode 100644 SDKs/darwin/usr/include/sys/errno.h delete mode 100644 SDKs/darwin/usr/include/sys/fcntl.h delete mode 100644 SDKs/darwin/usr/include/sys/mman.h delete mode 100644 SDKs/darwin/usr/include/sys/stat.h delete mode 100644 SDKs/darwin/usr/include/sys/types.h create mode 100644 cmake/config-ix.cmake create mode 100644 include/sanitizer/allocator_interface.h rename {lib/tsan/rtl => include/sanitizer}/tsan_interface_atomic.h (60%) rename {BlocksRuntime => lib/BlocksRuntime}/Block.h (100%) rename {BlocksRuntime => lib/BlocksRuntime}/Block_private.h (100%) rename {BlocksRuntime => lib/BlocksRuntime}/data.c (100%) rename {BlocksRuntime => lib/BlocksRuntime}/runtime.c (100%) delete mode 100644 lib/adddf3.c delete mode 100644 lib/arm/udivmodsi4.S delete mode 100644 lib/arm/udivsi3.S delete mode 100644 lib/arm/umodsi3.S create mode 100644 lib/asan/asan_activation.cc rename lib/asan/{lit_tests/TestCases/SharedLibs/shared-lib-test-so.cc => asan_activation.h} (61%) create mode 100644 lib/asan/asan_debugging.cc delete mode 100644 lib/asan/asan_dll_thunk.cc create mode 100644 lib/asan/asan_init_version.h delete mode 100644 lib/asan/asan_intercepted_functions.h delete mode 100644 lib/asan/asan_mac.h create mode 100644 lib/asan/asan_suppressions.cc create mode 100644 lib/asan/asan_suppressions.h create mode 100644 lib/asan/asan_win_dll_thunk.cc create mode 100644 lib/asan/asan_win_dynamic_runtime_thunk.cc delete mode 100644 lib/asan/lit_tests/32bitConfig/lit.site.cfg.in delete mode 100644 lib/asan/lit_tests/64bitConfig/lit.site.cfg.in delete mode 100644 lib/asan/lit_tests/CMakeLists.txt delete mode 100644 lib/asan/lit_tests/TestCases/Linux/coverage.cc delete mode 100644 lib/asan/lit_tests/TestCases/Linux/heap-overflow-large.cc delete mode 100644 lib/asan/lit_tests/TestCases/Linux/heavy_uar_test.cc delete mode 100644 lib/asan/lit_tests/TestCases/Linux/time_null_regtest.cc delete mode 100644 lib/asan/lit_tests/TestCases/Linux/zero-base-shadow32.cc delete mode 100644 lib/asan/lit_tests/TestCases/Linux/zero-base-shadow64.cc delete mode 100644 lib/asan/lit_tests/TestCases/SharedLibs/darwin-dummy-shared-lib-so.cc delete mode 100644 lib/asan/lit_tests/TestCases/SharedLibs/dlclose-test-so.cc delete mode 100644 lib/asan/lit_tests/TestCases/SharedLibs/init-order-dlopen-so.cc delete mode 100644 lib/asan/lit_tests/TestCases/SharedLibs/lit.local.cfg delete mode 100644 lib/asan/lit_tests/TestCases/assign_large_valloc_to_global.cc delete mode 100644 lib/asan/lit_tests/TestCases/contiguous_container.cc delete mode 100644 lib/asan/lit_tests/TestCases/heap-overflow.cc delete mode 100644 lib/asan/lit_tests/TestCases/interface_test.cc delete mode 100644 lib/asan/lit_tests/TestCases/malloc_context_size.cc delete mode 100644 lib/asan/lit_tests/TestCases/malloc_hook.cc delete mode 100644 lib/asan/lit_tests/TestCases/null_deref.cc delete mode 100644 lib/asan/lit_tests/TestCases/shared-lib-test.cc delete mode 100644 lib/asan/lit_tests/TestCases/stack-buffer-overflow-with-position.cc delete mode 100644 lib/asan/lit_tests/TestCases/stack-overflow.cc delete mode 100644 lib/asan/lit_tests/TestCases/stack-use-after-return.cc delete mode 100644 lib/asan/lit_tests/TestCases/strdup_oob_test.cc delete mode 100644 lib/asan/lit_tests/TestCases/symbolize_callback.cc delete mode 100644 lib/asan/lit_tests/TestCases/use-after-free.cc delete mode 100644 lib/asan/lit_tests/TestCases/wait.cc delete mode 100644 lib/asan/lit_tests/lit.cfg create mode 100644 lib/asan/scripts/CMakeLists.txt create mode 100755 lib/asan/scripts/asan_device_setup create mode 100644 lib/asan/tests/asan_asm_test.cc delete mode 100644 lib/assembly.h create mode 100644 lib/builtins/CMakeLists.txt create mode 100644 lib/builtins/Makefile.mk create mode 100644 lib/builtins/README.txt rename lib/{ => builtins}/absvdi2.c (100%) rename lib/{ => builtins}/absvsi2.c (100%) rename lib/{ => builtins}/absvti2.c (91%) create mode 100644 lib/builtins/adddf3.c create mode 100644 lib/builtins/addsf3.c create mode 100644 lib/builtins/addtf3.c rename lib/{ => builtins}/addvdi3.c (95%) rename lib/{ => builtins}/addvsi3.c (95%) rename lib/{ => builtins}/addvti3.c (87%) rename lib/{ => builtins}/apple_versioning.c (100%) rename lib/{ => builtins}/arm/Makefile.mk (82%) rename lib/{ => builtins}/arm/adddf3vfp.S (94%) rename lib/{ => builtins}/arm/addsf3vfp.S (94%) rename lib/{ => builtins}/arm/aeabi_dcmp.S (89%) create mode 100644 lib/builtins/arm/aeabi_div0.c rename lib/{ => builtins}/arm/aeabi_fcmp.S (89%) rename lib/{ => builtins}/arm/aeabi_idivmod.S (93%) rename lib/{ => builtins}/arm/aeabi_ldivmod.S (93%) rename lib/{ => builtins}/arm/aeabi_memcmp.S (91%) rename lib/{ => builtins}/arm/aeabi_memcpy.S (91%) rename lib/{ => builtins}/arm/aeabi_memmove.S (91%) rename lib/{ => builtins}/arm/aeabi_memset.S (91%) rename lib/{ => builtins}/arm/aeabi_uidivmod.S (93%) rename lib/{ => builtins}/arm/aeabi_uldivmod.S (91%) rename lib/{ => builtins}/arm/bswapdi2.S (79%) rename lib/{ => builtins}/arm/bswapsi2.S (74%) create mode 100644 lib/builtins/arm/clzdi2.S create mode 100644 lib/builtins/arm/clzsi2.S rename lib/{ => builtins}/arm/comparesf2.S (89%) rename lib/{ => builtins}/arm/divdf3vfp.S (94%) rename lib/{ => builtins}/arm/divmodsi4.S (80%) rename lib/{ => builtins}/arm/divsf3vfp.S (94%) rename lib/{ => builtins}/arm/divsi3.S (83%) rename lib/{ => builtins}/arm/eqdf2vfp.S (94%) rename lib/{ => builtins}/arm/eqsf2vfp.S (94%) rename lib/{ => builtins}/arm/extendsfdf2vfp.S (94%) rename lib/{ => builtins}/arm/fixdfsivfp.S (94%) rename lib/{ => builtins}/arm/fixsfsivfp.S (94%) rename lib/{ => builtins}/arm/fixunsdfsivfp.S (94%) rename lib/{ => builtins}/arm/fixunssfsivfp.S (94%) rename lib/{ => builtins}/arm/floatsidfvfp.S (94%) rename lib/{ => builtins}/arm/floatsisfvfp.S (94%) rename lib/{ => builtins}/arm/floatunssidfvfp.S (93%) rename lib/{ => builtins}/arm/floatunssisfvfp.S (93%) rename lib/{ => builtins}/arm/gedf2vfp.S (94%) rename lib/{ => builtins}/arm/gesf2vfp.S (94%) rename lib/{ => builtins}/arm/gtdf2vfp.S (94%) rename lib/{ => builtins}/arm/gtsf2vfp.S (94%) rename lib/{ => builtins}/arm/ledf2vfp.S (94%) rename lib/{ => builtins}/arm/lesf2vfp.S (94%) rename lib/{ => builtins}/arm/ltdf2vfp.S (94%) rename lib/{ => builtins}/arm/ltsf2vfp.S (94%) rename lib/{ => builtins}/arm/modsi3.S (82%) rename lib/{ => builtins}/arm/muldf3vfp.S (94%) rename lib/{ => builtins}/arm/mulsf3vfp.S (94%) rename lib/{ => builtins}/arm/nedf2vfp.S (94%) rename lib/{ => builtins}/arm/negdf2vfp.S (93%) rename lib/{ => builtins}/arm/negsf2vfp.S (93%) rename lib/{ => builtins}/arm/nesf2vfp.S (94%) rename lib/{ => builtins}/arm/restore_vfp_d8_d15_regs.S (92%) rename lib/{ => builtins}/arm/save_vfp_d8_d15_regs.S (92%) rename lib/{ => builtins}/arm/softfloat-alias.list (100%) rename lib/{ => builtins}/arm/subdf3vfp.S (94%) rename lib/{ => builtins}/arm/subsf3vfp.S (94%) rename lib/{ => builtins}/arm/switch16.S (95%) rename lib/{ => builtins}/arm/switch32.S (95%) rename lib/{ => builtins}/arm/switch8.S (94%) rename lib/{ => builtins}/arm/switchu8.S (94%) 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 rename lib/{ => builtins}/arm/sync_synchronize.S (94%) rename lib/{ => builtins}/arm/truncdfsf2vfp.S (94%) create mode 100644 lib/builtins/arm/udivmodsi4.S create mode 100644 lib/builtins/arm/udivsi3.S create mode 100644 lib/builtins/arm/umodsi3.S rename lib/{ => builtins}/arm/unorddf2vfp.S (94%) rename lib/{ => builtins}/arm/unordsf2vfp.S (94%) rename lib/{x86_64 => builtins/arm64}/Makefile.mk (87%) create mode 100644 lib/builtins/armv6m/Makefile.mk rename lib/{ => builtins}/ashldi3.c (100%) rename lib/{ => builtins}/ashlti3.c (94%) rename lib/{ => builtins}/ashrdi3.c (100%) rename lib/{ => builtins}/ashrti3.c (94%) create mode 100644 lib/builtins/assembly.h rename lib/{ => builtins}/atomic.c (100%) create mode 100644 lib/builtins/clear_cache.c rename lib/{ => builtins}/clzdi2.c (100%) rename lib/{ => builtins}/clzsi2.c (100%) rename lib/{ => builtins}/clzti2.c (91%) rename lib/{ => builtins}/cmpdi2.c (100%) rename lib/{ => builtins}/cmpti2.c (92%) rename lib/{ => builtins}/comparedf2.c (88%) rename lib/{ => builtins}/comparesf2.c (88%) create mode 100644 lib/builtins/comparetf2.c rename lib/{ => builtins}/ctzdi2.c (100%) rename lib/{ => builtins}/ctzsi2.c (100%) rename lib/{ => builtins}/ctzti2.c (91%) rename lib/{ => builtins}/divdc3.c (98%) rename lib/{ => builtins}/divdf3.c (99%) rename lib/{ => builtins}/divdi3.c (94%) rename lib/{ => builtins}/divmoddi4.c (91%) rename lib/{ => builtins}/divmodsi4.c (91%) rename lib/{ => builtins}/divsc3.c (98%) rename lib/{ => builtins}/divsf3.c (99%) rename lib/{ => builtins}/divsi3.c (96%) create mode 100644 lib/builtins/divtf3.c rename lib/{ => builtins}/divti3.c (93%) rename lib/{ => builtins}/divxc3.c (98%) rename lib/{ => builtins}/enable_execute_stack.c (96%) rename lib/{ => builtins}/eprintf.c (86%) create mode 100644 lib/builtins/extenddftf2.c create mode 100644 lib/builtins/extendsfdf2.c create mode 100644 lib/builtins/extendsftf2.c rename lib/{ => builtins}/ffsdi2.c (100%) rename lib/{ => builtins}/ffsti2.c (92%) rename lib/{ => builtins}/fixdfdi.c (98%) rename lib/{ => builtins}/fixdfsi.c (97%) rename lib/{ => builtins}/fixdfti.c (94%) rename lib/{ => builtins}/fixsfdi.c (100%) rename lib/{ => builtins}/fixsfsi.c (100%) rename lib/{ => builtins}/fixsfti.c (94%) rename lib/{ => builtins}/fixunsdfdi.c (100%) rename lib/{ => builtins}/fixunsdfsi.c (100%) rename lib/{ => builtins}/fixunsdfti.c (94%) rename lib/{ => builtins}/fixunssfdi.c (100%) rename lib/{ => builtins}/fixunssfsi.c (100%) rename lib/{ => builtins}/fixunssfti.c (94%) rename lib/{ => builtins}/fixunsxfdi.c (98%) rename lib/{ => builtins}/fixunsxfsi.c (98%) rename lib/{ => builtins}/fixunsxfti.c (95%) rename lib/{ => builtins}/fixxfdi.c (98%) rename lib/{ => builtins}/fixxfti.c (94%) rename lib/{ => builtins}/floatdidf.c (100%) rename lib/{ => builtins}/floatdisf.c (100%) rename lib/{ => builtins}/floatdixf.c (98%) rename lib/{ => builtins}/floatsidf.c (97%) rename lib/{ => builtins}/floatsisf.c (97%) create mode 100644 lib/builtins/floatsitf.c rename lib/{ => builtins}/floattidf.c (97%) rename lib/{ => builtins}/floattisf.c (97%) rename lib/{ => builtins}/floattixf.c (96%) rename lib/{ => builtins}/floatundidf.c (99%) rename lib/{ => builtins}/floatundisf.c (100%) rename lib/{ => builtins}/floatundixf.c (97%) rename lib/{ => builtins}/floatunsidf.c (96%) rename lib/{ => builtins}/floatunsisf.c (96%) create mode 100644 lib/builtins/floatunsitf.c rename lib/{ => builtins}/floatuntidf.c (96%) rename lib/{ => builtins}/floatuntisf.c (97%) rename lib/{ => builtins}/floatuntixf.c (98%) rename lib/{addsf3.c => builtins/fp_add_impl.inc} (91%) create mode 100644 lib/builtins/fp_extend.h rename lib/{extendsfdf2.c => builtins/fp_extend_impl.inc} (76%) create mode 100644 lib/builtins/fp_lib.h rename lib/{muldf3.c => builtins/fp_mul_impl.inc} (89%) create mode 100644 lib/builtins/fp_trunc.h rename lib/{truncdfsf2.c => builtins/fp_trunc_impl.inc} (82%) rename lib/{ => builtins}/gcc_personality_v0.c (87%) rename lib/{ => builtins}/i386/Makefile.mk (90%) rename lib/{ => builtins}/i386/ashldi3.S (94%) rename lib/{ => builtins}/i386/ashrdi3.S (95%) rename lib/{ => builtins}/i386/divdi3.S (99%) rename lib/{ => builtins}/i386/floatdidf.S (83%) rename lib/{ => builtins}/i386/floatdisf.S (95%) rename lib/{ => builtins}/i386/floatdixf.S (95%) rename lib/{ => builtins}/i386/floatundidf.S (85%) rename lib/{ => builtins}/i386/floatundisf.S (88%) rename lib/{ => builtins}/i386/floatundixf.S (79%) rename lib/{ => builtins}/i386/lshrdi3.S (94%) rename lib/{ => builtins}/i386/moddi3.S (99%) rename lib/{ => builtins}/i386/muldi3.S (93%) rename lib/{ => builtins}/i386/udivdi3.S (98%) rename lib/{ => builtins}/i386/umoddi3.S (98%) rename lib/{ => builtins}/int_endianness.h (90%) rename lib/{ => builtins}/int_lib.h (60%) rename lib/{ => builtins}/int_math.h (100%) rename lib/{ => builtins}/int_types.h (96%) rename lib/{ => builtins}/int_util.c (100%) rename lib/{ => builtins}/int_util.h (94%) rename lib/{ => builtins}/lshrdi3.c (100%) rename lib/{ => builtins}/lshrti3.c (94%) rename lib/{ => builtins}/moddi3.c (83%) rename lib/{ => builtins}/modsi3.c (92%) rename lib/{ => builtins}/modti3.c (82%) rename lib/{ => builtins}/muldc3.c (98%) create mode 100644 lib/builtins/muldf3.c rename lib/{ => builtins}/muldi3.c (100%) rename lib/{ => builtins}/mulodi4.c (98%) rename lib/{ => builtins}/mulosi4.c (98%) rename lib/{ => builtins}/muloti4.c (95%) rename lib/{ => builtins}/mulsc3.c (98%) create mode 100644 lib/builtins/mulsf3.c create mode 100644 lib/builtins/multf3.c rename lib/{ => builtins}/multi3.c (95%) rename lib/{ => builtins}/mulvdi3.c (98%) rename lib/{ => builtins}/mulvsi3.c (98%) rename lib/{ => builtins}/mulvti3.c (94%) rename lib/{ => builtins}/mulxc3.c (98%) rename lib/{ => builtins}/negdf2.c (93%) rename lib/{ => builtins}/negdi2.c (96%) rename lib/{ => builtins}/negsf2.c (100%) rename lib/{ => builtins}/negti2.c (90%) rename lib/{ => builtins}/negvdi2.c (100%) rename lib/{ => builtins}/negvsi2.c (100%) rename lib/{ => builtins}/negvti2.c (91%) rename lib/{ => builtins}/paritydi2.c (93%) rename lib/{ => builtins}/paritysi2.c (100%) rename lib/{ => builtins}/parityti2.c (90%) rename lib/{ => builtins}/popcountdi2.c (100%) rename lib/{ => builtins}/popcountsi2.c (100%) rename lib/{ => builtins}/popcountti2.c (95%) rename lib/{ => builtins}/powidf2.c (100%) rename lib/{ => builtins}/powisf2.c (100%) rename lib/{ => builtins}/powitf2.c (96%) rename lib/{ => builtins}/powixf2.c (96%) rename lib/{ => builtins}/ppc/DD.h (97%) rename lib/{ => builtins}/ppc/Makefile.mk (90%) rename lib/{ => builtins}/ppc/divtc3.c (100%) rename lib/{ => builtins}/ppc/fixtfdi.c (97%) rename lib/{ => builtins}/ppc/fixunstfdi.c (100%) rename lib/{ => builtins}/ppc/floatditf.c (100%) rename lib/{ => builtins}/ppc/floatunditf.c (100%) rename lib/{ => builtins}/ppc/gcc_qadd.c (95%) rename lib/{ => builtins}/ppc/gcc_qdiv.c (100%) rename lib/{ => builtins}/ppc/gcc_qmul.c (100%) rename lib/{ => builtins}/ppc/gcc_qsub.c (95%) rename lib/{ => builtins}/ppc/multc3.c (100%) rename lib/{ => builtins}/ppc/restFP.S (100%) rename lib/{ => builtins}/ppc/saveFP.S (100%) rename lib/{ => builtins}/subdf3.c (94%) rename lib/{ => builtins}/subsf3.c (94%) create mode 100644 lib/builtins/subtf3.c rename lib/{ => builtins}/subvdi3.c (95%) rename lib/{ => builtins}/subvsi3.c (95%) rename lib/{ => builtins}/subvti3.c (87%) rename lib/{ => builtins}/trampoline_setup.c (92%) create mode 100644 lib/builtins/truncdfsf2.c create mode 100644 lib/builtins/trunctfdf2.c create mode 100644 lib/builtins/trunctfsf2.c rename lib/{ => builtins}/ucmpdi2.c (100%) rename lib/{ => builtins}/ucmpti2.c (92%) rename lib/{ => builtins}/udivdi3.c (90%) rename lib/{ => builtins}/udivmoddi4.c (65%) rename lib/{ => builtins}/udivmodsi4.c (91%) rename lib/{ => builtins}/udivmodti4.c (64%) rename lib/{ => builtins}/udivsi3.c (100%) rename lib/{ => builtins}/udivti3.c (86%) rename lib/{ => builtins}/umoddi3.c (90%) rename lib/{ => builtins}/umodsi3.c (92%) rename lib/{ => builtins}/umodti3.c (88%) create mode 100644 lib/builtins/x86_64/Makefile.mk rename lib/{ => builtins}/x86_64/floatdidf.c (100%) rename lib/{ => builtins}/x86_64/floatdisf.c (100%) rename lib/{ => builtins}/x86_64/floatdixf.c (100%) rename lib/{ => builtins}/x86_64/floatundidf.S (85%) rename lib/{ => builtins}/x86_64/floatundisf.S (84%) rename lib/{ => builtins}/x86_64/floatundixf.S (80%) delete mode 100644 lib/clear_cache.c rename lib/dfsan/{libc_ubuntu1204_abilist.txt => libc_ubuntu1404_abilist.txt} (90%) delete mode 100644 lib/dfsan/lit_tests/CMakeLists.txt delete mode 100644 lib/dfsan/lit_tests/custom.c delete mode 100644 lib/dfsan/lit_tests/lit.cfg delete mode 100644 lib/dfsan/lit_tests/lit.site.cfg.in create mode 100755 lib/dfsan/scripts/check_custom_wrappers.sh delete mode 100644 lib/fp_lib.h delete mode 100644 lib/lit.common.configured.in delete mode 100644 lib/lsan/lit_tests/AsanConfig/lit.cfg delete mode 100644 lib/lsan/lit_tests/AsanConfig/lit.site.cfg.in delete mode 100644 lib/lsan/lit_tests/CMakeLists.txt delete mode 100644 lib/lsan/lit_tests/LsanConfig/lit.cfg delete mode 100644 lib/lsan/lit_tests/LsanConfig/lit.site.cfg.in delete mode 100644 lib/lsan/lit_tests/TestCases/SharedLibs/huge_tls_lib_so.cc delete mode 100644 lib/lsan/lit_tests/TestCases/SharedLibs/lit.local.cfg delete mode 100644 lib/lsan/lit_tests/TestCases/leak_check_at_exit.cc delete mode 100644 lib/lsan/lit_tests/TestCases/suppressions_file.cc.supp delete mode 100644 lib/lsan/lit_tests/TestCases/use_tls_dynamic.cc delete mode 100644 lib/lsan/lit_tests/Unit/lit.site.cfg.in delete mode 100644 lib/lsan/lit_tests/lit.common.cfg delete mode 100644 lib/lsan/tests/CMakeLists.txt delete mode 100644 lib/lsan/tests/lsan_dummy_unittest.cc delete mode 100644 lib/lsan/tests/lsan_testlib.cc delete mode 100644 lib/msan/lit_tests/CMakeLists.txt delete mode 100644 lib/msan/lit_tests/SharedLibs/dso-origin-so.cc delete mode 100644 lib/msan/lit_tests/SharedLibs/dso-origin.h delete mode 100644 lib/msan/lit_tests/SharedLibs/lit.local.cfg delete mode 100644 lib/msan/lit_tests/getline.cc delete mode 100644 lib/msan/lit_tests/getline_test_data delete mode 100644 lib/msan/lit_tests/lit.cfg delete mode 100644 lib/msan/lit_tests/lit.site.cfg.in delete mode 100644 lib/msan/lit_tests/no_sanitize_memory.cc delete mode 100644 lib/msan/lit_tests/no_sanitize_memory_prop.cc delete mode 100644 lib/msan/lit_tests/wrap_indirect_calls.cc delete mode 100644 lib/msan/lit_tests/wrap_indirect_calls/caller.cc delete mode 100644 lib/msan/lit_tests/wrap_indirect_calls/lit.local.cfg delete mode 100644 lib/msan/lit_tests/wrap_indirect_calls/one.cc delete mode 100644 lib/msan/lit_tests/wrap_indirect_calls/two.cc delete mode 100644 lib/msan/lit_tests/wrap_indirect_calls/wrapper.cc create mode 100644 lib/msan/msan_allocator.h 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_origin.h create mode 100644 lib/msan/msan_thread.cc create mode 100644 lib/msan/msan_thread.h delete mode 100644 lib/msan/tests/msandr_test_so.cc delete mode 100644 lib/msan/tests/msandr_test_so.h delete mode 100644 lib/msandr/CMakeLists.txt delete mode 100644 lib/msandr/README.txt delete mode 100644 lib/msandr/msandr.cc delete mode 100644 lib/mulsf3.c 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/InstrProfilingPlatformDarwin.c create mode 100644 lib/profile/InstrProfilingPlatformOther.c create mode 100644 lib/profile/InstrProfilingRuntime.cc create mode 100644 lib/sanitizer_common/sanitizer_addrhashmap.h create mode 100644 lib/sanitizer_common/sanitizer_allocator_interface.h create mode 100644 lib/sanitizer_common/sanitizer_asm.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_bitvector.h create mode 100644 lib/sanitizer_common/sanitizer_bvgraph.h create mode 100644 lib/sanitizer_common/sanitizer_common_interceptors_format.inc delete mode 100644 lib/sanitizer_common/sanitizer_common_interceptors_scanf.inc delete mode 100644 lib/sanitizer_common/sanitizer_coverage.cc create mode 100644 lib/sanitizer_common/sanitizer_coverage_libcdep.cc create mode 100644 lib/sanitizer_common/sanitizer_coverage_mapping_libcdep.cc 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_freebsd.h create mode 100644 lib/sanitizer_common/sanitizer_mac.h rename lib/{tsan/lit_tests/SharedLibs/load_shared_lib-so.cc => sanitizer_common/sanitizer_persistent_allocator.cc} (55%) create mode 100644 lib/sanitizer_common/sanitizer_persistent_allocator.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_stackdepotbase.h 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_symbolizer_libbacktrace.cc create mode 100644 lib/sanitizer_common/sanitizer_symbolizer_libbacktrace.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_posix_libcdep.cc create mode 100755 lib/sanitizer_common/scripts/litlint.py create mode 100755 lib/sanitizer_common/scripts/litlint_test.py 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_deadlock_detector_test.cc rename lib/sanitizer_common/tests/{sanitizer_scanf_interceptor_test.cc => sanitizer_format_interceptor_test.cc} (55%) create mode 100644 lib/sanitizer_common/tests/sanitizer_pthread_wrappers.h create mode 100644 lib/sanitizer_common/tests/sanitizer_stacktrace_printer_test.cc create mode 100644 lib/sanitizer_common/tests/sanitizer_test_config.h create mode 100755 lib/tsan/check_memcpy.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 delete mode 100644 lib/tsan/lit_tests/CMakeLists.txt delete mode 100644 lib/tsan/lit_tests/Helpers/blacklist.txt delete mode 100644 lib/tsan/lit_tests/Helpers/lit.local.cfg delete mode 100644 lib/tsan/lit_tests/SharedLibs/lit.local.cfg delete mode 100644 lib/tsan/lit_tests/Unit/lit.cfg delete mode 100644 lib/tsan/lit_tests/Unit/lit.site.cfg.in delete mode 100644 lib/tsan/lit_tests/global_race.cc delete mode 100644 lib/tsan/lit_tests/java_race.cc delete mode 100644 lib/tsan/lit_tests/lit.cfg delete mode 100644 lib/tsan/lit_tests/oob_race.cc delete mode 100644 lib/tsan/lit_tests/thread_end_with_ignore.cc delete mode 100644 lib/tsan/lit_tests/thread_end_with_ignore2.cc create mode 100644 lib/tsan/rtl/tsan_dense_alloc.h 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_stack_trace.cc create mode 100644 lib/tsan/rtl/tsan_stack_trace.h delete mode 100644 lib/tsan/rtl/tsan_symbolize_addr2line_linux.cc create mode 100644 lib/tsan/tests/unit/tsan_dense_alloc_test.cc delete mode 100644 lib/ubsan/lit_tests/AsanConfig/lit.cfg delete mode 100644 lib/ubsan/lit_tests/AsanConfig/lit.site.cfg.in delete mode 100644 lib/ubsan/lit_tests/CMakeLists.txt delete mode 100644 lib/ubsan/lit_tests/TestCases/Misc/bounds.cpp delete mode 100644 lib/ubsan/lit_tests/TestCases/Misc/missing_return.cpp delete mode 100644 lib/ubsan/lit_tests/TestCases/TypeCheck/Function/function.cpp delete mode 100644 lib/ubsan/lit_tests/TestCases/TypeCheck/vptr.cpp delete mode 100644 lib/ubsan/lit_tests/UbsanConfig/lit.cfg delete mode 100644 lib/ubsan/lit_tests/UbsanConfig/lit.site.cfg.in delete mode 100644 lib/ubsan/lit_tests/lit.common.cfg create mode 100644 lib/ubsan/ubsan_flags.cc create mode 100644 lib/ubsan/ubsan_flags.h create mode 100644 lib/ubsan/ubsan_init.cc create mode 100644 lib/ubsan/ubsan_init.h rename make/platform/{clang_darwin_embedded.mk => clang_macho_embedded.mk} (78%) rename lib/asan/lit_tests/TestCases/Linux/glob_test_root/aa => make/platform/clang_macho_embedded_test_input.c (100%) rename {BlocksRuntime/tests => test/BlocksRuntime}/block-static.c (100%) rename {BlocksRuntime/tests => test/BlocksRuntime}/blockimport.c (100%) rename {BlocksRuntime/tests => test/BlocksRuntime}/byrefaccess.c (100%) rename {BlocksRuntime/tests => test/BlocksRuntime}/byrefcopy.c (100%) rename {BlocksRuntime/tests => test/BlocksRuntime}/byrefcopycopy.c (100%) rename {BlocksRuntime/tests => test/BlocksRuntime}/byrefcopyinner.c (100%) rename {BlocksRuntime/tests => test/BlocksRuntime}/byrefcopyint.c (100%) rename {BlocksRuntime/tests => test/BlocksRuntime}/byrefcopystack.c (100%) rename {BlocksRuntime/tests => test/BlocksRuntime}/byrefsanity.c (100%) rename {BlocksRuntime/tests => test/BlocksRuntime}/byrefstruct.c (100%) rename {BlocksRuntime/tests => test/BlocksRuntime}/c99.c (100%) rename {BlocksRuntime/tests => test/BlocksRuntime}/cast.c (100%) rename {BlocksRuntime/tests => test/BlocksRuntime}/constassign.c (100%) rename {BlocksRuntime/tests => test/BlocksRuntime}/copy-block-literal-rdar6439600.c (100%) rename {BlocksRuntime/tests => test/BlocksRuntime}/copyconstructor.C (100%) rename {BlocksRuntime/tests => test/BlocksRuntime}/copynull.c (100%) rename {BlocksRuntime/tests => test/BlocksRuntime}/dispatch_async.c (100%) rename {BlocksRuntime/tests => test/BlocksRuntime}/dispatch_call_Block_with_release.c (100%) rename {BlocksRuntime/tests => test/BlocksRuntime}/fail.c (100%) rename {BlocksRuntime/tests => test/BlocksRuntime}/flagsisa.c (100%) rename {BlocksRuntime/tests => test/BlocksRuntime}/globalexpression.c (100%) rename {BlocksRuntime/tests => test/BlocksRuntime}/goto.c (100%) rename {BlocksRuntime/tests => test/BlocksRuntime}/hasdescriptor.c (100%) rename {BlocksRuntime/tests => test/BlocksRuntime}/josh.C (100%) rename {BlocksRuntime/tests => test/BlocksRuntime}/k-and-r.c (100%) rename {BlocksRuntime/tests => test/BlocksRuntime}/large-struct.c (100%) rename {BlocksRuntime/tests => test/BlocksRuntime}/localisglobal.c (100%) rename {BlocksRuntime/tests => test/BlocksRuntime}/macro.c (100%) rename {BlocksRuntime/tests => test/BlocksRuntime}/makefile (100%) rename {BlocksRuntime/tests => test/BlocksRuntime}/modglobal.c (100%) rename {BlocksRuntime/tests => test/BlocksRuntime}/nestedimport.c (100%) rename {BlocksRuntime/tests => test/BlocksRuntime}/nullblockisa.c (100%) rename {BlocksRuntime/tests => test/BlocksRuntime}/objectRRGC.c (100%) rename {BlocksRuntime/tests => test/BlocksRuntime}/objectassign.c (100%) rename {BlocksRuntime/tests => test/BlocksRuntime}/orbars.c (100%) rename {BlocksRuntime/tests => test/BlocksRuntime}/rdar6396238.c (100%) rename {BlocksRuntime/tests => test/BlocksRuntime}/rdar6405500.c (100%) rename {BlocksRuntime/tests => test/BlocksRuntime}/rdar6414583.c (100%) rename {BlocksRuntime/tests => test/BlocksRuntime}/recursive-block.c (100%) rename {BlocksRuntime/tests => test/BlocksRuntime}/recursive-test.c (100%) rename {BlocksRuntime/tests => test/BlocksRuntime}/recursiveassign.c (100%) rename {BlocksRuntime/tests => test/BlocksRuntime}/reference.C (100%) rename {BlocksRuntime/tests => test/BlocksRuntime}/rettypepromotion.c (100%) rename {BlocksRuntime/tests => test/BlocksRuntime}/returnfunctionptr.c (100%) rename {BlocksRuntime/tests => test/BlocksRuntime}/shorthandexpression.c (100%) rename {BlocksRuntime/tests => test/BlocksRuntime}/sizeof.c (100%) rename {BlocksRuntime/tests => test/BlocksRuntime}/small-struct.c (100%) rename {BlocksRuntime/tests => test/BlocksRuntime}/structmember.c (100%) rename {BlocksRuntime/tests => test/BlocksRuntime}/testfilerunner.h (100%) rename {BlocksRuntime/tests => test/BlocksRuntime}/testfilerunner.m (100%) rename {BlocksRuntime/tests => test/BlocksRuntime}/varargs-bad-assign.c (100%) rename {BlocksRuntime/tests => test/BlocksRuntime}/varargs.c (100%) rename {BlocksRuntime/tests => test/BlocksRuntime}/variadic.c (100%) rename {BlocksRuntime/tests => test/BlocksRuntime}/voidarg.c (100%) create mode 100644 test/CMakeLists.txt create mode 100644 test/asan/CMakeLists.txt create mode 100644 test/asan/TestCases/Android/coverage-android.cc create mode 100644 test/asan/TestCases/Android/lit.local.cfg create mode 100644 test/asan/TestCases/Darwin/asan_gen_prefixes.cc create mode 100644 test/asan/TestCases/Darwin/cstring_literals_regtest.mm create mode 100644 test/asan/TestCases/Darwin/dyld_insert_libraries_reexec.cc create mode 100644 test/asan/TestCases/Darwin/interception-in-shared-lib-test.cc rename {lib/asan/lit_tests => test/asan}/TestCases/Darwin/interface_symbols_darwin.c (74%) rename {lib/asan/lit_tests => test/asan}/TestCases/Darwin/lit.local.cfg (100%) rename {lib/asan/lit_tests => test/asan}/TestCases/Darwin/malloc_set_zone_name-mprotect.cc (98%) rename {lib/asan/lit_tests => test/asan}/TestCases/Darwin/malloc_zone-protected.cc (91%) create mode 100644 test/asan/TestCases/Darwin/objc-odr.mm rename {lib/asan/lit_tests => test/asan}/TestCases/Darwin/reexec-insert-libraries-env.cc (79%) create mode 100644 test/asan/TestCases/Darwin/suppressions-darwin.cc rename {lib/asan/lit_tests => test/asan}/TestCases/Darwin/unset-insert-libraries-on-exec.cc (73%) rename {lib/asan/lit_tests => test/asan}/TestCases/Helpers/blacklist-extra.cc (100%) rename {lib/asan/lit_tests => test/asan}/TestCases/Helpers/echo-env.cc (100%) rename {lib/asan/lit_tests => test/asan}/TestCases/Helpers/init-order-atexit-extra.cc (100%) rename {lib/asan/lit_tests => test/asan}/TestCases/Helpers/init-order-pthread-create-extra.cc (100%) rename {lib/asan/lit_tests => test/asan}/TestCases/Helpers/initialization-blacklist-extra.cc (100%) rename {lib/asan/lit_tests => test/asan}/TestCases/Helpers/initialization-blacklist-extra2.cc (100%) rename {lib/asan/lit_tests => test/asan}/TestCases/Helpers/initialization-blacklist.txt (100%) rename {lib/asan/lit_tests => test/asan}/TestCases/Helpers/initialization-bug-extra.cc (100%) rename {lib/asan/lit_tests => test/asan}/TestCases/Helpers/initialization-bug-extra2.cc (100%) rename {lib/asan/lit_tests => test/asan}/TestCases/Helpers/initialization-constexpr-extra.cc (100%) rename {lib/asan/lit_tests => test/asan}/TestCases/Helpers/initialization-nobug-extra.cc (100%) rename {lib/asan/lit_tests => test/asan}/TestCases/Helpers/lit.local.cfg (100%) create mode 100644 test/asan/TestCases/Linux/asan-asm-stacktrace-test.cc create mode 100644 test/asan/TestCases/Linux/asan_dlopen_test.cc rename {lib/asan/lit_tests => test/asan}/TestCases/Linux/asan_prelink_test.cc (82%) 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_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/clang_gcc_abi.cc rename {lib/asan/lit_tests => test/asan}/TestCases/Linux/clone_test.cc (79%) create mode 100644 test/asan/TestCases/Linux/coverage-and-lsan.cc create mode 100644 test/asan/TestCases/Linux/coverage-caller-callee-total-count.cc create mode 100644 test/asan/TestCases/Linux/coverage-caller-callee.cc create mode 100644 test/asan/TestCases/Linux/coverage-direct-large.cc create mode 100644 test/asan/TestCases/Linux/coverage-direct.cc create mode 100644 test/asan/TestCases/Linux/coverage-disabled.cc create mode 100644 test/asan/TestCases/Linux/coverage-fork-direct.cc create mode 100644 test/asan/TestCases/Linux/coverage-fork.cc create mode 100644 test/asan/TestCases/Linux/coverage-levels.cc create mode 100644 test/asan/TestCases/Linux/coverage-maybe-open-file.cc create mode 100644 test/asan/TestCases/Linux/coverage-module-unloaded.cc create mode 100644 test/asan/TestCases/Linux/coverage-sandboxing.cc create mode 100644 test/asan/TestCases/Linux/coverage-tracing.cc create mode 100644 test/asan/TestCases/Linux/coverage.cc create mode 100644 test/asan/TestCases/Linux/function-sections-are-bad.cc create mode 100644 test/asan/TestCases/Linux/globals-gc-sections.cc rename {lib/asan/lit_tests => test/asan}/TestCases/Linux/initialization-bug-any-order.cc (89%) create mode 100644 test/asan/TestCases/Linux/interception-in-shared-lib-test.cc rename {lib/asan/lit_tests => test/asan}/TestCases/Linux/interception_malloc_test.cc (62%) rename {lib/asan/lit_tests => test/asan}/TestCases/Linux/interception_readdir_r_test.cc (75%) rename {lib/asan/lit_tests => test/asan}/TestCases/Linux/interception_test.cc (65%) rename {lib/asan/lit_tests => test/asan}/TestCases/Linux/interface_symbols_linux.c (76%) create mode 100644 test/asan/TestCases/Linux/kernel-area.cc create mode 100644 test/asan/TestCases/Linux/leak.cc rename {lib/asan/lit_tests => test/asan}/TestCases/Linux/lit.local.cfg (100%) rename {lib/asan/lit_tests => test/asan}/TestCases/Linux/malloc-in-qsort.cc (84%) rename {lib/asan/lit_tests => test/asan}/TestCases/Linux/malloc_delete_mismatch.cc (70%) create mode 100644 test/asan/TestCases/Linux/odr-violation.cc rename {lib/asan/lit_tests => test/asan}/TestCases/Linux/overflow-in-qsort.cc (83%) rename {lib/asan/lit_tests => test/asan}/TestCases/Linux/preinit_test.cc (82%) rename {lib/asan/lit_tests => test/asan}/TestCases/Linux/ptrace.cc (80%) rename {lib/asan/lit_tests => test/asan}/TestCases/Linux/rlimit_mmap_test.cc (84%) create mode 100644 test/asan/TestCases/Linux/shmctl.cc create mode 100644 test/asan/TestCases/Linux/sized_delete_test.cc create mode 100644 test/asan/TestCases/Linux/stack-trace-dlclose.cc create mode 100644 test/asan/TestCases/Linux/stress_dtls.c rename {lib/asan/lit_tests => test/asan}/TestCases/Linux/swapcontext_test.cc (89%) rename {lib/asan/lit_tests => test/asan}/TestCases/Linux/syscalls.cc (69%) rename {lib/asan/lit_tests => test/asan}/TestCases/Linux/uar_signals.cc (88%) rename {lib/asan/lit_tests => test/asan}/TestCases/Linux/unpoison_tls.cc (92%) rename {lib/asan/lit_tests/TestCases => test/asan/TestCases/Posix}/allow_user_segv.cc (51%) rename {lib/asan/lit_tests/TestCases => test/asan/TestCases/Posix}/asan-symbolize-sanity-test.cc (60%) create mode 100644 test/asan/TestCases/Posix/asprintf.cc create mode 100644 test/asan/TestCases/Posix/assign_large_valloc_to_global.cc rename {lib/asan/lit_tests/TestCases/Linux => test/asan/TestCases/Posix}/glob.cc (70%) rename {lib/msan/lit_tests/Linux => test/asan/TestCases/Posix}/glob_test_root/aa (100%) rename {lib/asan/lit_tests/TestCases/Linux => test/asan/TestCases/Posix}/glob_test_root/ab (100%) rename {lib/asan/lit_tests/TestCases/Linux => test/asan/TestCases/Posix}/glob_test_root/ba (100%) rename {lib/asan/lit_tests/TestCases => test/asan/TestCases/Posix}/init-order-dlopen.cc (68%) rename {lib/asan/lit_tests/TestCases => test/asan/TestCases/Posix}/ioctl.cc (76%) 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/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 rename {lib/asan/lit_tests/TestCases => test/asan/TestCases/Posix}/readv.cc (81%) create mode 100644 test/asan/TestCases/Posix/shared-lib-test.cc create mode 100644 test/asan/TestCases/Posix/start-deactivated.cc rename {lib/asan/lit_tests/TestCases => test/asan/TestCases/Posix}/strerror_r_test.cc (66%) rename {lib/asan/lit_tests/TestCases/Linux => test/asan/TestCases/Posix}/tsd_dtor_leak.cc (81%) create mode 100644 test/asan/TestCases/Posix/wait.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/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/crt_initializers.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_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_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/global_const_string.cc create mode 100644 test/asan/TestCases/Windows/global_const_string_oob.cc 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/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/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/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/seh.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/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/throw_catch.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_detect_custom_size_.cc create mode 100644 test/asan/TestCases/alloca_instruments_all_paddings.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 rename {lib/asan/lit_tests => test/asan}/TestCases/allocator_returns_null.cc (62%) create mode 100644 test/asan/TestCases/asan_and_llvm_coverage_test.cc rename {lib/asan/lit_tests => test/asan}/TestCases/atexit_stats.cc (51%) rename {lib/asan/lit_tests => test/asan}/TestCases/blacklist.cc (83%) create mode 100644 test/asan/TestCases/contiguous_container.cc create mode 100644 test/asan/TestCases/contiguous_container_crash.cc rename {lib/asan/lit_tests => test/asan}/TestCases/current_allocated_bytes.cc (70%) 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 rename {lib/asan/lit_tests => test/asan}/TestCases/deep_call_stack.cc (68%) rename {lib/asan/lit_tests => test/asan}/TestCases/deep_stack_uaf.cc (51%) rename {lib/asan/lit_tests => test/asan}/TestCases/deep_tail_call.cc (63%) rename {lib/asan/lit_tests => test/asan}/TestCases/deep_thread_stack.cc (80%) rename {lib/asan/lit_tests => test/asan}/TestCases/default_blacklist.cc (64%) rename {lib/asan/lit_tests => test/asan}/TestCases/default_options.cc (73%) create mode 100644 test/asan/TestCases/describe_address.cc rename {lib/asan/lit_tests => test/asan}/TestCases/dlclose-test.cc (67%) rename {lib/asan/lit_tests => test/asan}/TestCases/double-free.cc (66%) create mode 100644 test/asan/TestCases/dump_instruction_bytes.cc rename {lib/asan/lit_tests => test/asan}/TestCases/force_inline_opt0.cc (69%) rename {lib/asan/lit_tests => test/asan}/TestCases/free_hook_realloc.cc (74%) create mode 100644 test/asan/TestCases/frexp_interceptor.cc create mode 100644 test/asan/TestCases/gc-test.cc rename {lib/asan/lit_tests => test/asan}/TestCases/global-demangle.cc (84%) create mode 100644 test/asan/TestCases/global-location.cc rename {lib/asan/lit_tests => test/asan}/TestCases/global-overflow.cc (64%) 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 rename {lib/asan/lit_tests => test/asan}/TestCases/huge_negative_hea_oob.cc (69%) rename {lib/asan/lit_tests => test/asan}/TestCases/init-order-atexit.cc (76%) rename {lib/asan/lit_tests => test/asan}/TestCases/init-order-pthread-create.cc (87%) rename {lib/asan/lit_tests => test/asan}/TestCases/initialization-blacklist.cc (75%) rename {lib/asan/lit_tests => test/asan}/TestCases/initialization-bug.cc (94%) rename {lib/asan/lit_tests => test/asan}/TestCases/initialization-constexpr.cc (61%) rename {lib/asan/lit_tests => test/asan}/TestCases/initialization-nobug.cc (76%) rename {lib/asan/lit_tests => test/asan}/TestCases/inline.cc (88%) rename {lib/asan/lit_tests/TestCases/Linux => test/asan/TestCases}/interception_failure_test.cc (62%) create mode 100644 test/asan/TestCases/interface_test.cc create mode 100644 test/asan/TestCases/intra-object-overflow.cc rename {lib/asan/lit_tests => test/asan}/TestCases/invalid-free.cc (60%) rename {lib/asan/lit_tests => test/asan}/TestCases/large_func_test.cc (70%) rename {lib/asan/lit_tests => test/asan}/TestCases/log-path_test.cc (62%) rename {lib/asan/lit_tests => test/asan}/TestCases/log_path_fork_test.cc.disabled (87%) create mode 100644 test/asan/TestCases/longjmp.cc rename {lib/asan/lit_tests => test/asan}/TestCases/lsan_annotations.cc (73%) create mode 100644 test/asan/TestCases/malloc_context_size.cc rename {lib/asan/lit_tests => test/asan}/TestCases/malloc_fill.cc (70%) create mode 100644 test/asan/TestCases/max_redzone.cc rename {lib/asan/lit_tests => test/asan}/TestCases/memcmp_strict_test.cc (52%) rename {lib/asan/lit_tests => test/asan}/TestCases/memcmp_test.cc (53%) create mode 100644 test/asan/TestCases/memset_test.cc create mode 100644 test/asan/TestCases/mmap_limit_mb.cc create mode 100644 test/asan/TestCases/no_asan_gen_globals.c create mode 100644 test/asan/TestCases/null_deref.cc rename {lib/asan/lit_tests => test/asan}/TestCases/on_error_callback.cc (62%) rename {lib/asan/lit_tests => test/asan}/TestCases/partial_right.cc (53%) rename {lib/asan/lit_tests => test/asan}/TestCases/poison_partial.cc (57%) rename {lib/asan/lit_tests => test/asan}/TestCases/print_summary.cc (68%) 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 rename {lib/asan/lit_tests => test/asan}/TestCases/sanity_check_pure_c.c (67%) rename {lib/asan/lit_tests => test/asan}/TestCases/sleep_before_dying.c (68%) create mode 100644 test/asan/TestCases/stack-buffer-overflow-with-position.cc create mode 100644 test/asan/TestCases/stack-buffer-overflow.cc rename {lib/asan/lit_tests => test/asan}/TestCases/stack-frame-demangle.cc (86%) rename {lib/asan/lit_tests => test/asan}/TestCases/stack-oob-frames.cc (85%) create mode 100644 test/asan/TestCases/stack-overflow.cc create mode 100644 test/asan/TestCases/stack-use-after-return.cc create mode 100644 test/asan/TestCases/strdup_oob_test.cc rename {lib/asan/lit_tests => test/asan}/TestCases/strip_path_prefix.c (77%) rename {lib/asan/lit_tests => test/asan}/TestCases/strncpy-overflow.cc (62%) 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 rename {lib/asan/lit_tests => test/asan}/TestCases/throw_call_test.cc (79%) create mode 100644 test/asan/TestCases/throw_catch.cc rename {lib/asan/lit_tests => test/asan}/TestCases/throw_invoke_test.cc (84%) rename {lib/asan/lit_tests => test/asan}/TestCases/time_interceptor.cc (51%) rename {lib/asan/lit_tests => test/asan}/TestCases/uar_and_exceptions.cc (84%) rename {lib/asan/lit_tests => test/asan}/TestCases/unaligned_loads_and_stores.cc (74%) create mode 100644 test/asan/TestCases/use-after-delete.cc rename {lib/asan/lit_tests => test/asan}/TestCases/use-after-free-right.cc (59%) create mode 100644 test/asan/TestCases/use-after-free.cc rename {lib/asan/lit_tests => test/asan}/TestCases/use-after-poison.cc (78%) rename {lib/asan/lit_tests => test/asan}/TestCases/use-after-scope-dtor-order.cc (92%) rename {lib/asan/lit_tests => test/asan}/TestCases/use-after-scope-inlined.cc (94%) rename {lib/asan/lit_tests => test/asan}/TestCases/use-after-scope-nobug.cc (92%) rename {lib/asan/lit_tests => test/asan}/TestCases/use-after-scope-temp.cc (93%) rename {lib/asan/lit_tests => test/asan}/TestCases/use-after-scope.cc (74%) 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/android_commands/android_common.py create mode 100755 test/asan/android_commands/android_compile.py create mode 100755 test/asan/android_commands/android_run.py create mode 100644 test/asan/lit.cfg create mode 100644 test/asan/lit.site.cfg.in rename test/{ => builtins}/Unit/absvdi2_test.c (100%) rename test/{ => builtins}/Unit/absvsi2_test.c (100%) rename test/{ => builtins}/Unit/absvti2_test.c (98%) rename test/{ => builtins}/Unit/adddf3vfp_test.c (100%) rename test/{ => builtins}/Unit/addsf3vfp_test.c (100%) create mode 100644 test/builtins/Unit/addtf3_test.c rename test/{ => builtins}/Unit/addvdi3_test.c (100%) rename test/{ => builtins}/Unit/addvsi3_test.c (100%) rename test/{ => builtins}/Unit/addvti3_test.c (98%) rename test/{ => builtins}/Unit/ashldi3_test.c (100%) rename test/{ => builtins}/Unit/ashlti3_test.c (99%) rename test/{ => builtins}/Unit/ashrdi3_test.c (100%) rename test/{ => builtins}/Unit/ashrti3_test.c (99%) rename test/{ => builtins}/Unit/bswapdi2_test.c (100%) rename test/{ => builtins}/Unit/bswapsi2_test.c (100%) rename test/{ => builtins}/Unit/clear_cache_test.c (100%) rename test/{ => builtins}/Unit/clzdi2_test.c (100%) rename test/{ => builtins}/Unit/clzsi2_test.c (100%) rename test/{ => builtins}/Unit/clzti2_test.c (98%) rename test/{ => builtins}/Unit/cmpdi2_test.c (100%) rename test/{ => builtins}/Unit/cmpti2_test.c (98%) rename test/{ => builtins}/Unit/comparedf2_test.c (100%) rename test/{ => builtins}/Unit/comparesf2_test.c (100%) rename test/{ => builtins}/Unit/ctzdi2_test.c (100%) rename test/{ => builtins}/Unit/ctzsi2_test.c (100%) rename test/{ => builtins}/Unit/ctzti2_test.c (98%) rename test/{ => builtins}/Unit/divdc3_test.c (100%) rename test/{ => builtins}/Unit/divdf3vfp_test.c (100%) rename test/{ => builtins}/Unit/divdi3_test.c (100%) rename test/{ => builtins}/Unit/divmodsi4_test.c (100%) rename test/{ => builtins}/Unit/divsc3_test.c (100%) rename test/{ => builtins}/Unit/divsf3vfp_test.c (100%) rename test/{ => builtins}/Unit/divsi3_test.c (100%) rename test/{ => builtins}/Unit/divtc3_test.c (100%) create mode 100644 test/builtins/Unit/divtf3_test.c rename test/{ => builtins}/Unit/divti3_test.c (97%) rename test/{ => builtins}/Unit/divxc3_test.c (100%) rename test/{ => builtins}/Unit/enable_execute_stack_test.c (100%) rename test/{ => builtins}/Unit/endianness.h (100%) rename test/{ => builtins}/Unit/eqdf2vfp_test.c (100%) rename test/{ => builtins}/Unit/eqsf2vfp_test.c (100%) create mode 100644 test/builtins/Unit/eqtf2_test.c rename test/{ => builtins}/Unit/extebdsfdf2vfp_test.c (100%) create mode 100644 test/builtins/Unit/extenddftf2_test.c create mode 100644 test/builtins/Unit/extendsftf2_test.c rename test/{ => builtins}/Unit/ffsdi2_test.c (100%) rename test/{ => builtins}/Unit/ffsti2_test.c (98%) rename test/{ => builtins}/Unit/fixdfdi_test.c (100%) rename test/{ => builtins}/Unit/fixdfsivfp_test.c (100%) rename test/{ => builtins}/Unit/fixdfti_test.c (98%) rename test/{ => builtins}/Unit/fixsfdi_test.c (100%) rename test/{ => builtins}/Unit/fixsfsivfp_test.c (100%) rename test/{ => builtins}/Unit/fixsfti_test.c (98%) rename test/{ => builtins}/Unit/fixunsdfdi_test.c (100%) rename test/{ => builtins}/Unit/fixunsdfsi_test.c (100%) rename test/{ => builtins}/Unit/fixunsdfsivfp_test.c (100%) rename test/{ => builtins}/Unit/fixunsdfti_test.c (98%) rename test/{ => builtins}/Unit/fixunssfdi_test.c (100%) rename test/{ => builtins}/Unit/fixunssfsi_test.c (100%) rename test/{ => builtins}/Unit/fixunssfsivfp_test.c (100%) rename test/{ => builtins}/Unit/fixunssfti_test.c (98%) rename test/{ => builtins}/Unit/fixunstfdi_test.c (100%) rename test/{ => builtins}/Unit/fixunsxfdi_test.c (100%) rename test/{ => builtins}/Unit/fixunsxfsi_test.c (100%) rename test/{ => builtins}/Unit/fixunsxfti_test.c (99%) rename test/{ => builtins}/Unit/fixxfdi_test.c (100%) rename test/{ => builtins}/Unit/fixxfti_test.c (99%) rename test/{ => builtins}/Unit/floatdidf_test.c (100%) rename test/{ => builtins}/Unit/floatdisf_test.c (100%) rename test/{ => builtins}/Unit/floatdixf_test.c (100%) rename test/{ => builtins}/Unit/floatsidfvfp_test.c (100%) rename test/{ => builtins}/Unit/floatsisfvfp_test.c (100%) create mode 100644 test/builtins/Unit/floatsitf_test.c rename test/{ => builtins}/Unit/floattidf_test.c (99%) rename test/{ => builtins}/Unit/floattisf_test.c (98%) rename test/{ => builtins}/Unit/floattixf_test.c (99%) rename test/{ => builtins}/Unit/floatundidf_test.c (100%) rename test/{ => builtins}/Unit/floatundisf_test.c (100%) rename test/{ => builtins}/Unit/floatundixf_test.c (100%) create mode 100644 test/builtins/Unit/floatunsitf_test.c rename test/{ => builtins}/Unit/floatunssidfvfp_test.c (100%) rename test/{ => builtins}/Unit/floatunssisfvfp_test.c (100%) rename test/{ => builtins}/Unit/floatuntidf_test.c (99%) rename test/{ => builtins}/Unit/floatuntisf_test.c (99%) rename test/{ => builtins}/Unit/floatuntixf_test.c (99%) create mode 100644 test/builtins/Unit/fp_test.h rename test/{ => builtins}/Unit/gcc_personality_test.c (100%) rename test/{ => builtins}/Unit/gcc_personality_test_helper.cxx (100%) rename test/{ => builtins}/Unit/gedf2vfp_test.c (100%) rename test/{ => builtins}/Unit/gesf2vfp_test.c (100%) create mode 100644 test/builtins/Unit/getf2_test.c rename test/{ => builtins}/Unit/gtdf2vfp_test.c (100%) rename test/{ => builtins}/Unit/gtsf2vfp_test.c (100%) create mode 100644 test/builtins/Unit/gttf2_test.c rename test/{ => builtins}/Unit/ledf2vfp_test.c (100%) rename test/{ => builtins}/Unit/lesf2vfp_test.c (100%) create mode 100644 test/builtins/Unit/letf2_test.c rename test/{ => builtins}/Unit/lshrdi3_test.c (100%) rename test/{ => builtins}/Unit/lshrti3_test.c (99%) rename test/{ => builtins}/Unit/ltdf2vfp_test.c (100%) rename test/{ => builtins}/Unit/ltsf2vfp_test.c (100%) create mode 100644 test/builtins/Unit/lttf2_test.c rename test/{ => builtins}/Unit/moddi3_test.c (100%) rename test/{ => builtins}/Unit/modsi3_test.c (100%) rename test/{ => builtins}/Unit/modti3_test.c (98%) rename test/{ => builtins}/Unit/muldc3_test.c (100%) rename test/{ => builtins}/Unit/muldf3vfp_test.c (100%) rename test/{ => builtins}/Unit/muldi3_test.c (100%) rename test/{ => builtins}/Unit/mulodi4_test.c (100%) rename test/{ => builtins}/Unit/mulosi4_test.c (100%) rename test/{ => builtins}/Unit/muloti4_test.c (99%) rename test/{ => builtins}/Unit/mulsc3_test.c (100%) rename test/{ => builtins}/Unit/mulsf3vfp_test.c (100%) rename test/{ => builtins}/Unit/multc3_test.c (100%) create mode 100644 test/builtins/Unit/multf3_test.c rename test/{ => builtins}/Unit/multi3_test.c (98%) rename test/{ => builtins}/Unit/mulvdi3_test.c (100%) rename test/{ => builtins}/Unit/mulvsi3_test.c (100%) rename test/{ => builtins}/Unit/mulvti3_test.c (99%) rename test/{ => builtins}/Unit/mulxc3_test.c (100%) rename test/{ => builtins}/Unit/nedf2vfp_test.c (100%) rename test/{ => builtins}/Unit/negdf2vfp_test.c (100%) rename test/{ => builtins}/Unit/negdi2_test.c (100%) rename test/{ => builtins}/Unit/negsf2vfp_test.c (100%) rename test/{ => builtins}/Unit/negti2_test.c (99%) rename test/{ => builtins}/Unit/negvdi2_test.c (100%) rename test/{ => builtins}/Unit/negvsi2_test.c (100%) rename test/{ => builtins}/Unit/negvti2_test.c (98%) rename test/{ => builtins}/Unit/nesf2vfp_test.c (100%) create mode 100644 test/builtins/Unit/netf2_test.c rename test/{ => builtins}/Unit/paritydi2_test.c (100%) rename test/{ => builtins}/Unit/paritysi2_test.c (100%) rename test/{ => builtins}/Unit/parityti2_test.c (97%) rename test/{ => builtins}/Unit/popcountdi2_test.c (100%) rename test/{ => builtins}/Unit/popcountsi2_test.c (100%) rename test/{ => builtins}/Unit/popcountti2_test.c (97%) rename test/{ => builtins}/Unit/powidf2_test.c (100%) rename test/{ => builtins}/Unit/powisf2_test.c (100%) rename test/{ => builtins}/Unit/powitf2_test.c (100%) rename test/{ => builtins}/Unit/powixf2_test.c (100%) rename test/{ => builtins}/Unit/ppc/DD.h (100%) rename test/{ => builtins}/Unit/ppc/fixtfdi_test.c (100%) rename test/{ => builtins}/Unit/ppc/floatditf_test.c (100%) rename test/{ => builtins}/Unit/ppc/floatditf_test.h (100%) rename test/{ => builtins}/Unit/ppc/floatunditf_test.c (100%) rename test/{ => builtins}/Unit/ppc/floatunditf_test.h (100%) rename test/{ => builtins}/Unit/ppc/qadd_test.c (100%) rename test/{ => builtins}/Unit/ppc/qdiv_test.c (100%) rename test/{ => builtins}/Unit/ppc/qmul_test.c (100%) rename test/{ => builtins}/Unit/ppc/qsub_test.c (100%) rename test/{ => builtins}/Unit/ppc/test (100%) rename test/{ => builtins}/Unit/subdf3vfp_test.c (100%) rename test/{ => builtins}/Unit/subsf3vfp_test.c (100%) create mode 100644 test/builtins/Unit/subtf3_test.c rename test/{ => builtins}/Unit/subvdi3_test.c (100%) rename test/{ => builtins}/Unit/subvsi3_test.c (100%) rename test/{ => builtins}/Unit/subvti3_test.c (98%) rename test/{ => builtins}/Unit/test (100%) rename test/{ => builtins}/Unit/trampoline_setup_test.c (100%) rename test/{ => builtins}/Unit/truncdfsf2vfp_test.c (100%) create mode 100644 test/builtins/Unit/trunctfdf2_test.c create mode 100644 test/builtins/Unit/trunctfsf2_test.c rename test/{ => builtins}/Unit/ucmpdi2_test.c (100%) rename test/{ => builtins}/Unit/ucmpti2_test.c (98%) rename test/{ => builtins}/Unit/udivdi3_test.c (100%) rename test/{ => builtins}/Unit/udivmoddi4_test.c (100%) rename test/{ => builtins}/Unit/udivmodsi4_test.c (100%) rename test/{ => builtins}/Unit/udivmodti4_test.c (99%) rename test/{ => builtins}/Unit/udivsi3_test.c (100%) rename test/{ => builtins}/Unit/udivti3_test.c (97%) rename test/{ => builtins}/Unit/umoddi3_test.c (100%) rename test/{ => builtins}/Unit/umodsi3_test.c (100%) rename test/{ => builtins}/Unit/umodti3_test.c (97%) rename test/{ => builtins}/Unit/unorddf2vfp_test.c (100%) rename test/{ => builtins}/Unit/unordsf2vfp_test.c (100%) create mode 100644 test/builtins/Unit/unordtf2_test.c rename test/{ => builtins}/timing/ashldi3.c (100%) rename test/{ => builtins}/timing/ashrdi3.c (100%) rename test/{ => builtins}/timing/divdi3.c (100%) rename test/{ => builtins}/timing/floatdidf.c (100%) rename test/{ => builtins}/timing/floatdisf.c (100%) rename test/{ => builtins}/timing/floatdixf.c (100%) rename test/{ => builtins}/timing/floatundidf.c (100%) rename test/{ => builtins}/timing/floatundisf.c (100%) rename test/{ => builtins}/timing/floatundixf.c (100%) rename test/{ => builtins}/timing/lshrdi3.c (100%) rename test/{ => builtins}/timing/moddi3.c (100%) rename test/{ => builtins}/timing/modsi3.c (100%) rename test/{ => builtins}/timing/muldi3.c (100%) rename test/{ => builtins}/timing/negdi2.c (100%) rename test/{ => builtins}/timing/time (100%) rename test/{ => builtins}/timing/timing.h (100%) rename test/{ => builtins}/timing/udivdi3.c (100%) rename test/{ => builtins}/timing/umoddi3.c (100%) create mode 100644 test/dfsan/CMakeLists.txt rename {lib/dfsan/lit_tests => test/dfsan}/Inputs/flags_abilist.txt (100%) rename {lib/dfsan/lit_tests => test/dfsan}/basic.c (55%) create mode 100644 test/dfsan/custom.cc create mode 100644 test/dfsan/dump_labels.c rename {lib/dfsan/lit_tests => test/dfsan}/flags.c (77%) rename {lib/dfsan/lit_tests => test/dfsan}/fncall.c (82%) create mode 100644 test/dfsan/label_count.c create mode 100644 test/dfsan/lit.cfg create mode 100644 test/dfsan/lit.site.cfg.in rename {lib/dfsan/lit_tests => test/dfsan}/propagate.c (91%) create mode 100644 test/dfsan/vararg.c create mode 100644 test/dfsan/write_callback.c rename {lib => test}/lit.common.cfg (65%) create mode 100644 test/lit.common.configured.in create mode 100644 test/lsan/CMakeLists.txt rename {lib/lsan/lit_tests => test/lsan}/TestCases/cleanup_in_tsd_destructor.cc (88%) rename {lib/lsan/lit_tests => test/lsan}/TestCases/disabler.cc (89%) rename {lib/lsan/lit_tests => test/lsan}/TestCases/disabler_in_tsd_destructor.cc (95%) rename {lib/lsan/lit_tests => test/lsan}/TestCases/do_leak_check_override.cc (83%) rename {lib/lsan/lit_tests => test/lsan}/TestCases/fork.cc (95%) rename {lib/lsan/lit_tests => test/lsan}/TestCases/fork_threaded.cc (97%) rename {lib/lsan/lit_tests => test/lsan}/TestCases/high_allocator_contention.cc (97%) rename {lib/lsan/lit_tests => test/lsan}/TestCases/ignore_object.cc (70%) rename {lib/lsan/lit_tests => test/lsan}/TestCases/ignore_object_errors.cc (89%) rename {lib/lsan/lit_tests => test/lsan}/TestCases/large_allocation_leak.cc (82%) create mode 100644 test/lsan/TestCases/leak_check_at_exit.cc create mode 100644 test/lsan/TestCases/leak_check_before_thread_started.cc rename {lib/lsan/lit_tests => test/lsan}/TestCases/link_turned_off.cc (80%) create mode 100644 test/lsan/TestCases/new_array_with_dtor_0.cc rename {lib/lsan/lit_tests => test/lsan}/TestCases/pointer_to_self.cc (80%) create mode 100644 test/lsan/TestCases/print_suppressions.cc create mode 100644 test/lsan/TestCases/register_root_region.cc rename {lib/lsan/lit_tests => test/lsan}/TestCases/sanity_check_pure_c.c (100%) rename {lib/lsan/lit_tests => test/lsan}/TestCases/stale_stack_leak.cc (83%) rename {lib/lsan/lit_tests => test/lsan}/TestCases/suppressions_default.cc (87%) rename {lib/lsan/lit_tests => test/lsan}/TestCases/suppressions_file.cc (66%) rename {lib/lsan/lit_tests => test/lsan}/TestCases/swapcontext.cc (80%) rename {lib/lsan/lit_tests => test/lsan}/TestCases/use_after_return.cc (81%) rename {lib/lsan/lit_tests => test/lsan}/TestCases/use_globals_initialized.cc (68%) rename {lib/lsan/lit_tests => test/lsan}/TestCases/use_globals_uninitialized.cc (67%) create mode 100644 test/lsan/TestCases/use_poisoned_asan.cc rename {lib/lsan/lit_tests => test/lsan}/TestCases/use_registers.cc (80%) rename {lib/lsan/lit_tests => test/lsan}/TestCases/use_stacks.cc (70%) rename {lib/lsan/lit_tests => test/lsan}/TestCases/use_stacks_threaded.cc (75%) create mode 100644 test/lsan/TestCases/use_tls_dynamic.cc rename {lib/lsan/lit_tests => test/lsan}/TestCases/use_tls_pthread_specific_dynamic.cc (83%) rename {lib/lsan/lit_tests => test/lsan}/TestCases/use_tls_pthread_specific_static.cc (79%) rename {lib/lsan/lit_tests => test/lsan}/TestCases/use_tls_static.cc (69%) rename {lib/lsan/lit_tests => test/lsan}/TestCases/use_unaligned.cc (73%) 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/getresid.cc rename {lib/msan/lit_tests => test/msan}/Linux/glob.cc (77%) rename {lib/msan/lit_tests => test/msan}/Linux/glob_altdirfunc.cc (91%) rename {lib/msan/lit_tests => test/msan}/Linux/glob_nomatch.cc (78%) rename lib/msan/lit_tests/Linux/glob_test_root/ab => test/msan/Linux/glob_test_root/aa (100%) rename lib/msan/lit_tests/Linux/glob_test_root/ba => test/msan/Linux/glob_test_root/ab (100%) rename lib/msan/lit_tests/scandir_test_root/aaa => test/msan/Linux/glob_test_root/ba (100%) rename {lib/msan/lit_tests => test/msan}/Linux/lit.local.cfg (100%) 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 rename {lib/msan/lit_tests => test/msan}/Linux/syscalls.cc (75%) rename {lib/msan/lit_tests => test/msan}/Linux/tcgetattr.cc (85%) create mode 100644 test/msan/Linux/xattr.cc rename lib/msan/lit_tests/scandir_test_root/aab => test/msan/Linux/xattr_test_root/a (100%) rename {lib/msan/lit_tests => test/msan}/Unit/lit.site.cfg.in (60%) rename {lib/msan/lit_tests => test/msan}/allocator_returns_null.cc (63%) rename {lib/msan/lit_tests => test/msan}/backtrace.cc (89%) rename {lib/msan/lit_tests => test/msan}/c-strdup.c (52%) 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 rename {lib/msan/lit_tests => test/msan}/cxa_atexit.cc (89%) create mode 100644 test/msan/death-callback.cc rename {lib/msan/lit_tests => test/msan}/default_blacklist.cc (100%) rename {lib/msan/lit_tests => test/msan}/dlerror.cc (82%) rename {lib/msan/lit_tests => test/msan}/dso-origin.cc (53%) create mode 100644 test/msan/dtls_test.c rename {lib/msan/lit_tests => test/msan}/errno.cc (82%) create mode 100644 test/msan/fork.cc create mode 100644 test/msan/ftime.cc rename {lib/msan/lit_tests => test/msan}/getaddrinfo-positive.cc (68%) rename {lib/msan/lit_tests => test/msan}/getaddrinfo.cc (91%) create mode 100644 test/msan/getc_unlocked.c create mode 100644 test/msan/getline.cc rename {lib/msan/lit_tests => test/msan}/heap-origin.cc (74%) create mode 100644 test/msan/iconv.cc create mode 100644 test/msan/if_indextoname.cc create mode 100644 test/msan/ifaddrs.cc rename {lib/msan/lit_tests => test/msan}/initgroups.cc (81%) rename {lib/msan/lit_tests => test/msan}/inline.cc (87%) rename {lib/msan/lit_tests => test/msan}/insertvalue_origin.cc (92%) rename {lib/msan/lit_tests => test/msan}/ioctl.cc (74%) rename {lib/msan/lit_tests => test/msan}/ioctl_custom.cc (67%) create mode 100644 test/msan/ioctl_sound.cc rename {lib/msan/lit_tests => test/msan}/keep-going-dso.cc (80%) rename {lib/msan/lit_tests => test/msan}/keep-going.cc (75%) create mode 100644 test/msan/lit.cfg create mode 100644 test/msan/lit.site.cfg.in create mode 100644 test/msan/mallinfo.cc create mode 100644 test/msan/mktime.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_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/obstack.cc create mode 100644 test/msan/param_tls_limit.cc rename {lib/msan/lit_tests => test/msan}/poison_in_free.cc (82%) create mode 100644 test/msan/print_stats.cc create mode 100644 test/msan/pthread_getattr_np_deadlock.cc create mode 100644 test/msan/rand_r.cc rename {lib/msan/lit_tests => test/msan}/readdir64.cc (69%) create mode 100644 test/msan/report-demangling.cc rename {lib/msan/lit_tests => test/msan}/scandir.cc (93%) rename {lib/msan/lit_tests => test/msan}/scandir_null.cc (86%) rename lib/msan/lit_tests/scandir_test_root/bbb => test/msan/scandir_test_root/aaa (100%) create mode 100644 test/msan/scandir_test_root/aab create mode 100644 test/msan/scandir_test_root/bbb rename {lib/msan/lit_tests => test/msan}/select.cc (63%) create mode 100644 test/msan/select_float_origin.cc create mode 100644 test/msan/select_origin.cc rename {lib/msan/lit_tests => test/msan}/setlocale.cc (78%) rename {lib/msan/lit_tests => test/msan}/signal_stress_test.cc (96%) rename {lib/msan/lit_tests => test/msan}/sigwait.cc (89%) rename {lib/msan/lit_tests => test/msan}/sigwaitinfo.cc (90%) rename {lib/msan/lit_tests => test/msan}/stack-origin.cc (74%) 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/strxfrm.cc rename {lib/msan/lit_tests => test/msan}/sync_lock_set_and_test.cc (59%) 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 rename {lib/msan/lit_tests => test/msan}/tzset.cc (83%) rename {lib/msan/lit_tests => test/msan}/unaligned_read_origin.cc (90%) create mode 100644 test/msan/unpoison_string.cc rename {lib/msan/lit_tests => test/msan}/use-after-free.cc (74%) rename {lib/msan/lit_tests => test/msan}/vector_cvt.cc (61%) rename {lib/msan/lit_tests => test/msan}/vector_select.cc (100%) create mode 100644 test/profile/CMakeLists.txt 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/instrprof-basic.c create mode 100644 test/profile/instrprof-dlopen.test 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-reset-counters.c create mode 100644 test/profile/instrprof-set-filename.c 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/sanitizer_common/CMakeLists.txt create mode 100644 test/sanitizer_common/TestCases/Linux/aligned_alloc.c create mode 100644 test/sanitizer_common/TestCases/Linux/clock_gettime.c create mode 100644 test/sanitizer_common/TestCases/Linux/getpass.cc create mode 100644 test/sanitizer_common/TestCases/Linux/getpwnam_r_invalid_user.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/open_memstream.cc rename {lib/msan/lit_tests => test/sanitizer_common/TestCases/Linux}/ptrace.cc (52%) create mode 100644 test/sanitizer_common/TestCases/Linux/timerfd.cc create mode 100644 test/sanitizer_common/TestCases/corelimit.cc rename {lib/msan/lit_tests => test/sanitizer_common/TestCases}/malloc_hook.cc (55%) create mode 100644 test/sanitizer_common/TestCases/print-stack-trace.cc create mode 100644 test/sanitizer_common/TestCases/pthread_mutexattr_get.cc rename {lib/sanitizer_common/tests => test/sanitizer_common/Unit}/lit.site.cfg.in (78%) create mode 100644 test/sanitizer_common/lit.common.cfg create mode 100644 test/sanitizer_common/lit.site.cfg.in create mode 100644 test/tsan/CMakeLists.txt create mode 100644 test/tsan/Linux/lit.local.cfg rename {lib/tsan/lit_tests => test/tsan/Linux}/mutex_robust.cc (91%) rename {lib/tsan/lit_tests => test/tsan/Linux}/mutex_robust2.cc (92%) rename {lib/tsan/lit_tests => test/tsan/Linux}/user_fopen.cc (88%) rename {lib/tsan/lit_tests => test/tsan/Linux}/user_malloc.cc (85%) rename {lib/asan/lit_tests => test/tsan}/Unit/lit.site.cfg.in (52%) rename {lib/tsan/lit_tests => test/tsan}/aligned_vs_unaligned_race.cc (92%) rename {lib/tsan/lit_tests => test/tsan}/allocator_returns_null.cc (71%) create mode 100644 test/tsan/atexit.cc create mode 100644 test/tsan/atexit2.cc rename {lib/tsan/lit_tests => test/tsan}/atomic_free.cc (81%) rename {lib/tsan/lit_tests => test/tsan}/atomic_free2.cc (82%) rename {lib/tsan/lit_tests => test/tsan}/atomic_norace.cc (95%) rename {lib/tsan/lit_tests => test/tsan}/atomic_race.cc (95%) rename {lib/tsan/lit_tests => test/tsan}/atomic_stack.cc (88%) 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 rename {lib/tsan/lit_tests => test/tsan}/benign_race.cc (93%) rename {lib/tsan/lit_tests => test/tsan}/blacklist.cc (75%) create mode 100644 test/tsan/blacklist2.cc rename {lib/tsan/lit_tests => test/tsan}/cond.c (94%) create mode 100644 test/tsan/cond_cancel.c rename {lib/tsan/lit_tests => test/tsan}/cond_race.cc (77%) rename {lib/tsan/lit_tests => test/tsan}/cond_version.c (94%) create mode 100644 test/tsan/deadlock_detector_stress_test.cc rename {lib/tsan/lit_tests => test/tsan}/deep_stack1.cc (80%) rename {lib/tsan/lit_tests => test/tsan}/default_options.cc (89%) create mode 100755 test/tsan/deflake.bash create mode 100644 test/tsan/dlclose.cc rename {lib/tsan/lit_tests => test/tsan}/fd_close_norace.cc (89%) rename {lib/tsan/lit_tests => test/tsan}/fd_close_norace2.cc (88%) rename {lib/tsan/lit_tests => test/tsan}/fd_dup_norace.cc (90%) rename {lib/tsan/lit_tests => test/tsan}/fd_location.cc (89%) rename {lib/tsan/lit_tests => test/tsan}/fd_pipe_norace.cc (88%) rename {lib/tsan/lit_tests => test/tsan}/fd_pipe_race.cc (90%) rename {lib/tsan/lit_tests => test/tsan}/fd_socket_connect_norace.cc (93%) rename {lib/tsan/lit_tests => test/tsan}/fd_socket_norace.cc (94%) rename {lib/tsan/lit_tests => test/tsan}/fd_socketpair_norace.cc (90%) rename {lib/tsan/lit_tests => test/tsan}/fd_stdout_race.cc (91%) 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 rename {lib/tsan/lit_tests => test/tsan}/free_race.c (90%) rename {lib/tsan/lit_tests => test/tsan}/free_race.c.supp (100%) rename {lib/tsan/lit_tests => test/tsan}/free_race2.c (88%) 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 rename {lib/tsan/lit_tests => test/tsan}/halt_on_error.cc (83%) rename {lib/tsan/lit_tests => test/tsan}/heap_race.cc (81%) rename {lib/tsan/lit_tests => test/tsan}/ignore_free.cc (92%) rename {lib/tsan/lit_tests => test/tsan}/ignore_lib0.cc (68%) rename {lib/tsan/lit_tests => test/tsan}/ignore_lib0.cc.supp (100%) rename {lib/tsan/lit_tests => test/tsan}/ignore_lib1.cc (85%) rename {lib/tsan/lit_tests => test/tsan}/ignore_lib1.cc.supp (100%) rename {lib/tsan/lit_tests => test/tsan}/ignore_lib2.cc (91%) rename {lib/tsan/lit_tests => test/tsan}/ignore_lib2.cc.supp (100%) rename {lib/tsan/lit_tests => test/tsan}/ignore_lib3.cc (90%) rename {lib/tsan/lit_tests => test/tsan}/ignore_lib3.cc.supp (100%) rename {lib/tsan/lit_tests => test/tsan}/ignore_lib_lib.h (100%) rename {lib/tsan/lit_tests => test/tsan}/ignore_malloc.cc (92%) rename {lib/tsan/lit_tests => test/tsan}/ignore_race.cc (92%) rename {lib/tsan/lit_tests => test/tsan}/ignore_sync.cc (89%) create mode 100644 test/tsan/inlined_memcpy_race.cc rename lib/tsan/lit_tests/inlined_memcpy_race.cc => test/tsan/inlined_memcpy_race2.cc (57%) create mode 100644 test/tsan/interface_atomic_test.c rename {lib/tsan/lit_tests => test/tsan}/java.h (95%) rename {lib/tsan/lit_tests => test/tsan}/java_alloc.cc (71%) create mode 100644 test/tsan/java_finalizer.cc rename {lib/tsan/lit_tests => test/tsan}/java_lock.cc (63%) rename {lib/tsan/lit_tests => test/tsan}/java_lock_move.cc (73%) rename {lib/tsan/lit_tests => test/tsan}/java_lock_rec.cc (77%) rename {lib/tsan/lit_tests => test/tsan}/java_lock_rec_race.cc (74%) 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 rename {lib/tsan/lit_tests => test/tsan}/java_race_move.cc (66%) rename {lib/tsan/lit_tests => test/tsan}/java_rwlock.cc (64%) 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 rename {lib/tsan/lit_tests => test/tsan}/lit.site.cfg.in (65%) rename {lib/tsan/lit_tests => test/tsan}/load_shared_lib.cc (66%) rename {lib/tsan/lit_tests => test/tsan}/longjmp.cc (81%) rename {lib/tsan/lit_tests => test/tsan}/longjmp2.cc (84%) rename {lib/tsan/lit_tests => test/tsan}/longjmp3.cc (91%) rename {lib/tsan/lit_tests => test/tsan}/longjmp4.cc (92%) rename {lib/tsan/lit_tests => test/tsan}/malloc_overflow.cc (87%) rename {lib/tsan/lit_tests => test/tsan}/malloc_stack.cc (87%) create mode 100644 test/tsan/map32bit.cc rename {lib/tsan/lit_tests => test/tsan}/memcpy_race.cc (93%) create mode 100644 test/tsan/mmap_large.cc rename {lib/tsan/lit_tests => test/tsan}/mop_with_offset.cc (91%) rename {lib/tsan/lit_tests => test/tsan}/mop_with_offset2.cc (91%) create mode 100644 test/tsan/must_deadlock.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 rename {lib/tsan/lit_tests => test/tsan}/mutex_destroy_locked.cc (88%) create mode 100644 test/tsan/mutex_double_lock.cc rename {lib/tsan/lit_tests => test/tsan}/mutexset1.cc (87%) rename {lib/tsan/lit_tests => test/tsan}/mutexset2.cc (87%) rename {lib/tsan/lit_tests => test/tsan}/mutexset3.cc (86%) rename {lib/tsan/lit_tests => test/tsan}/mutexset4.cc (86%) rename {lib/tsan/lit_tests => test/tsan}/mutexset5.cc (87%) rename {lib/tsan/lit_tests => test/tsan}/mutexset6.cc (86%) rename {lib/tsan/lit_tests => test/tsan}/mutexset7.cc (74%) rename {lib/tsan/lit_tests => test/tsan}/mutexset8.cc (87%) create mode 100644 test/tsan/printf-1.c create mode 100644 test/tsan/process_sleep.h create mode 100644 test/tsan/pthread_atfork_deadlock.c rename {lib/tsan/lit_tests => test/tsan}/race_on_barrier.c (88%) rename {lib/tsan/lit_tests => test/tsan}/race_on_barrier2.c (89%) rename {lib/tsan/lit_tests => test/tsan}/race_on_heap.cc (91%) rename {lib/tsan/lit_tests => test/tsan}/race_on_mutex.c (93%) rename {lib/tsan/lit_tests => test/tsan}/race_on_mutex2.c (87%) create mode 100644 test/tsan/race_on_puts.cc rename {lib/tsan/lit_tests => test/tsan}/race_on_read.cc (69%) create mode 100644 test/tsan/race_on_speculative_load.cc rename {lib/tsan/lit_tests => test/tsan}/race_on_write.cc (90%) rename {lib/tsan/lit_tests => test/tsan}/race_with_finished_thread.cc (92%) rename {lib/tsan/lit_tests => test/tsan}/signal_errno.cc (77%) create mode 100644 test/tsan/signal_longjmp.cc rename {lib/tsan/lit_tests => test/tsan}/signal_malloc.cc (76%) create mode 100644 test/tsan/signal_recursive.cc create mode 100644 test/tsan/signal_sync.cc create mode 100644 test/tsan/signal_write.cc rename {lib/tsan/lit_tests => test/tsan}/sigsuspend.cc (86%) rename {lib/tsan/lit_tests => test/tsan}/simple_race.c (80%) rename {lib/tsan/lit_tests => test/tsan}/simple_race.cc (79%) rename {lib/tsan/lit_tests => test/tsan}/simple_stack.c (92%) rename {lib/tsan/lit_tests => test/tsan}/simple_stack2.cc (74%) rename {lib/tsan/lit_tests => test/tsan}/sleep_sync.cc (87%) rename {lib/tsan/lit_tests => test/tsan}/sleep_sync2.cc (81%) rename {lib/tsan/lit_tests => test/tsan}/stack_race.cc (75%) rename {lib/tsan/lit_tests => test/tsan}/stack_race2.cc (84%) rename {lib/tsan/lit_tests => test/tsan}/static_init1.cc (87%) rename {lib/tsan/lit_tests => test/tsan}/static_init2.cc (89%) rename {lib/tsan/lit_tests => test/tsan}/static_init3.cc (91%) rename {lib/tsan/lit_tests => test/tsan}/static_init4.cc (89%) rename {lib/tsan/lit_tests => test/tsan}/static_init5.cc (91%) rename {lib/tsan/lit_tests => test/tsan}/static_init6.cc (89%) create mode 100644 test/tsan/sunrpc.cc rename {lib/tsan/lit_tests => test/tsan}/suppress_same_address.cc (72%) rename {lib/tsan/lit_tests => test/tsan}/suppress_same_stacks.cc (87%) rename {lib/tsan/lit_tests => test/tsan}/suppressions_global.cc (91%) rename {lib/tsan/lit_tests => test/tsan}/suppressions_global.cc.supp (100%) rename {lib/tsan/lit_tests => test/tsan}/suppressions_race.cc (92%) rename {lib/tsan/lit_tests => test/tsan}/suppressions_race.cc.supp (100%) rename {lib/tsan/lit_tests => test/tsan}/suppressions_race2.cc (92%) rename {lib/tsan/lit_tests => test/tsan}/suppressions_race2.cc.supp (100%) rename {lib/tsan/lit_tests => test/tsan}/test_output.sh (68%) create mode 100644 test/tsan/thread_detach.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 rename {lib/tsan/lit_tests => test/tsan}/thread_leak.c (79%) rename {lib/tsan/lit_tests => test/tsan}/thread_leak2.c (79%) rename {lib/tsan/lit_tests => test/tsan}/thread_leak3.c (80%) rename {lib/tsan/lit_tests => test/tsan}/thread_leak4.c (80%) rename {lib/tsan/lit_tests => test/tsan}/thread_leak5.c (64%) rename {lib/tsan/lit_tests => test/tsan}/thread_name.cc (67%) rename {lib/tsan/lit_tests => test/tsan}/thread_name2.cc (76%) rename {lib/tsan/lit_tests => test/tsan}/tiny_race.c (81%) rename {lib/tsan/lit_tests => test/tsan}/tls_race.cc (76%) rename {lib/tsan/lit_tests => test/tsan}/tls_race2.cc (84%) rename {lib/tsan/lit_tests => test/tsan}/tsan-vs-gvn.cc (74%) rename {lib/tsan/lit_tests => test/tsan}/unaligned_norace.cc (96%) rename {lib/tsan/lit_tests => test/tsan}/unaligned_race.cc (74%) create mode 100644 test/tsan/vfork.cc rename {lib/tsan/lit_tests => test/tsan}/virtual_inheritance_compile_bug.cc (87%) rename {lib/tsan/lit_tests => test/tsan}/vptr_benign_race.cc (91%) rename {lib/tsan/lit_tests => test/tsan}/vptr_harmful_race.cc (91%) rename {lib/tsan/lit_tests => test/tsan}/vptr_harmful_race2.cc (91%) create mode 100644 test/tsan/vptr_harmful_race3.cc create mode 100644 test/tsan/vptr_harmful_race4.cc rename {lib/tsan/lit_tests => test/tsan}/write_in_reader_lock.cc (92%) create mode 100644 test/ubsan/CMakeLists.txt rename {lib/ubsan/lit_tests => test/ubsan}/TestCases/Float/cast-overflow.cpp (64%) rename {lib/ubsan/lit_tests => test/ubsan}/TestCases/Integer/add-overflow.cpp (84%) rename {lib/ubsan/lit_tests => test/ubsan}/TestCases/Integer/div-overflow.cpp (90%) rename {lib/ubsan/lit_tests => test/ubsan}/TestCases/Integer/div-zero.cpp (72%) rename {lib/ubsan/lit_tests => test/ubsan}/TestCases/Integer/incdec-overflow.cpp (77%) rename {lib/ubsan/lit_tests => test/ubsan}/TestCases/Integer/mul-overflow.cpp (94%) rename {lib/ubsan/lit_tests => test/ubsan}/TestCases/Integer/negate-overflow.cpp (85%) rename {lib/ubsan/lit_tests => test/ubsan}/TestCases/Integer/no-recover.cpp (83%) rename {lib/ubsan/lit_tests => test/ubsan}/TestCases/Integer/shift.cpp (65%) rename {lib/ubsan/lit_tests => test/ubsan}/TestCases/Integer/sub-overflow.cpp (84%) create mode 100644 test/ubsan/TestCases/Integer/summary.cpp rename {lib/ubsan/lit_tests => test/ubsan}/TestCases/Integer/uadd-overflow.cpp (84%) rename {lib/ubsan/lit_tests => test/ubsan}/TestCases/Integer/uincdec-overflow.cpp (71%) rename {lib/ubsan/lit_tests => test/ubsan}/TestCases/Integer/umul-overflow.cpp (95%) rename {lib/ubsan/lit_tests => test/ubsan}/TestCases/Integer/usub-overflow.cpp (84%) rename {lib/ubsan/lit_tests => test/ubsan}/TestCases/Misc/bool.cpp (70%) create mode 100644 test/ubsan/TestCases/Misc/bounds.cpp rename {lib/ubsan/lit_tests => test/ubsan}/TestCases/Misc/deduplication.cpp (83%) rename {lib/ubsan/lit_tests => test/ubsan}/TestCases/Misc/enum.cpp (75%) create mode 100644 test/ubsan/TestCases/Misc/missing_return.cpp create mode 100644 test/ubsan/TestCases/Misc/nonnull-arg.cpp create mode 100644 test/ubsan/TestCases/Misc/nonnull.cpp rename {lib/ubsan/lit_tests => test/ubsan}/TestCases/Misc/unreachable.cpp (63%) rename {lib/ubsan/lit_tests => test/ubsan}/TestCases/Misc/vla.c (69%) create mode 100644 test/ubsan/TestCases/TypeCheck/Function/function.cpp rename {lib/ubsan/lit_tests => test/ubsan}/TestCases/TypeCheck/Function/lit.local.cfg (100%) rename {lib/ubsan/lit_tests => test/ubsan}/TestCases/TypeCheck/misaligned.cpp (51%) rename {lib/ubsan/lit_tests => test/ubsan}/TestCases/TypeCheck/null.cpp (70%) 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 unittests/CMakeLists.txt rename {lib => unittests}/lit.common.unit.cfg (100%) rename {lib => unittests}/lit.common.unit.configured.in (81%) diff --git a/.arcconfig b/.arcconfig index 413b70b05f7..ef3e3276aef 100644 --- a/.arcconfig +++ b/.arcconfig @@ -1,4 +1,4 @@ { "project_id" : "compiler-rt", - "conduit_uri" : "http://llvm-reviews.chandlerc.com/" + "conduit_uri" : "http://reviews.llvm.org/" } diff --git a/.gitignore b/.gitignore index 7c534314923..2a7bdd6a891 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ darwin_fat clang_darwin multi_arch +*.sw? diff --git a/CMakeLists.txt b/CMakeLists.txt index a4424086c69..a6a4ed96105 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,49 +1,166 @@ # CMake build for CompilerRT. # # This build assumes that CompilerRT is checked out into the -# 'projects/compiler-rt' inside of an LLVM tree, it is not a stand-alone build -# system. +# 'projects/compiler-rt' inside of an LLVM tree. +# Standalone build system for CompilerRT is not yet ready. # # An important constraint of the build is that it only produces libraries # based on the ability of the host toolchain to target various platforms. -include(LLVMParseArguments) +# Check if compiler-rt is built as a standalone project. +if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) + project(CompilerRT C CXX) + set(COMPILER_RT_STANDALONE_BUILD TRUE) +else() + set(COMPILER_RT_STANDALONE_BUILD FALSE) +endif() # 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. -cmake_minimum_required(VERSION 2.8.8) +if (NOT MSVC) + cmake_minimum_required(VERSION 2.8.8) +else() + # Version 2.8.12.1 is required to build with Visual Studion 2013. + cmake_minimum_required(VERSION 2.8.12.1) +endif() + +# FIXME: It may be removed when we use 2.8.12. +if(CMAKE_VERSION VERSION_LESS 2.8.12) + # Invalidate a couple of keywords. + set(cmake_2_8_12_INTERFACE) + set(cmake_2_8_12_PRIVATE) +else() + # Use ${cmake_2_8_12_KEYWORD} intead of KEYWORD in target_link_libraries(). + set(cmake_2_8_12_INTERFACE INTERFACE) + set(cmake_2_8_12_PRIVATE PRIVATE) + if(POLICY CMP0022) + cmake_policy(SET CMP0022 NEW) # automatic when 2.8.12 is required + endif() +endif() # Top level target used to build all compiler-rt libraries. -add_custom_target(compiler-rt) +add_custom_target(compiler-rt ALL) -# 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(LIBCLANG_INSTALL_PATH lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}) -string(TOLOWER ${CMAKE_SYSTEM_NAME} LIBCLANG_OS_DIR) -set(CLANG_RESOURCE_DIR ${LLVM_BINARY_DIR}/lib/clang/${CLANG_VERSION}) -set(COMPILER_RT_LIBRARY_OUTPUT_DIR ${CLANG_RESOURCE_DIR}/lib/${LIBCLANG_OS_DIR}) +if (NOT COMPILER_RT_STANDALONE_BUILD) + # 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) + else() + set(COMPILER_RT_TEST_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") + + 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 LLVM_BINARY_DIR) + list(GET CONFIG_OUTPUT 1 LLVM_TOOLS_BINARY_DIR) + list(GET CONFIG_OUTPUT 2 LLVM_LIBRARY_DIR) + list(GET CONFIG_OUTPUT 3 LLVM_MAIN_SRC_DIR) + + # Make use of LLVM CMake modules. + file(TO_CMAKE_PATH ${LLVM_BINARY_DIR} LLVM_BINARY_DIR_CMAKE_STYLE) + set(LLVM_CMAKE_PATH "${LLVM_BINARY_DIR_CMAKE_STYLE}/share/llvm/cmake") + 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 ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib) + + # 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") +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() + +# Tests using XFAIL use the first value in COMPILER_RT_TEST_TARGET_TRIPLE +set(COMPILER_RT_TEST_TARGET_TRIPLE ${TARGET_TRIPLE} CACHE STRING + "Default triple for cross-compiled executables") +string(REPLACE "-" ";" TARGET_TRIPLE_LIST ${COMPILER_RT_TEST_TARGET_TRIPLE}) +list(GET TARGET_TRIPLE_LIST 0 COMPILER_RT_TEST_TARGET_ARCH) +list(GET TARGET_TRIPLE_LIST 1 COMPILER_RT_TEST_TARGET_OS) +list(GET TARGET_TRIPLE_LIST 2 COMPILER_RT_TEST_TARGET_ABI) + +if ("${COMPILER_RT_TEST_TARGET_ABI}" STREQUAL "androideabi") + set(ANDROID 1) +endif() + +string(TOLOWER ${CMAKE_SYSTEM_NAME} COMPILER_RT_OS_DIR) +set(COMPILER_RT_LIBRARY_OUTPUT_DIR + ${COMPILER_RT_OUTPUT_DIR}/lib/${COMPILER_RT_OS_DIR}) set(COMPILER_RT_LIBRARY_INSTALL_DIR - ${LIBCLANG_INSTALL_PATH}/lib/${LIBCLANG_OS_DIR}) + ${COMPILER_RT_INSTALL_PATH}/lib/${COMPILER_RT_OS_DIR}) -# Add path for custom modules +# Add path for custom compiler-rt modules. set(CMAKE_MODULE_PATH - ${CMAKE_MODULE_PATH} + "${CMAKE_CURRENT_SOURCE_DIR}/cmake" "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules" + ${CMAKE_MODULE_PATH} ) -include(AddCompilerRT) +include(CompilerRTUtils) set(COMPILER_RT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}) set(COMPILER_RT_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}) # Setup custom SDK sysroots. -set(COMPILER_RT_DARWIN_SDK_SYSROOT ${COMPILER_RT_SOURCE_DIR}/SDKs/darwin) set(COMPILER_RT_LINUX_SDK_SYSROOT ${COMPILER_RT_SOURCE_DIR}/SDKs/linux) -include(SanitizerUtils) # 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. @@ -59,9 +176,6 @@ else() set(TARGET_32_BIT_CFLAGS "") endif() -# List of architectures we can target. -set(COMPILER_RT_SUPPORTED_ARCH) - function(get_target_flags_for_arch arch out_var) list(FIND COMPILER_RT_SUPPORTED_ARCH ${arch} ARCH_INDEX) if(ARCH_INDEX EQUAL -1) @@ -71,115 +185,103 @@ function(get_target_flags_for_arch arch out_var) endif() endfunction() -# 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.c) -file(WRITE ${SIMPLE_SOURCE} "#include \nint main() {}") - -# test_target_arch( ) -# Sets the target flags for a given architecture and determines if this -# architecture is supported by trying to build a simple file. -macro(test_target_arch arch) - set(TARGET_${arch}_CFLAGS ${ARGN}) - try_compile(CAN_TARGET_${arch} ${CMAKE_BINARY_DIR} ${SIMPLE_SOURCE} - COMPILE_DEFINITIONS "${TARGET_${arch}_CFLAGS}" - CMAKE_FLAGS "-DCMAKE_EXE_LINKER_FLAGS:STRING=${TARGET_${arch}_CFLAGS}") - if(${CAN_TARGET_${arch}}) - list(APPEND COMPILER_RT_SUPPORTED_ARCH ${arch}) - endif() -endmacro() - -if("${LLVM_NATIVE_ARCH}" STREQUAL "X86") - if (NOT MSVC) - test_target_arch(x86_64 ${TARGET_64_BIT_CFLAGS}) - endif() - test_target_arch(i386 ${TARGET_32_BIT_CFLAGS}) -elseif("${LLVM_NATIVE_ARCH}" STREQUAL "PowerPC") - test_target_arch(powerpc64 ${TARGET_64_BIT_CFLAGS}) -endif() - -# We only support running instrumented tests when we're not cross compiling -# and target a unix-like system. On Android we define the rules for building -# unit tests, but don't execute them. -if("${CMAKE_HOST_SYSTEM}" STREQUAL "${CMAKE_SYSTEM}" AND UNIX AND NOT ANDROID) +# 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 MSVC)) 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() -# Check if compiler-rt is built with libc++. -find_flag_in_string("${CMAKE_CXX_FLAGS}" "-stdlib=libc++" - COMPILER_RT_USES_LIBCXX) - -function(filter_available_targets out_var) - set(archs) - 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() - option(COMPILER_RT_DEBUG "Build runtimes with full debug info" OFF) - # COMPILER_RT_DEBUG_PYBOOL is used by lit.common.configured.in. pythonize_bool(COMPILER_RT_DEBUG) -# Provide some common commmandline flags for Sanitizer runtimes. -if (NOT MSVC) - set(SANITIZER_COMMON_CFLAGS - -fPIC - -fno-builtin - -fno-exceptions - -fomit-frame-pointer - -funwind-tables - -fno-stack-protector - -Wno-gnu # Variadic macros with 0 arguments for ... - -fvisibility=hidden - ) - if (NOT COMPILER_RT_DEBUG) - list(APPEND SANITIZER_COMMON_CFLAGS -O3) - endif() +# We have to support both static and dynamic/shared runtime on Windows. +# Android only works with dynamic runtime. +if(WIN32 OR ANDROID) +option(COMPILER_RT_BUILD_SHARED_ASAN "Build shared version of AddressSanitizer runtime" ON) else() - set(SANITIZER_COMMON_CFLAGS - /MT - /Zi - /Oy- - /GS- - /wd4722 - ) +option(COMPILER_RT_BUILD_SHARED_ASAN "Build shared version of AddressSanitizer runtime" OFF) endif() -# Build sanitizer runtimes with debug info. (MSVC gets /Zi above) -if (NOT MSVC) - check_cxx_compiler_flag(-gline-tables-only SUPPORTS_GLINE_TABLES_ONLY_FLAG) - if(SUPPORTS_GLINE_TABLES_ONLY_FLAG AND NOT COMPILER_RT_DEBUG) - list(APPEND SANITIZER_COMMON_CFLAGS -gline-tables-only) - else() - list(APPEND SANITIZER_COMMON_CFLAGS -g) - endif() -endif() -# Warnings suppressions. -check_cxx_compiler_flag(-Wno-variadic-macros SUPPORTS_NO_VARIADIC_MACROS_FLAG) -if(SUPPORTS_NO_VARIADIC_MACROS_FLAG) - list(APPEND SANITIZER_COMMON_CFLAGS -Wno-variadic-macros) -endif() -check_cxx_compiler_flag(-Wno-c99-extensions SUPPORTS_NO_C99_EXTENSIONS_FLAG) -if(SUPPORTS_NO_C99_EXTENSIONS_FLAG) - list(APPEND SANITIZER_COMMON_CFLAGS -Wno-c99-extensions) -endif() -# Sanitizer may not have libstdc++, so we can have problems with virtual -# destructors. -check_cxx_compiler_flag(-Wno-non-virtual-dtor SUPPORTS_NO_NON_VIRTUAL_DTOR_FLAG) -if (SUPPORTS_NO_NON_VIRTUAL_DTOR_FLAG) - list(APPEND SANITIZER_COMMON_CFLAGS -Wno-non-virtual-dtor) -endif() -check_cxx_compiler_flag(-Wglobal-constructors SUPPORTS_GLOBAL_CONSTRUCTORS_FLAG) -# Not all sanitizers forbid global constructors. +#================================ +# Setup Compiler Flags +#================================ +include(config-ix) + +if(MSVC) + append_string_if(COMPILER_RT_HAS_W3_FLAG /W3 CMAKE_C_FLAGS CMAKE_CXX_FLAGS) +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. +append_list_if(COMPILER_RT_HAS_FPIC_FLAG -fPIC SANITIZER_COMMON_CFLAGS) +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) +append_list_if(COMPILER_RT_HAS_FOMIT_FRAME_POINTER_FLAG -fomit-frame-pointer SANITIZER_COMMON_CFLAGS) +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_FVISIBILITY_HIDDEN_FLAG -fvisibility=hidden SANITIZER_COMMON_CFLAGS) +append_list_if(COMPILER_RT_HAS_FNO_FUNCTION_SECTIONS_FLAG -fno-function-sections SANITIZER_COMMON_CFLAGS) + +if(MSVC) + # Replace the /MD[d] flags with /MT. + # FIXME: In fact, sanitizers should support both /MT and /MD, see PR20214. + if(COMPILER_RT_HAS_MT_FLAG) + foreach(flag_var + CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE + CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO) + if(${flag_var} MATCHES "/MD") + string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}") + elseif(${flag_var} MATCHES "/MDd") + string(REGEX REPLACE "/MDd" "/MT" ${flag_var} "${${flag_var}}") + endif() + 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) +endif() + +# Build with optimization, unless we're in debug mode. If we're using MSVC, +# always respect the optimization flags set by CMAKE_BUILD_TYPE instead. +if(NOT COMPILER_RT_DEBUG AND NOT MSVC) + list(APPEND SANITIZER_COMMON_CFLAGS -O3) +endif() + +# Build sanitizer runtimes with debug info. +if(COMPILER_RT_HAS_GLINE_TABLES_ONLY_FLAG) + list(APPEND SANITIZER_COMMON_CFLAGS -gline-tables-only) +elseif(COMPILER_RT_HAS_G_FLAG) + list(APPEND SANITIZER_COMMON_CFLAGS -g) +elseif(COMPILER_RT_HAS_Zi_FLAG) + list(APPEND SANITIZER_COMMON_CFLAGS /Zi) +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) if(APPLE) # Obtain the iOS Simulator SDK path from xcodebuild. execute_process( @@ -187,18 +289,17 @@ if(APPLE) OUTPUT_VARIABLE IOSSIM_SDK_DIR OUTPUT_STRIP_TRAILING_WHITESPACE ) + string(REGEX MATCH "-mmacosx-version-min=" + MACOSX_VERSION_MIN_FLAG "${CMAKE_CXX_FLAGS}") set(SANITIZER_COMMON_SUPPORTED_DARWIN_OS osx) - if (IOSSIM_SDK_DIR) + if (IOSSIM_SDK_DIR AND NOT MACOSX_VERSION_MIN_FLAG) list(APPEND SANITIZER_COMMON_SUPPORTED_DARWIN_OS iossim) endif() - if(COMPILER_RT_USES_LIBCXX) - set(SANITIZER_MIN_OSX_VERSION 10.7) - else() - set(SANITIZER_MIN_OSX_VERSION 10.6) - endif() + set(SANITIZER_MIN_OSX_VERSION 10.7) + set(CMAKE_OSX_DEPLOYMENT_TARGET "") # We're setting the flag manually below. set(DARWIN_osx_CFLAGS -mmacosx-version-min=${SANITIZER_MIN_OSX_VERSION}) - set(DARWIN_iossim_CFLAGS + set(DARWIN_iossim_CFLAGS -mios-simulator-version-min=7.0 -isysroot ${IOSSIM_SDK_DIR}) set(DARWIN_osx_LINKFLAGS) set(DARWIN_iossim_LINKFLAGS @@ -207,26 +308,18 @@ if(APPLE) -isysroot ${IOSSIM_SDK_DIR}) endif() -# Architectures supported by Sanitizer runtimes. Specific sanitizers may -# support only subset of these (e.g. TSan works on x86_64 only). -filter_available_targets(SANITIZER_COMMON_SUPPORTED_ARCH - x86_64 i386 powerpc64) - add_subdirectory(include) -set(SANITIZER_COMMON_LIT_TEST_DEPS - clang clang-headers FileCheck count not llvm-nm llvm-symbolizer - compiler-rt-headers) -# Check code style when running lit tests for sanitizers. -if(UNIX) - list(APPEND SANITIZER_COMMON_LIT_TEST_DEPS SanitizerLintCheck) +set(COMPILER_RT_LIBCXX_PATH ${LLVM_MAIN_SRC_DIR}/projects/libcxx) +if(EXISTS ${COMPILER_RT_LIBCXX_PATH}/) + set(COMPILER_RT_HAS_LIBCXX_SOURCES TRUE) +else() + set(COMPILER_RT_HAS_LIBCXX_SOURCES FALSE) endif() add_subdirectory(lib) -if(LLVM_INCLUDE_TESTS) - # Currently the tests have not been ported to CMake, so disable this - # directory. - # - #add_subdirectory(test) +if(COMPILER_RT_INCLUDE_TESTS) + add_subdirectory(unittests) endif() +add_subdirectory(test) diff --git a/CODE_OWNERS.TXT b/CODE_OWNERS.TXT new file mode 100644 index 00000000000..2159ad7b845 --- /dev/null +++ b/CODE_OWNERS.TXT @@ -0,0 +1,57 @@ +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: Sergey Matveev +E: earthdok@google.com +D: LeakSanitizer + +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 + +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 index 818f4fa104d..6964eba020b 100644 --- a/CREDITS.TXT +++ b/CREDITS.TXT @@ -22,3 +22,15 @@ 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 index 6aab1f694cc..aee8347b0c3 100644 --- a/LICENSE.TXT +++ b/LICENSE.TXT @@ -14,7 +14,7 @@ Full text of the relevant licenses is included below. University of Illinois/NCSA Open Source License -Copyright (c) 2009-2013 by the contributors listed in CREDITS.TXT +Copyright (c) 2009-2014 by the contributors listed in CREDITS.TXT All rights reserved. @@ -55,7 +55,7 @@ SOFTWARE. ============================================================================== -Copyright (c) 2009-2013 by the contributors listed in CREDITS.TXT +Copyright (c) 2009-2014 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 @@ -89,9 +89,3 @@ 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. -The following pieces of software have additional or alternate copyrights, -licenses, and/or restrictions: - -Program Directory -------- --------- -mach_override lib/interception/mach_override diff --git a/Makefile b/Makefile index 6747ea4d431..ac3daac5fce 100644 --- a/Makefile +++ b/Makefile @@ -249,10 +249,10 @@ $(call Set,Tmp.CFLAGS,$(strip \ $(Tmp.ObjPath)/%.o: $(Tmp.SrcPath)/%.s $(Tmp.Dependencies) $(Tmp.ObjPath)/.dir $(Summary) " ASSEMBLE: $(Tmp.Name)/$(Tmp.Config)/$(Tmp.Arch): $$<" - $(Verb) $(Tmp.CC) $(Tmp.CFLAGS) -c -o $$@ $$< + $(Verb) $(Tmp.CC) $(COMMON_ASMFLAGS) $(Tmp.CFLAGS) -c -o $$@ $$< $(Tmp.ObjPath)/%.o: $(Tmp.SrcPath)/%.S $(Tmp.Dependencies) $(Tmp.ObjPath)/.dir $(Summary) " ASSEMBLE: $(Tmp.Name)/$(Tmp.Config)/$(Tmp.Arch): $$<" - $(Verb) $(Tmp.CC) $(Tmp.CFLAGS) -c -o $$@ $$< + $(Verb) $(Tmp.CC) $(COMMON_ASMFLAGS) $(Tmp.CFLAGS) -c -o $$@ $$< $(Tmp.ObjPath)/%.o: $(Tmp.SrcPath)/%.c $(Tmp.Dependencies) $(Tmp.ObjPath)/.dir $(Summary) " COMPILE: $(Tmp.Name)/$(Tmp.Config)/$(Tmp.Arch): $$<" $(Verb) $(Tmp.CC) $(COMMON_CFLAGS) $(Tmp.CFLAGS) -c -o $$@ $$< diff --git a/README.txt b/README.txt index b37c0aecdeb..fc8843246e2 100644 --- a/README.txt +++ b/README.txt @@ -9,335 +9,3 @@ terms of the license agreement found in LICENSE.txt. ================================ -This is a replacement library for libgcc. Each function is contained -in its own file. Each function has a corresponding unit test under -test/Unit. - -A rudimentary script to test each file is in the file called -test/Unit/test. - -Here is the specification for this library: - -http://gcc.gnu.org/onlinedocs/gccint/Libgcc.html#Libgcc - -Here is a synopsis of the contents of this library: - -typedef int si_int; -typedef unsigned su_int; - -typedef long long di_int; -typedef unsigned long long du_int; - -// Integral bit manipulation - -di_int __ashldi3(di_int a, si_int b); // a << b -ti_int __ashlti3(ti_int a, si_int b); // a << b - -di_int __ashrdi3(di_int a, si_int b); // a >> b arithmetic (sign fill) -ti_int __ashrti3(ti_int a, si_int b); // a >> b arithmetic (sign fill) -di_int __lshrdi3(di_int a, si_int b); // a >> b logical (zero fill) -ti_int __lshrti3(ti_int a, si_int b); // a >> b logical (zero fill) - -si_int __clzsi2(si_int a); // count leading zeros -si_int __clzdi2(di_int a); // count leading zeros -si_int __clzti2(ti_int a); // count leading zeros -si_int __ctzsi2(si_int a); // count trailing zeros -si_int __ctzdi2(di_int a); // count trailing zeros -si_int __ctzti2(ti_int a); // count trailing zeros - -si_int __ffsdi2(di_int a); // find least significant 1 bit -si_int __ffsti2(ti_int a); // find least significant 1 bit - -si_int __paritysi2(si_int a); // bit parity -si_int __paritydi2(di_int a); // bit parity -si_int __parityti2(ti_int a); // bit parity - -si_int __popcountsi2(si_int a); // bit population -si_int __popcountdi2(di_int a); // bit population -si_int __popcountti2(ti_int a); // bit population - -uint32_t __bswapsi2(uint32_t a); // a byteswapped, arm only -uint64_t __bswapdi2(uint64_t a); // a byteswapped, arm only - -// Integral arithmetic - -di_int __negdi2 (di_int a); // -a -ti_int __negti2 (ti_int a); // -a -di_int __muldi3 (di_int a, di_int b); // a * b -ti_int __multi3 (ti_int a, ti_int b); // a * b -si_int __divsi3 (si_int a, si_int b); // a / b signed -di_int __divdi3 (di_int a, di_int b); // a / b signed -ti_int __divti3 (ti_int a, ti_int b); // a / b signed -su_int __udivsi3 (su_int n, su_int d); // a / b unsigned -du_int __udivdi3 (du_int a, du_int b); // a / b unsigned -tu_int __udivti3 (tu_int a, tu_int b); // a / b unsigned -si_int __modsi3 (si_int a, si_int b); // a % b signed -di_int __moddi3 (di_int a, di_int b); // a % b signed -ti_int __modti3 (ti_int a, ti_int b); // a % b signed -su_int __umodsi3 (su_int a, su_int b); // a % b unsigned -du_int __umoddi3 (du_int a, du_int b); // a % b unsigned -tu_int __umodti3 (tu_int a, tu_int b); // a % b unsigned -du_int __udivmoddi4(du_int a, du_int b, du_int* rem); // a / b, *rem = a % b unsigned -tu_int __udivmodti4(tu_int a, tu_int b, tu_int* rem); // a / b, *rem = a % b unsigned -su_int __udivmodsi4(su_int a, su_int b, su_int* rem); // a / b, *rem = a % b unsigned -si_int __divmodsi4(si_int a, si_int b, si_int* rem); // a / b, *rem = a % b signed - - - -// Integral arithmetic with trapping overflow - -si_int __absvsi2(si_int a); // abs(a) -di_int __absvdi2(di_int a); // abs(a) -ti_int __absvti2(ti_int a); // abs(a) - -si_int __negvsi2(si_int a); // -a -di_int __negvdi2(di_int a); // -a -ti_int __negvti2(ti_int a); // -a - -si_int __addvsi3(si_int a, si_int b); // a + b -di_int __addvdi3(di_int a, di_int b); // a + b -ti_int __addvti3(ti_int a, ti_int b); // a + b - -si_int __subvsi3(si_int a, si_int b); // a - b -di_int __subvdi3(di_int a, di_int b); // a - b -ti_int __subvti3(ti_int a, ti_int b); // a - b - -si_int __mulvsi3(si_int a, si_int b); // a * b -di_int __mulvdi3(di_int a, di_int b); // a * b -ti_int __mulvti3(ti_int a, ti_int b); // a * b - - -// Integral arithmetic which returns if overflow - -si_int __mulosi4(si_int a, si_int b, int* overflow); // a * b, overflow set to one if result not in signed range -di_int __mulodi4(di_int a, di_int b, int* overflow); // a * b, overflow set to one if result not in signed range -ti_int __muloti4(ti_int a, ti_int b, int* overflow); // a * b, overflow set to - one if result not in signed range - - -// Integral comparison: a < b -> 0 -// a == b -> 1 -// a > b -> 2 - -si_int __cmpdi2 (di_int a, di_int b); -si_int __cmpti2 (ti_int a, ti_int b); -si_int __ucmpdi2(du_int a, du_int b); -si_int __ucmpti2(tu_int a, tu_int b); - -// Integral / floating point conversion - -di_int __fixsfdi( float a); -di_int __fixdfdi( double a); -di_int __fixxfdi(long double a); - -ti_int __fixsfti( float a); -ti_int __fixdfti( double a); -ti_int __fixxfti(long double a); -uint64_t __fixtfdi(long double input); // ppc only, doesn't match documentation - -su_int __fixunssfsi( float a); -su_int __fixunsdfsi( double a); -su_int __fixunsxfsi(long double a); - -du_int __fixunssfdi( float a); -du_int __fixunsdfdi( double a); -du_int __fixunsxfdi(long double a); - -tu_int __fixunssfti( float a); -tu_int __fixunsdfti( double a); -tu_int __fixunsxfti(long double a); -uint64_t __fixunstfdi(long double input); // ppc only - -float __floatdisf(di_int a); -double __floatdidf(di_int a); -long double __floatdixf(di_int a); -long double __floatditf(int64_t a); // ppc only - -float __floattisf(ti_int a); -double __floattidf(ti_int a); -long double __floattixf(ti_int a); - -float __floatundisf(du_int a); -double __floatundidf(du_int a); -long double __floatundixf(du_int a); -long double __floatunditf(uint64_t a); // ppc only - -float __floatuntisf(tu_int a); -double __floatuntidf(tu_int a); -long double __floatuntixf(tu_int a); - -// Floating point raised to integer power - -float __powisf2( float a, si_int b); // a ^ b -double __powidf2( double a, si_int b); // a ^ b -long double __powixf2(long double a, si_int b); // a ^ b -long double __powitf2(long double a, si_int b); // ppc only, a ^ b - -// Complex arithmetic - -// (a + ib) * (c + id) - - float _Complex __mulsc3( float a, float b, float c, float d); - double _Complex __muldc3(double a, double b, double c, double d); -long double _Complex __mulxc3(long double a, long double b, - long double c, long double d); -long double _Complex __multc3(long double a, long double b, - long double c, long double d); // ppc only - -// (a + ib) / (c + id) - - float _Complex __divsc3( float a, float b, float c, float d); - double _Complex __divdc3(double a, double b, double c, double d); -long double _Complex __divxc3(long double a, long double b, - long double c, long double d); -long double _Complex __divtc3(long double a, long double b, - long double c, long double d); // ppc only - - -// Runtime support - -// __clear_cache() is used to tell process that new instructions have been -// written to an address range. Necessary on processors that do not have -// a unified instuction and data cache. -void __clear_cache(void* start, void* end); - -// __enable_execute_stack() is used with nested functions when a trampoline -// function is written onto the stack and that page range needs to be made -// executable. -void __enable_execute_stack(void* addr); - -// __gcc_personality_v0() is normally only called by the system unwinder. -// C code (as opposed to C++) normally does not need a personality function -// because there are no catch clauses or destructors to be run. But there -// is a C language extension __attribute__((cleanup(func))) which marks local -// variables as needing the cleanup function "func" to be run when the -// variable goes out of scope. That includes when an exception is thrown, -// so a personality handler is needed. -_Unwind_Reason_Code __gcc_personality_v0(int version, _Unwind_Action actions, - uint64_t exceptionClass, struct _Unwind_Exception* exceptionObject, - _Unwind_Context_t context); - -// for use with some implementations of assert() in -void __eprintf(const char* format, const char* assertion_expression, - const char* line, const char* file); - - - -// Power PC specific functions - -// There is no C interface to the saveFP/restFP functions. They are helper -// functions called by the prolog and epilog of functions that need to save -// a number of non-volatile float point registers. -saveFP -restFP - -// PowerPC has a standard template for trampoline functions. This function -// generates a custom trampoline function with the specific realFunc -// and localsPtr values. -void __trampoline_setup(uint32_t* trampOnStack, int trampSizeAllocated, - const void* realFunc, void* localsPtr); - -// adds two 128-bit double-double precision values ( x + y ) -long double __gcc_qadd(long double x, long double y); - -// subtracts two 128-bit double-double precision values ( x - y ) -long double __gcc_qsub(long double x, long double y); - -// multiples two 128-bit double-double precision values ( x * y ) -long double __gcc_qmul(long double x, long double y); - -// divides two 128-bit double-double precision values ( x / y ) -long double __gcc_qdiv(long double a, long double b); - - -// ARM specific functions - -// There is no C interface to the switch* functions. These helper functions -// are only needed by Thumb1 code for efficient switch table generation. -switch16 -switch32 -switch8 -switchu8 - -// There is no C interface to the *_vfp_d8_d15_regs functions. There are -// called in the prolog and epilog of Thumb1 functions. When the C++ ABI use -// SJLJ for exceptions, each function with a catch clause or destuctors needs -// to save and restore all registers in it prolog and epliog. But there is -// no way to access vector and high float registers from thumb1 code, so the -// compiler must add call outs to these helper functions in the prolog and -// epilog. -restore_vfp_d8_d15_regs -save_vfp_d8_d15_regs - - -// Note: long ago ARM processors did not have floating point hardware support. -// Floating point was done in software and floating point parameters were -// passed in integer registers. When hardware support was added for floating -// point, new *vfp functions were added to do the same operations but with -// floating point parameters in floating point registers. - -// Undocumented functions - -float __addsf3vfp(float a, float b); // Appears to return a + b -double __adddf3vfp(double a, double b); // Appears to return a + b -float __divsf3vfp(float a, float b); // Appears to return a / b -double __divdf3vfp(double a, double b); // Appears to return a / b -int __eqsf2vfp(float a, float b); // Appears to return one - // iff a == b and neither is NaN. -int __eqdf2vfp(double a, double b); // Appears to return one - // iff a == b and neither is NaN. -double __extendsfdf2vfp(float a); // Appears to convert from - // float to double. -int __fixdfsivfp(double a); // Appears to convert from - // double to int. -int __fixsfsivfp(float a); // Appears to convert from - // float to int. -unsigned int __fixunssfsivfp(float a); // Appears to convert from - // float to unsigned int. -unsigned int __fixunsdfsivfp(double a); // Appears to convert from - // double to unsigned int. -double __floatsidfvfp(int a); // Appears to convert from - // int to double. -float __floatsisfvfp(int a); // Appears to convert from - // int to float. -double __floatunssidfvfp(unsigned int a); // Appears to convert from - // unisgned int to double. -float __floatunssisfvfp(unsigned int a); // Appears to convert from - // unisgned int to float. -int __gedf2vfp(double a, double b); // Appears to return __gedf2 - // (a >= b) -int __gesf2vfp(float a, float b); // Appears to return __gesf2 - // (a >= b) -int __gtdf2vfp(double a, double b); // Appears to return __gtdf2 - // (a > b) -int __gtsf2vfp(float a, float b); // Appears to return __gtsf2 - // (a > b) -int __ledf2vfp(double a, double b); // Appears to return __ledf2 - // (a <= b) -int __lesf2vfp(float a, float b); // Appears to return __lesf2 - // (a <= b) -int __ltdf2vfp(double a, double b); // Appears to return __ltdf2 - // (a < b) -int __ltsf2vfp(float a, float b); // Appears to return __ltsf2 - // (a < b) -double __muldf3vfp(double a, double b); // Appears to return a * b -float __mulsf3vfp(float a, float b); // Appears to return a * b -int __nedf2vfp(double a, double b); // Appears to return __nedf2 - // (a != b) -double __negdf2vfp(double a); // Appears to return -a -float __negsf2vfp(float a); // Appears to return -a -float __negsf2vfp(float a); // Appears to return -a -double __subdf3vfp(double a, double b); // Appears to return a - b -float __subsf3vfp(float a, float b); // Appears to return a - b -float __truncdfsf2vfp(double a); // Appears to convert from - // double to float. -int __unorddf2vfp(double a, double b); // Appears to return __unorddf2 -int __unordsf2vfp(float a, float b); // Appears to return __unordsf2 - - -Preconditions are listed for each function at the definition when there are any. -Any preconditions reflect the specification at -http://gcc.gnu.org/onlinedocs/gccint/Libgcc.html#Libgcc. - -Assumptions are listed in "int_lib.h", and in individual files. Where possible -assumptions are checked at compile time. diff --git a/SDKs/darwin/README.txt b/SDKs/darwin/README.txt deleted file mode 100644 index ea30af358b2..00000000000 --- a/SDKs/darwin/README.txt +++ /dev/null @@ -1,3 +0,0 @@ -The Darwin platforms are all similar enough we roll them into one SDK, and use -preprocessor tricks to get the right definitions for the few things which -diverge between OS X and iOS. diff --git a/SDKs/darwin/usr/include/errno.h b/SDKs/darwin/usr/include/errno.h deleted file mode 100644 index f06e5371339..00000000000 --- a/SDKs/darwin/usr/include/errno.h +++ /dev/null @@ -1,17 +0,0 @@ -/* ===-- errno.h - stub SDK header for compiler-rt --------------------------=== - * - * The LLVM Compiler Infrastructure - * - * This file is dual licensed under the MIT and the University of Illinois Open - * Source Licenses. See LICENSE.TXT for details. - * - * ===-----------------------------------------------------------------------=== - * - * This is a stub SDK header file. This file is not part of the interface of - * this library nor an official version of the appropriate SDK header. It is - * intended only to stub the features of this header required by compiler-rt. - * - * ===-----------------------------------------------------------------------=== - */ - -#include diff --git a/SDKs/darwin/usr/include/fcntl.h b/SDKs/darwin/usr/include/fcntl.h deleted file mode 100644 index a5f91e3a5bc..00000000000 --- a/SDKs/darwin/usr/include/fcntl.h +++ /dev/null @@ -1,17 +0,0 @@ -/* ===-- fcntl.h - stub SDK header for compiler-rt --------------------------=== - * - * The LLVM Compiler Infrastructure - * - * This file is dual licensed under the MIT and the University of Illinois Open - * Source Licenses. See LICENSE.TXT for details. - * - * ===-----------------------------------------------------------------------=== - * - * This is a stub SDK header file. This file is not part of the interface of - * this library nor an official version of the appropriate SDK header. It is - * intended only to stub the features of this header required by compiler-rt. - * - * ===-----------------------------------------------------------------------=== - */ - -#include diff --git a/SDKs/darwin/usr/include/limits.h b/SDKs/darwin/usr/include/limits.h deleted file mode 100644 index 5495a784f12..00000000000 --- a/SDKs/darwin/usr/include/limits.h +++ /dev/null @@ -1,23 +0,0 @@ -/* ===-- limits.h - stub SDK header for compiler-rt -------------------------=== - * - * The LLVM Compiler Infrastructure - * - * This file is dual licensed under the MIT and the University of Illinois Open - * Source Licenses. See LICENSE.TXT for details. - * - * ===-----------------------------------------------------------------------=== - * - * This is a stub SDK header file. This file is not part of the interface of - * this library nor an official version of the appropriate SDK header. It is - * intended only to stub the features of this header required by compiler-rt. - * - * ===-----------------------------------------------------------------------=== - */ - -#ifndef __LIMITS_H__ -#define __LIMITS_H__ - -/* This is only here as a landing pad for the include_next from the compiler's - built-in limits.h. */ - -#endif /* __LIMITS_H__ */ diff --git a/SDKs/darwin/usr/include/stdio.h b/SDKs/darwin/usr/include/stdio.h deleted file mode 100644 index 006652fb9b8..00000000000 --- a/SDKs/darwin/usr/include/stdio.h +++ /dev/null @@ -1,89 +0,0 @@ -/* ===-- stdio.h - stub SDK header for compiler-rt --------------------------=== - * - * The LLVM Compiler Infrastructure - * - * This file is dual licensed under the MIT and the University of Illinois Open - * Source Licenses. See LICENSE.TXT for details. - * - * ===-----------------------------------------------------------------------=== - * - * This is a stub SDK header file. This file is not part of the interface of - * this library nor an official version of the appropriate SDK header. It is - * intended only to stub the features of this header required by compiler-rt. - * - * ===-----------------------------------------------------------------------=== - */ - -#ifndef __STDIO_H__ -#define __STDIO_H__ - -#if defined(__cplusplus) -extern "C" { -#endif - -typedef struct __sFILE FILE; -typedef __SIZE_TYPE__ size_t; - -/* Determine the appropriate fdopen, fopen(), and fwrite() functions. */ -#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) -# if defined(__i386) -# define __FDOPEN_NAME "_fdopen$UNIX2003" -# define __FOPEN_NAME "_fopen$UNIX2003" -# define __FWRITE_NAME "_fwrite$UNIX2003" -# elif defined(__x86_64__) -# define __FDOPEN_NAME "_fdopen" -# define __FOPEN_NAME "_fopen" -# define __FWRITE_NAME "_fwrite" -# elif defined(__arm) -# define __FDOPEN_NAME "_fdopen" -# define __FOPEN_NAME "_fopen" -# define __FWRITE_NAME "_fwrite" -# else -# error "unrecognized architecture for targetting OS X" -# endif -#elif defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) -# if defined(__i386) || defined (__x86_64) -# define __FDOPEN_NAME "_fdopen" -# define __FOPEN_NAME "_fopen" -# define __FWRITE_NAME "_fwrite" -# elif defined(__arm) -# define __FDOPEN_NAME "_fdopen" -# define __FOPEN_NAME "_fopen" -# define __FWRITE_NAME "_fwrite" -# else -# error "unrecognized architecture for targetting iOS" -# endif -#else -# error "unrecognized architecture for targetting Darwin" -#endif - -# define stderr __stderrp -extern FILE *__stderrp; - -#ifndef SEEK_SET -#define SEEK_SET 0 /* set file offset to offset */ -#endif -#ifndef SEEK_CUR -#define SEEK_CUR 1 /* set file offset to current plus offset */ -#endif -#ifndef SEEK_END -#define SEEK_END 2 /* set file offset to EOF plus offset */ -#endif - -int fclose(FILE *); -int fflush(FILE *); -FILE *fopen(const char * __restrict, const char * __restrict) __asm(__FOPEN_NAME); -FILE *fdopen(int, const char *) __asm(__FDOPEN_NAME); -int fprintf(FILE * __restrict, const char * __restrict, ...); -size_t fwrite(const void * __restrict, size_t, size_t, FILE * __restrict) - __asm(__FWRITE_NAME); -size_t fread(void * __restrict, size_t, size_t, FILE * __restrict); -long ftell(FILE *); -int fseek(FILE *, long, int); -int snprintf(char * __restrict, size_t, const char * __restrict, ...); - -#if defined(__cplusplus) -} -#endif - -#endif /* __STDIO_H__ */ diff --git a/SDKs/darwin/usr/include/stdlib.h b/SDKs/darwin/usr/include/stdlib.h deleted file mode 100644 index b6d3171cff4..00000000000 --- a/SDKs/darwin/usr/include/stdlib.h +++ /dev/null @@ -1,32 +0,0 @@ -/* ===-- stdlib.h - stub SDK header for compiler-rt -------------------------=== - * - * The LLVM Compiler Infrastructure - * - * This file is dual licensed under the MIT and the University of Illinois Open - * Source Licenses. See LICENSE.TXT for details. - * - * ===-----------------------------------------------------------------------=== - * - * This is a stub SDK header file. This file is not part of the interface of - * this library nor an official version of the appropriate SDK header. It is - * intended only to stub the features of this header required by compiler-rt. - * - * ===-----------------------------------------------------------------------=== - */ - -#ifndef __STDLIB_H__ -#define __STDLIB_H__ - -#define NULL ((void *)0) - -typedef __SIZE_TYPE__ size_t; - -void abort(void) __attribute__((__noreturn__)); -int atexit(void (*)(void)); -int atoi(const char *); -void free(void *); -char *getenv(const char *); -void *malloc(size_t); -void *realloc(void *, size_t); - -#endif /* __STDLIB_H__ */ diff --git a/SDKs/darwin/usr/include/string.h b/SDKs/darwin/usr/include/string.h deleted file mode 100644 index c6ab5d8e587..00000000000 --- a/SDKs/darwin/usr/include/string.h +++ /dev/null @@ -1,52 +0,0 @@ -/* ===-- string.h - stub SDK header for compiler-rt -------------------------=== - * - * The LLVM Compiler Infrastructure - * - * This file is dual licensed under the MIT and the University of Illinois Open - * Source Licenses. See LICENSE.TXT for details. - * - * ===-----------------------------------------------------------------------=== - * - * This is a stub SDK header file. This file is not part of the interface of - * this library nor an official version of the appropriate SDK header. It is - * intended only to stub the features of this header required by compiler-rt. - * - * ===-----------------------------------------------------------------------=== - */ - -#ifndef __STRING_H__ -#define __STRING_H__ - -typedef __SIZE_TYPE__ size_t; - -int memcmp(const void *, const void *, size_t); -void *memcpy(void *, const void *, size_t); -void *memset(void *, int, size_t); -char *strcat(char *, const char *); -char *strcpy(char *, const char *); -char *strdup(const char *); -size_t strlen(const char *); -char *strncpy(char *, const char *, size_t); - -/* Determine the appropriate strerror() function. */ -#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) -# if defined(__i386) -# define __STRERROR_NAME "_strerror$UNIX2003" -# elif defined(__x86_64__) || defined(__arm) -# define __STRERROR_NAME "_strerror" -# else -# error "unrecognized architecture for targetting OS X" -# endif -#elif defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) -# if defined(__i386) || defined (__x86_64) || defined(__arm) -# define __STRERROR_NAME "_strerror" -# else -# error "unrecognized architecture for targetting iOS" -# endif -#else -# error "unrecognized architecture for targetting Darwin" -#endif - -char *strerror(int) __asm(__STRERROR_NAME); - -#endif /* __STRING_H__ */ diff --git a/SDKs/darwin/usr/include/sys/errno.h b/SDKs/darwin/usr/include/sys/errno.h deleted file mode 100644 index 4befe385535..00000000000 --- a/SDKs/darwin/usr/include/sys/errno.h +++ /dev/null @@ -1,31 +0,0 @@ -/* ===-- errno.h - stub SDK header for compiler-rt --------------------------=== - * - * The LLVM Compiler Infrastructure - * - * This file is dual licensed under the MIT and the University of Illinois Open - * Source Licenses. See LICENSE.TXT for details. - * - * ===-----------------------------------------------------------------------=== - * - * This is a stub SDK header file. This file is not part of the interface of - * this library nor an official version of the appropriate SDK header. It is - * intended only to stub the features of this header required by compiler-rt. - * - * ===-----------------------------------------------------------------------=== - */ - -#ifndef _SYS_ERRNO_H_ -#define _SYS_ERRNO_H_ - -#if defined(__cplusplus) -extern "C" { -#endif - -extern int *__error(void); -#define errno (*__error()) - -#if defined(__cplusplus) -} -#endif - -#endif diff --git a/SDKs/darwin/usr/include/sys/fcntl.h b/SDKs/darwin/usr/include/sys/fcntl.h deleted file mode 100644 index b71706bf453..00000000000 --- a/SDKs/darwin/usr/include/sys/fcntl.h +++ /dev/null @@ -1,52 +0,0 @@ -/* ===-- fcntl.h - stub SDK header for compiler-rt --------------------------=== - * - * The LLVM Compiler Infrastructure - * - * This file is dual licensed under the MIT and the University of Illinois Open - * Source Licenses. See LICENSE.TXT for details. - * - * ===-----------------------------------------------------------------------=== - * - * This is a stub SDK header file. This file is not part of the interface of - * this library nor an official version of the appropriate SDK header. It is - * intended only to stub the features of this header required by compiler-rt. - * - * ===-----------------------------------------------------------------------=== - */ - -#ifndef _SYS_FCNTL_H_ -#define _SYS_FCNTL_H_ - -/* Determine the appropriate open function. */ -#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) -# if defined(__i386) -# define __OPEN_NAME "_open$UNIX2003" -# elif defined(__x86_64__) -# define __OPEN_NAME "_open" -# elif defined(__arm) -# define __OPEN_NAME "_open" -# else -# error "unrecognized architecture for targetting OS X" -# endif -#elif defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) -# if defined(__i386) || defined (__x86_64) -# define __OPEN_NAME "_open" -# elif defined(__arm) -# define __OPEN_NAME "_open" -# else -# error "unrecognized architecture for targetting iOS" -# endif -#else -# error "unrecognized architecture for targetting Darwin" -#endif - -#define O_RDONLY 0x0000 /* open for reading only */ -#define O_WRONLY 0x0001 /* open for writing only */ -#define O_RDWR 0x0002 /* open for reading and writing */ -#define O_ACCMODE 0x0003 /* mask for above modes */ - -#define O_CREAT 0x0200 /* create if nonexistant */ - -int open(const char *, int, ...) __asm(__OPEN_NAME); - -#endif /* !_SYS_FCNTL_H_ */ diff --git a/SDKs/darwin/usr/include/sys/mman.h b/SDKs/darwin/usr/include/sys/mman.h deleted file mode 100644 index 84561f1b6ab..00000000000 --- a/SDKs/darwin/usr/include/sys/mman.h +++ /dev/null @@ -1,42 +0,0 @@ -/* ===-- mman.h - stub SDK header for compiler-rt ---------------------------=== - * - * The LLVM Compiler Infrastructure - * - * This file is dual licensed under the MIT and the University of Illinois Open - * Source Licenses. See LICENSE.TXT for details. - * - * ===-----------------------------------------------------------------------=== - * - * This is a stub SDK header file. This file is not part of the interface of - * this library nor an official version of the appropriate SDK header. It is - * intended only to stub the features of this header required by compiler-rt. - * - * ===-----------------------------------------------------------------------=== - */ - -#ifndef __SYS_MMAN_H__ -#define __SYS_MMAN_H__ - -typedef __SIZE_TYPE__ size_t; - -#define PROT_NONE 0x00 -#define PROT_READ 0x01 -#define PROT_WRITE 0x02 -#define PROT_EXEC 0x04 - -#define MAP_SHARED 0x0001 -#define MAP_PRIVATE 0x0002 - -#define MAP_FILE 0x0000 -#define MAP_ANON 0x1000 - -#define MS_ASYNC 0x0001 -#define MS_INVALIDATE 0x0002 -#define MS_SYNC 0x0010 - -void *mmap(void *addr, size_t len, int prot, int flags, int fd, - long long offset); -int munmap(void *addr, size_t len); -int msync(void *addr, size_t len, int flags); - -#endif /* __SYS_MMAN_H__ */ diff --git a/SDKs/darwin/usr/include/sys/stat.h b/SDKs/darwin/usr/include/sys/stat.h deleted file mode 100644 index 6225f908168..00000000000 --- a/SDKs/darwin/usr/include/sys/stat.h +++ /dev/null @@ -1,25 +0,0 @@ -/* ===-- stat.h - stub SDK header for compiler-rt ---------------------------=== - * - * The LLVM Compiler Infrastructure - * - * This file is dual licensed under the MIT and the University of Illinois Open - * Source Licenses. See LICENSE.TXT for details. - * - * ===-----------------------------------------------------------------------=== - * - * This is a stub SDK header file. This file is not part of the interface of - * this library nor an official version of the appropriate SDK header. It is - * intended only to stub the features of this header required by compiler-rt. - * - * ===-----------------------------------------------------------------------=== - */ - -#ifndef __SYS_STAT_H__ -#define __SYS_STAT_H__ - -typedef unsigned short uint16_t; -typedef uint16_t mode_t; - -int mkdir(const char *, mode_t); - -#endif /* __SYS_STAT_H__ */ diff --git a/SDKs/darwin/usr/include/sys/types.h b/SDKs/darwin/usr/include/sys/types.h deleted file mode 100644 index b425767b831..00000000000 --- a/SDKs/darwin/usr/include/sys/types.h +++ /dev/null @@ -1,20 +0,0 @@ -/* ===-- types.h - stub SDK header for compiler-rt --------------------------=== - * - * The LLVM Compiler Infrastructure - * - * This file is dual licensed under the MIT and the University of Illinois Open - * Source Licenses. See LICENSE.TXT for details. - * - * ===-----------------------------------------------------------------------=== - * - * This is a stub SDK header file. This file is not part of the interface of - * this library nor an official version of the appropriate SDK header. It is - * intended only to stub the features of this header required by compiler-rt. - * - * ===-----------------------------------------------------------------------=== - */ - -#ifndef __SYS_TYPES_H__ -#define __SYS_TYPES_H__ - -#endif /* __SYS_TYPES_H__ */ diff --git a/SDKs/linux/usr/include/stdio.h b/SDKs/linux/usr/include/stdio.h index fba593640c3..e2161daa468 100644 --- a/SDKs/linux/usr/include/stdio.h +++ b/SDKs/linux/usr/include/stdio.h @@ -35,6 +35,7 @@ extern int fflush(FILE *); extern FILE *fopen(const char * restrict, const char * restrict); extern FILE *fdopen(int, const char * restrict); extern int fprintf(FILE * restrict, const char * restrict, ...); +extern int fputc(int, FILE *); extern size_t fwrite(const void * restrict, size_t, size_t, FILE * restrict); extern size_t fread(void * restrict, size_t, size_t, FILE * restrict); extern long ftell(FILE *); diff --git a/cmake/Modules/AddCompilerRT.cmake b/cmake/Modules/AddCompilerRT.cmake index fd117ac522c..3edd854fdee 100644 --- a/cmake/Modules/AddCompilerRT.cmake +++ b/cmake/Modules/AddCompilerRT.cmake @@ -1,4 +1,5 @@ include(AddLLVM) +include(ExternalProject) include(LLVMParseArguments) include(CompilerRTUtils) @@ -13,7 +14,7 @@ macro(add_compiler_rt_object_library name arch) parse_arguments(LIB "SOURCES;CFLAGS;DEFS" "" ${ARGN}) add_library(${name}.${arch} OBJECT ${LIB_SOURCES}) set_target_compile_flags(${name}.${arch} - ${TARGET_${arch}_CFLAGS} ${LIB_CFLAGS}) + ${CMAKE_CXX_FLAGS} ${TARGET_${arch}_CFLAGS} ${LIB_CFLAGS}) set_property(TARGET ${name}.${arch} APPEND PROPERTY COMPILE_DEFINITIONS ${LIB_DEFS}) else() @@ -37,34 +38,47 @@ macro(add_compiler_rt_darwin_object_library name os) COMPILE_DEFINITIONS ${LIB_DEFS}) endmacro() -# Adds static runtime for a given architecture and puts it in the proper -# directory in the build and install trees. -# add_compiler_rt_static_runtime( -# SOURCES -# CFLAGS -# DEFS ) -macro(add_compiler_rt_static_runtime name arch) +# Adds static or shared runtime for a given architecture and puts it in the +# proper directory in the build and install trees. +# add_compiler_rt_runtime( {STATIC,SHARED} +# SOURCES +# CFLAGS +# DEFS +# OUTPUT_NAME ) +macro(add_compiler_rt_runtime name arch type) if(CAN_TARGET_${arch}) - parse_arguments(LIB "SOURCES;CFLAGS;DEFS" "" ${ARGN}) - add_library(${name} STATIC ${LIB_SOURCES}) + parse_arguments(LIB "SOURCES;CFLAGS;DEFS;OUTPUT_NAME" "" ${ARGN}) + add_library(${name} ${type} ${LIB_SOURCES}) # Setup compile flags and definitions. set_target_compile_flags(${name} ${TARGET_${arch}_CFLAGS} ${LIB_CFLAGS}) + set_target_link_flags(${name} + ${TARGET_${arch}_CFLAGS} ${LIB_CFLAGS}) set_property(TARGET ${name} APPEND PROPERTY COMPILE_DEFINITIONS ${LIB_DEFS}) # Setup correct output directory in the build tree. set_target_properties(${name} PROPERTIES - ARCHIVE_OUTPUT_DIRECTORY ${COMPILER_RT_LIBRARY_OUTPUT_DIR}) + ARCHIVE_OUTPUT_DIRECTORY ${COMPILER_RT_LIBRARY_OUTPUT_DIR} + LIBRARY_OUTPUT_DIRECTORY ${COMPILER_RT_LIBRARY_OUTPUT_DIR} + RUNTIME_OUTPUT_DIRECTORY ${COMPILER_RT_LIBRARY_OUTPUT_DIR}) + if ("${LIB_OUTPUT_NAME}" STREQUAL "") + set_target_properties(${name} PROPERTIES + OUTPUT_NAME ${name}${COMPILER_RT_OS_SUFFIX}) + else() + set_target_properties(${name} PROPERTIES + OUTPUT_NAME ${LIB_OUTPUT_NAME}) + endif() # Add installation command. install(TARGETS ${name} - ARCHIVE DESTINATION ${COMPILER_RT_LIBRARY_INSTALL_DIR}) - add_dependencies(compiler-rt ${name}) + ARCHIVE DESTINATION ${COMPILER_RT_LIBRARY_INSTALL_DIR} + LIBRARY DESTINATION ${COMPILER_RT_LIBRARY_INSTALL_DIR} + RUNTIME DESTINATION ${COMPILER_RT_LIBRARY_INSTALL_DIR}) else() message(FATAL_ERROR "Archtecture ${arch} can't be targeted") endif() endmacro() -# Same as add_compiler_rt_static_runtime, but creates a universal library +# Same as add_compiler_rt_runtime(... STATIC), but creates a universal library # for several architectures. # add_compiler_rt_osx_static_runtime( ARCH # SOURCES @@ -81,7 +95,6 @@ macro(add_compiler_rt_osx_static_runtime name) ARCHIVE_OUTPUT_DIRECTORY ${COMPILER_RT_LIBRARY_OUTPUT_DIR}) install(TARGETS ${name} ARCHIVE DESTINATION ${COMPILER_RT_LIBRARY_INSTALL_DIR}) - add_dependencies(compiler-rt ${name}) endmacro() # Adds dynamic runtime library on osx/iossim, which supports multiple @@ -104,20 +117,43 @@ macro(add_compiler_rt_darwin_dynamic_runtime name os) LIBRARY_OUTPUT_DIRECTORY ${COMPILER_RT_LIBRARY_OUTPUT_DIR}) install(TARGETS ${name} LIBRARY DESTINATION ${COMPILER_RT_LIBRARY_INSTALL_DIR}) - add_dependencies(compiler-rt ${name}) endmacro() +set(COMPILER_RT_TEST_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_INCLUDE_CFLAGS +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} ) -# Use Clang to link objects into a single executable with just-built -# Clang, using specific link flags. Make executable a part of provided +if(MSVC) + # clang doesn't support exceptions on Windows yet. + list(APPEND COMPILER_RT_TEST_CFLAGS + -D_HAS_EXCEPTIONS=0) + + # We should teach clang to understand "#pragma intrinsic", see PR19898. + list(APPEND COMPILER_RT_TEST_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) + + # Visual Studio 2012 only supports up to 8 template parameters in + # std::tr1::tuple by default, but gtest requires 10 + if(MSVC_VERSION EQUAL 1700) + list(APPEND COMPILER_RT_GTEST_CFLAGS -D_VARIADIC_MAX=10) + endif() +endif() + +# 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( # OBJECTS @@ -126,20 +162,98 @@ set(COMPILER_RT_GTEST_INCLUDE_CFLAGS macro(add_compiler_rt_test test_suite test_name) parse_arguments(TEST "OBJECTS;DEPS;LINK_FLAGS" "" ${ARGN}) set(output_bin "${CMAKE_CURRENT_BINARY_DIR}/${test_name}") + # Use host compiler in a standalone build, and just-built Clang otherwise. + if(NOT COMPILER_RT_STANDALONE_BUILD) + list(APPEND TEST_DEPS clang) + endif() + # 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_target(${test_name} - COMMAND clang ${TEST_OBJECTS} -o "${output_bin}" + COMMAND ${COMPILER_RT_TEST_COMPILER} ${TEST_OBJECTS} + -o "${output_bin}" ${TEST_LINK_FLAGS} - DEPENDS clang ${TEST_DEPS}) + DEPENDS ${TEST_DEPS}) # Make the test suite depend on the binary. add_dependencies(${test_suite} ${test_name}) endmacro() macro(add_compiler_rt_resource_file target_name file_name) set(src_file "${CMAKE_CURRENT_SOURCE_DIR}/${file_name}") - set(dst_file "${CLANG_RESOURCE_DIR}/${file_name}") - add_custom_target(${target_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} - DEPENDS ${file_name}) + COMMENT "Copying ${file_name}...") + add_custom_target(${target_name} DEPENDS ${dst_file}) # Install in Clang resource directory. - install(FILES ${file_name} DESTINATION ${LIBCLANG_INSTALL_PATH}) + install(FILES ${file_name} DESTINATION ${COMPILER_RT_INSTALL_PATH}) +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_HAS_LIBCXX_SOURCES) + message(FATAL_ERROR "libcxx not found!") + endif() + + parse_arguments(LIBCXX "DEPS;CFLAGS" "" ${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_C_COMPILER=${COMPILER_RT_TEST_COMPILER} + -DCMAKE_CXX_COMPILER=${COMPILER_RT_TEST_COMPILER} + -DCMAKE_C_FLAGS=${LIBCXX_CFLAGS} + -DCMAKE_CXX_FLAGS=${LIBCXX_CFLAGS} + -DCMAKE_BUILD_TYPE=Release + -DCMAKE_INSTALL_PREFIX:PATH= + LOG_BUILD 1 + LOG_CONFIGURE 1 + LOG_INSTALL 1 + ) + + 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() diff --git a/cmake/Modules/CompilerRTCompile.cmake b/cmake/Modules/CompilerRTCompile.cmake index 2794cabe59c..af3df8ff4f4 100644 --- a/cmake/Modules/CompilerRTCompile.cmake +++ b/cmake/Modules/CompilerRTCompile.cmake @@ -1,6 +1,6 @@ include(LLVMParseArguments) -# Compile a source into an object file with just-built Clang using +# Compile a source into an object file with COMPILER_RT_TEST_COMPILER using # a provided compile flags and dependenices. # clang_compile( # CFLAGS @@ -8,9 +8,74 @@ include(LLVMParseArguments) macro(clang_compile object_file source) parse_arguments(SOURCE "CFLAGS;DEPS" "" ${ARGN}) get_filename_component(source_rpath ${source} REALPATH) + if(NOT COMPILER_RT_STANDALONE_BUILD) + list(APPEND SOURCE_DEPS clang) + endif() + if (TARGET CompilerRTUnitTestCheckCxx) + list(APPEND SOURCE_DEPS CompilerRTUnitTestCheckCxx) + endif() + string(REGEX MATCH "[.](cc|cpp)$" is_cxx ${source_rpath}) + if(is_cxx) + string(REPLACE " " ";" global_flags "${CMAKE_CXX_FLAGS}") + else() + string(REPLACE " " ";" global_flags "${CMAKE_C_FLAGS}") + endif() + # On Windows, CMAKE_*_FLAGS are built for MSVC but we use the GCC clang.exe + # which doesn't support flags starting with "/smth". Replace those with + # "-smth" equivalents. + if(MSVC) + string(REGEX REPLACE "^/" "-" global_flags "${global_flags}") + string(REPLACE ";/" ";-" global_flags "${global_flags}") + 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 clang ${SOURCE_CFLAGS} -c -o "${object_file}" ${source_rpath} + COMMAND ${COMPILER_RT_TEST_COMPILER} ${compile_flags} -c + -o "${object_file}" + ${source_rpath} MAIN_DEPENDENCY ${source} - DEPENDS clang ${SOURCE_DEPS}) + DEPENDS ${SOURCE_DEPS}) +endmacro() + +# 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} -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_SOURCE_DIR}/projects && svn co http://llvm.org/svn/llvm-project/libcxx/trunk libcxx'" + " echo ' cd ${LLVM_BINARY_DIR} && make -C ${LLVM_SOURCE_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 (TARGET clang) + ADD_DEPENDENCIES(CompilerRTUnitTestCheckCxx clang) + endif() + endif() endmacro() diff --git a/cmake/Modules/CompilerRTLink.cmake b/cmake/Modules/CompilerRTLink.cmake index 85030a725e1..0f0e53a3b2f 100644 --- a/cmake/Modules/CompilerRTLink.cmake +++ b/cmake/Modules/CompilerRTLink.cmake @@ -1,14 +1,18 @@ include(LLVMParseArguments) -# Link a shared library with just-built Clang. +# Link a shared library with COMPILER_RT_TEST_COMPILER. # clang_link_shared( # OBJECTS # LINKFLAGS # DEPS ) macro(clang_link_shared so_file) parse_arguments(SOURCE "OBJECTS;LINKFLAGS;DEPS" "" ${ARGN}) + if(NOT COMPILER_RT_STANDALONE_BUILD) + list(APPEND SOURCE_DEPS clang) + endif() add_custom_command( OUTPUT ${so_file} - COMMAND clang -o "${so_file}" -shared ${SOURCE_LINKFLAGS} ${SOURCE_OBJECTS} - DEPENDS clang ${SOURCE_DEPS}) + COMMAND ${COMPILER_RT_TEST_COMPILER} -o "${so_file}" -shared + ${SOURCE_LINKFLAGS} ${SOURCE_OBJECTS} + DEPENDS ${SOURCE_DEPS}) endmacro() diff --git a/cmake/Modules/CompilerRTUtils.cmake b/cmake/Modules/CompilerRTUtils.cmake index fce37e3eb49..ae59732928a 100644 --- a/cmake/Modules/CompilerRTUtils.cmake +++ b/cmake/Modules/CompilerRTUtils.cmake @@ -2,6 +2,7 @@ # 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() @@ -9,24 +10,13 @@ function(set_target_compile_flags target) 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() -# Check if a given flag is present in a space-separated flag_string. -# Store the result in out_var. -function(find_flag_in_string flag_string flag out_var) - string(REPLACE " " ";" flag_list ${flag_string}) - list(FIND flag_list ${flag} flag_pos) - if(NOT flag_pos EQUAL -1) - set(${out_var} TRUE PARENT_SCOPE) - else() - set(${out_var} FALSE PARENT_SCOPE) - endif() -endfunction() - # Set the variable var_PYBOOL to True if var holds a true-ish string, # otherwise set it to False. macro(pythonize_bool var) @@ -36,3 +26,26 @@ macro(pythonize_bool var) 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_no_rtti_flag list) + append_list_if(COMPILER_RT_HAS_FNO_RTTI_FLAG -fno-rtti ${list}) + append_list_if(COMPILER_RT_HAS_GR_FLAG /GR- ${list}) +endmacro() diff --git a/cmake/Modules/SanitizerUtils.cmake b/cmake/Modules/SanitizerUtils.cmake index 0836edee264..1ebc7030a57 100644 --- a/cmake/Modules/SanitizerUtils.cmake +++ b/cmake/Modules/SanitizerUtils.cmake @@ -12,21 +12,36 @@ set(SANITIZER_LINT_SCRIPT # symbol names that should be exported as well. # add_sanitizer_rt_symbols( ) macro(add_sanitizer_rt_symbols name) - get_target_property(libfile ${name} LOCATION) - set(symsfile "${libfile}.syms") - add_custom_command(OUTPUT ${symsfile} + set(stamp ${CMAKE_CURRENT_BINARY_DIR}/${name}.syms-stamp) + add_custom_command(OUTPUT ${stamp} COMMAND ${PYTHON_EXECUTABLE} - ${SANITIZER_GEN_DYNAMIC_LIST} ${libfile} ${ARGN} - > ${symsfile} + ${SANITIZER_GEN_DYNAMIC_LIST} $ ${ARGN} + > $.syms + COMMAND ${CMAKE_COMMAND} -E touch ${stamp} DEPENDS ${name} ${SANITIZER_GEN_DYNAMIC_LIST} ${ARGN} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMMENT "Generating exported symbols for ${name}" VERBATIM) add_custom_target(${name}-symbols ALL - DEPENDS ${symsfile} + DEPENDS ${stamp} SOURCES ${SANITIZER_GEN_DYNAMIC_LIST} ${ARGN}) - install(FILES ${symsfile} DESTINATION ${COMPILER_RT_LIBRARY_INSTALL_DIR}) - add_dependencies(compiler-rt ${name}-symbols) + + if(NOT CMAKE_VERSION VERSION_LESS 3.0) + install(FILES $.syms + DESTINATION ${COMPILER_RT_LIBRARY_INSTALL_DIR}) + else() + # Per-config install location. + if(CMAKE_CONFIGURATION_TYPES) + foreach(c ${CMAKE_CONFIGURATION_TYPES}) + get_target_property(libfile ${name} LOCATION_${c}) + install(FILES ${libfile}.syms CONFIGURATIONS ${c} + DESTINATION ${COMPILER_RT_LIBRARY_INSTALL_DIR}) + endforeach() + else() + get_target_property(libfile ${name} LOCATION_${CMAKE_BUILD_TYPE}) + install(FILES ${libfile}.syms DESTINATION ${COMPILER_RT_LIBRARY_INSTALL_DIR}) + endif() + endif() endmacro() # Add target to check code style for sanitizer runtimes. @@ -34,6 +49,7 @@ if(UNIX) add_custom_target(SanitizerLintCheck COMMAND 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..." diff --git a/cmake/config-ix.cmake b/cmake/config-ix.cmake new file mode 100644 index 00000000000..5f921bf97f5 --- /dev/null +++ b/cmake/config-ix.cmake @@ -0,0 +1,258 @@ +include(CheckCXXCompilerFlag) +include(CheckLibraryExists) +include(CheckSymbolExists) + +# 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(-fvisibility=hidden COMPILER_RT_HAS_FVISIBILITY_HIDDEN_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(/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(/W3 COMPILER_RT_HAS_W3_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(/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(c printf "" COMPILER_RT_HAS_LIBC) +check_library_exists(dl dlopen "" COMPILER_RT_HAS_LIBDL) +check_library_exists(m pow "" COMPILER_RT_HAS_LIBM) +check_library_exists(pthread pthread_create "" COMPILER_RT_HAS_LIBPTHREAD) +check_library_exists(stdc++ __cxa_throw "" COMPILER_RT_HAS_LIBSTDCXX) + +# 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() {}\n") + +# test_target_arch( ) +# Sets the target flags for a given architecture and determines if this +# architecture is supported by trying to build a simple file. +macro(test_target_arch arch) + set(TARGET_${arch}_CFLAGS ${ARGN}) + set(argstring "${CMAKE_EXE_LINKER_FLAGS}") + foreach(arg ${ARGN}) + set(argstring "${argstring} ${arg}") + endforeach() + try_compile(CAN_TARGET_${arch} ${CMAKE_BINARY_DIR} ${SIMPLE_SOURCE} + COMPILE_DEFINITIONS "${TARGET_${arch}_CFLAGS}" + OUTPUT_VARIABLE TARGET_${arch}_OUTPUT + CMAKE_FLAGS "-DCMAKE_EXE_LINKER_FLAGS:STRING=${argstring}") + if(${CAN_TARGET_${arch}}) + list(APPEND COMPILER_RT_SUPPORTED_ARCH ${arch}) + elseif("${COMPILER_RT_TEST_TARGET_ARCH}" MATCHES "${arch}") + # 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() + +# 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() + +macro(detect_target_arch) + check_symbol_exists(__arm__ "" __ARM) + check_symbol_exists(__aarch64__ "" __AARCH64) + check_symbol_exists(__x86_64__ "" __X86_64) + check_symbol_exists(__i686__ "" __I686) + check_symbol_exists(__i386__ "" __I386) + check_symbol_exists(__mips__ "" __MIPS) + check_symbol_exists(__mips64__ "" __MIPS64) + if(__ARM) + add_default_target_arch(arm) + elseif(__AARCH64) + add_default_target_arch(aarch64) + elseif(__X86_64) + add_default_target_arch(x86_64) + elseif(__I686) + add_default_target_arch(i686) + 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) + endif() +endmacro() + +# Generate the COMPILER_RT_SUPPORTED_ARCH list. +if(ANDROID) + # Can't rely on LLVM_NATIVE_ARCH in cross-compilation. + # Examine compiler output instead. + detect_target_arch() + set(COMPILER_RT_OS_SUFFIX "-android") +else() + if("${LLVM_NATIVE_ARCH}" STREQUAL "X86") + if (NOT MSVC) + test_target_arch(x86_64 ${TARGET_64_BIT_CFLAGS}) + endif() + test_target_arch(i386 ${TARGET_32_BIT_CFLAGS}) + elseif("${LLVM_NATIVE_ARCH}" STREQUAL "PowerPC") + test_target_arch(powerpc64 ${TARGET_64_BIT_CFLAGS}) + test_target_arch(powerpc64le ${TARGET_64_BIT_CFLAGS}) + elseif("${LLVM_NATIVE_ARCH}" STREQUAL "Mips") + if("${COMPILER_RT_TEST_TARGET_ARCH}" MATCHES "mipsel|mips64el") + # regex for mipsel, mips64el + test_target_arch(mipsel ${TARGET_32_BIT_CFLAGS}) + test_target_arch(mips64el ${TARGET_64_BIT_CFLAGS}) + else() + test_target_arch(mips ${TARGET_32_BIT_CFLAGS}) + test_target_arch(mips64 ${TARGET_64_BIT_CFLAGS}) + endif() + elseif("${COMPILER_RT_TEST_TARGET_ARCH}" MATCHES "arm") + test_target_arch(arm "-march=armv7-a") + elseif("${COMPILER_RT_TEST_TARGET_ARCH}" MATCHES "aarch32") + test_target_arch(aarch32 "-march=armv8-a") + elseif("${COMPILER_RT_TEST_TARGET_ARCH}" MATCHES "aarch64") + test_target_arch(aarch64 "-march=aarch64") + endif() + set(COMPILER_RT_OS_SUFFIX "") +endif() + +message(STATUS "Compiler-RT supported architectures: ${COMPILER_RT_SUPPORTED_ARCH}") + +# Takes ${ARGN} and puts only supported architectures in @out_var list. +function(filter_available_targets out_var) + set(archs) + 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() + +# Arhcitectures supported by compiler-rt libraries. +filter_available_targets(SANITIZER_COMMON_SUPPORTED_ARCH + x86_64 i386 i686 powerpc64 powerpc64le arm aarch64 mips mips64 mipsel mips64el) +filter_available_targets(ASAN_SUPPORTED_ARCH + x86_64 i386 i686 powerpc64 powerpc64le arm mips mipsel mips64 mips64el) +filter_available_targets(DFSAN_SUPPORTED_ARCH x86_64 mips64 mips64el) +filter_available_targets(LSAN_SUPPORTED_ARCH x86_64) +# LSan 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(MSAN_SUPPORTED_ARCH x86_64 mips64 mips64el) +filter_available_targets(PROFILE_SUPPORTED_ARCH x86_64 i386 i686 arm mips mips64 + mipsel mips64el aarch64 powerpc64 powerpc64le) +filter_available_targets(TSAN_SUPPORTED_ARCH x86_64) +filter_available_targets(UBSAN_SUPPORTED_ARCH x86_64 i386 i686 arm aarch64 mips mipsel) + +if(ANDROID) + set(OS_NAME "Android") +else() + set(OS_NAME "${CMAKE_SYSTEM_NAME}") +endif() + +if (SANITIZER_COMMON_SUPPORTED_ARCH AND NOT LLVM_USE_SANITIZER AND + (OS_NAME MATCHES "Android|Darwin|Linux|FreeBSD" OR + (OS_NAME MATCHES "Windows" AND MSVC AND CMAKE_SIZEOF_VOID_P EQUAL 4))) + set(COMPILER_RT_HAS_SANITIZER_COMMON TRUE) +else() + set(COMPILER_RT_HAS_SANITIZER_COMMON 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() + +# 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") + set(COMPILER_RT_HAS_LSAN TRUE) +else() + set(COMPILER_RT_HAS_LSAN FALSE) +endif() + +if (COMPILER_RT_HAS_SANITIZER_COMMON AND LSAN_COMMON_SUPPORTED_ARCH AND + OS_NAME MATCHES "Darwin|Linux|FreeBSD|Android") + set(COMPILER_RT_HAS_LSAN_COMMON TRUE) +else() + set(COMPILER_RT_HAS_LSAN_COMMON FALSE) +endif() + +if (COMPILER_RT_HAS_SANITIZER_COMMON AND MSAN_SUPPORTED_ARCH AND + OS_NAME MATCHES "Linux") + set(COMPILER_RT_HAS_MSAN TRUE) +else() + set(COMPILER_RT_HAS_MSAN FALSE) +endif() + +if (PROFILE_SUPPORTED_ARCH AND + OS_NAME MATCHES "Darwin|Linux|FreeBSD") + 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 "Linux|FreeBSD") + 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") + set(COMPILER_RT_HAS_UBSAN TRUE) +else() + set(COMPILER_RT_HAS_UBSAN FALSE) +endif() + diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt index d8a73872ba4..7f8664e0997 100644 --- a/include/CMakeLists.txt +++ b/include/CMakeLists.txt @@ -1,16 +1,14 @@ set(SANITIZER_HEADERS + sanitizer/allocator_interface.h sanitizer/asan_interface.h sanitizer/common_interface_defs.h sanitizer/dfsan_interface.h sanitizer/linux_syscall_hooks.h sanitizer/lsan_interface.h - sanitizer/msan_interface.h) + sanitizer/msan_interface.h + sanitizer/tsan_interface_atomic.h) -set(output_dir ${LLVM_BINARY_DIR}/lib/clang/${CLANG_VERSION}/include) - -if(MSVC_IDE OR XCODE) - set(other_output_dir ${LLVM_BINARY_DIR}/bin/lib/clang/${CLANG_VERSION}/include) -endif() +set(output_dir ${COMPILER_RT_OUTPUT_DIR}/include) # Copy compiler-rt headers to the build tree. set(out_files) @@ -22,15 +20,6 @@ foreach( f ${SANITIZER_HEADERS} ) COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src} ${dst} COMMENT "Copying compiler-rt's ${f}...") list(APPEND out_files ${dst}) - - if(other_output_dir) - set(other_dst ${other_output_dir}/${f}) - add_custom_command(OUTPUT ${other_dst} - DEPENDS ${src} - COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src} ${other_dst} - COMMENT "Copying compiler-rt's ${f}...") - list(APPEND out_files ${other_dst}) - endif() endforeach( f ) add_custom_target(compiler-rt-headers ALL DEPENDS ${out_files}) @@ -39,4 +28,4 @@ add_dependencies(compiler-rt compiler-rt-headers) # Install sanitizer headers. install(FILES ${SANITIZER_HEADERS} PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ - DESTINATION ${LIBCLANG_INSTALL_PATH}/include/sanitizer) + DESTINATION ${COMPILER_RT_INSTALL_PATH}/include/sanitizer) diff --git a/include/sanitizer/allocator_interface.h b/include/sanitizer/allocator_interface.h new file mode 100644 index 00000000000..ab251f89c61 --- /dev/null +++ b/include/sanitizer/allocator_interface.h @@ -0,0 +1,66 @@ +//===-- 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(); + + /* 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(); + + /* 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(); + + /* Number of bytes in unmapped pages, that are released to OS. Currently, + always returns 0. */ + size_t __sanitizer_get_unmapped_bytes(); + + /* 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); +#ifdef __cplusplus +} // extern "C" +#endif + +#endif diff --git a/include/sanitizer/asan_interface.h b/include/sanitizer/asan_interface.h index 8adf3f17f24..435391486aa 100644 --- a/include/sanitizer/asan_interface.h +++ b/include/sanitizer/asan_interface.h @@ -50,22 +50,65 @@ extern "C" { ((void)(addr), (void)(size)) #endif - // Returns true iff addr is poisoned (i.e. 1-byte read/write access to this + // Returns 1 if addr is poisoned (i.e. 1-byte read/write access to this // address will result in error report from AddressSanitizer). - bool __asan_address_is_poisoned(void const volatile *addr); + // Otherwise returns 0. + int __asan_address_is_poisoned(void const volatile *addr); - // If at least on byte in [beg, beg+size) is poisoned, return the address + // 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(); + + // 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 *__asan_get_report_bp(); + void *__asan_get_report_sp(); + void *__asan_get_report_address(); + int __asan_get_report_access_type(); + size_t __asan_get_report_access_size(); + const char *__asan_get_report_description(); + + // 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, bool is_write, size_t access_size); + void *addr, int is_write, size_t access_size); // Sets the exit code to use when reporting an error. // Returns the old value. @@ -82,40 +125,6 @@ extern "C" { // the program crashes before ASan report is printed. void __asan_on_error(); - // User may provide its own implementation for symbolization function. - // It should print the description of instruction at address "pc" to - // "out_buffer". Description should be at most "out_size" bytes long. - // User-specified function should return true if symbolization was - // successful. - bool __asan_symbolize(const void *pc, char *out_buffer, - int out_size); - - // Returns the estimated number of bytes that will be reserved by allocator - // for request of "size" bytes. If ASan allocator can't allocate that much - // memory, returns the maximal possible allocation size, otherwise returns - // "size". - size_t __asan_get_estimated_allocated_size(size_t size); - // Returns true if p was returned by the ASan allocator and - // is not yet freed. - bool __asan_get_ownership(const void *p); - // Returns the number of bytes reserved for the pointer p. - // Requires (get_ownership(p) == true) or (p == 0). - size_t __asan_get_allocated_size(const void *p); - // Number of bytes, allocated and not yet freed by the application. - size_t __asan_get_current_allocated_bytes(); - // Number of bytes, mmaped by asan 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 __asan_get_heap_size(); - // Number of bytes, mmaped by asan 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 __asan_get_free_bytes() later. - size_t __asan_get_free_bytes(); - // Number of bytes in unmapped pages, that are released to OS. Currently, - // always returns 0. - size_t __asan_get_unmapped_bytes(); // Prints accumulated stats to stderr. Used for debugging. void __asan_print_accumulated_stats(); @@ -123,13 +132,23 @@ extern "C" { // a string containing ASan runtime options. See asan_flags.h for details. const char* __asan_default_options(); - // Malloc hooks that may be optionally provided by user. - // __asan_malloc_hook(ptr, size) is called immediately after - // allocation of "size" bytes, which returned "ptr". - // __asan_free_hook(ptr) is called immediately before - // deallocation of "ptr". - void __asan_malloc_hook(void *ptr, size_t size); - void __asan_free_hook(void *ptr); + // 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(); + + // 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); + #ifdef __cplusplus } // extern "C" #endif diff --git a/include/sanitizer/common_interface_defs.h b/include/sanitizer/common_interface_defs.h index 4cc2aeae23c..9cb5ad88de6 100644 --- a/include/sanitizer/common_interface_defs.h +++ b/include/sanitizer/common_interface_defs.h @@ -24,13 +24,28 @@ #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); // 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(void *reserved); + 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 @@ -47,8 +62,17 @@ extern "C" { void __sanitizer_unaligned_store32(void *p, uint32_t x); void __sanitizer_unaligned_store64(void *p, uint64_t x); + // Initialize coverage. + void __sanitizer_cov_init(); // Record and dump coverage info. void __sanitizer_cov_dump(); + // Open .sancov.packed in the coverage directory and return the file + // descriptor. Returns -1 on failure, or if coverage dumping is disabled. + // This is intended for use by sandboxing code. + intptr_t __sanitizer_maybe_open_cov_file(const char *name); + // Get the number of total unique covered entities (blocks, edges, calls). + // This can be useful for coverage-directed in-process fuzzers. + uintptr_t __sanitizer_get_total_unique_coverage(); // Annotate the current state of a contiguous container, such as // std::vector, std::string or similar. @@ -56,7 +80,7 @@ extern "C" { // 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; - // end <= mid <= end. For example, in "std::vector<> v" + // 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]); @@ -70,9 +94,31 @@ extern "C" { // // Use with caution and don't use for anything other than vector-like classes. // - // For AddressSanitizer, 'beg' should be 8-aligned. - void __sanitizer_annotate_contiguous_container(void *beg, void *end, - void *old_mid, void *new_mid); + // 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); + + // Print the stack trace leading to this call. Useful for debugging user code. + void __sanitizer_print_stack_trace(); #ifdef __cplusplus } // extern "C" diff --git a/include/sanitizer/dfsan_interface.h b/include/sanitizer/dfsan_interface.h index f14d45a2b2a..79dbf2f364c 100644 --- a/include/sanitizer/dfsan_interface.h +++ b/include/sanitizer/dfsan_interface.h @@ -39,6 +39,9 @@ struct dfsan_label_info { 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); @@ -74,6 +77,20 @@ int dfsan_has_label(dfsan_label label, dfsan_label elem); /// 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: +/// +///