Index: compiler-rt/trunk/lib/ubsan/ubsan_interface.inc =================================================================== --- compiler-rt/trunk/lib/ubsan/ubsan_interface.inc +++ compiler-rt/trunk/lib/ubsan/ubsan_interface.inc @@ -16,6 +16,8 @@ INTERFACE_FUNCTION(__ubsan_handle_cfi_check_fail_abort) INTERFACE_FUNCTION(__ubsan_handle_divrem_overflow) INTERFACE_FUNCTION(__ubsan_handle_divrem_overflow_abort) +INTERFACE_FUNCTION(__ubsan_handle_dynamic_type_cache_miss) +INTERFACE_FUNCTION(__ubsan_handle_dynamic_type_cache_miss_abort) INTERFACE_FUNCTION(__ubsan_handle_float_cast_overflow) INTERFACE_FUNCTION(__ubsan_handle_float_cast_overflow_abort) INTERFACE_FUNCTION(__ubsan_handle_function_type_mismatch) Index: compiler-rt/trunk/test/asan/TestCases/Darwin/interface_symbols_darwin.c =================================================================== --- compiler-rt/trunk/test/asan/TestCases/Darwin/interface_symbols_darwin.c +++ compiler-rt/trunk/test/asan/TestCases/Darwin/interface_symbols_darwin.c @@ -1,37 +0,0 @@ -// Check the presence of interface symbols in the ASan runtime dylib. -// If you're changing this file, please also change -// ../Linux/interface_symbols.c - -// RUN: %clang_asan -dead_strip -O2 %s -o %t.exe -// -// note: we can not use -D on Darwin. -// RUN: nm -g `%clang_asan %s -fsanitize=address -### 2>&1 | grep "libclang_rt.asan_osx_dynamic.dylib" | sed -e 's/.*"\(.*libclang_rt.asan_osx_dynamic.dylib\)".*/\1/'` \ -// RUN: | grep " [TU] " \ -// RUN: | grep -o "\(__asan_\|__ubsan_\|__sancov_\|__sanitizer_\)[^ ]*" \ -// RUN: | grep -v "__sanitizer_syscall" \ -// RUN: | grep -v "__sanitizer_weak_hook" \ -// RUN: | grep -v "__sanitizer_mz" \ -// RUN: | grep -v "__ubsan_handle_dynamic_type_cache_miss" \ -// RUN: | grep -v "__sancov_lowest_stack" \ -// RUN: | sed -e "s/__asan_version_mismatch_check_v[0-9]+/__asan_version_mismatch_check/" \ -// RUN: > %t.exports -// -// RUN: grep -e "INTERFACE_\(WEAK_\)\?FUNCTION" \ -// RUN: %p/../../../../lib/asan/asan_interface.inc \ -// RUN: %p/../../../../lib/ubsan/ubsan_interface.inc \ -// RUN: %p/../../../../lib/sanitizer_common/sanitizer_common_interface.inc \ -// RUN: %p/../../../../lib/sanitizer_common/sanitizer_common_interface_posix.inc \ -// RUN: %p/../../../../lib/sanitizer_common/sanitizer_coverage_interface.inc \ -// RUN: | grep -v "__sanitizer_weak_hook" \ -// RUN: | sed -e "s/.*(//" -e "s/).*//" > %t.imports -// -// RUN: cat %t.imports | sort | uniq > %t.imports-sorted -// RUN: cat %t.exports | sort | uniq > %t.exports-sorted -// -// RUN: echo -// RUN: echo "=== NOTE === If you see a mismatch below, please update sanitizer_interface.inc files." -// RUN: diff %t.imports-sorted %t.exports-sorted - -// UNSUPPORTED: ios - -int main() { return 0; } Index: compiler-rt/trunk/test/asan/TestCases/Darwin/interface_symbols_darwin.cc =================================================================== --- compiler-rt/trunk/test/asan/TestCases/Darwin/interface_symbols_darwin.cc +++ compiler-rt/trunk/test/asan/TestCases/Darwin/interface_symbols_darwin.cc @@ -0,0 +1,36 @@ +// Check the presence of interface symbols in the ASan runtime dylib. +// If you're changing this file, please also change +// ../Linux/interface_symbols.c + +// RUN: %clangxx_asan -dead_strip -O2 %s -o %t.exe +// +// note: we can not use -D on Darwin. +// RUN: nm -g `%clang_asan %s -fsanitize=address -### 2>&1 | grep "libclang_rt.asan_osx_dynamic.dylib" | sed -e 's/.*"\(.*libclang_rt.asan_osx_dynamic.dylib\)".*/\1/'` \ +// RUN: | grep " [TU] " \ +// RUN: | grep -o "\(__asan_\|__ubsan_\|__sancov_\|__sanitizer_\)[^ ]*" \ +// RUN: | grep -v "__sanitizer_syscall" \ +// RUN: | grep -v "__sanitizer_weak_hook" \ +// RUN: | grep -v "__sanitizer_mz" \ +// RUN: | grep -v "__sancov_lowest_stack" \ +// RUN: | sed -e "s/__asan_version_mismatch_check_v[0-9]+/__asan_version_mismatch_check/" \ +// RUN: > %t.exports +// +// RUN: grep -e "INTERFACE_\(WEAK_\)\?FUNCTION" \ +// RUN: %p/../../../../lib/asan/asan_interface.inc \ +// RUN: %p/../../../../lib/ubsan/ubsan_interface.inc \ +// RUN: %p/../../../../lib/sanitizer_common/sanitizer_common_interface.inc \ +// RUN: %p/../../../../lib/sanitizer_common/sanitizer_common_interface_posix.inc \ +// RUN: %p/../../../../lib/sanitizer_common/sanitizer_coverage_interface.inc \ +// RUN: | grep -v "__sanitizer_weak_hook" \ +// RUN: | sed -e "s/.*(//" -e "s/).*//" > %t.imports +// +// RUN: cat %t.imports | sort | uniq > %t.imports-sorted +// RUN: cat %t.exports | sort | uniq > %t.exports-sorted +// +// RUN: echo +// RUN: echo "=== NOTE === If you see a mismatch below, please update sanitizer_interface.inc files." +// RUN: diff %t.imports-sorted %t.exports-sorted + +// UNSUPPORTED: ios + +int main() { return 0; } Index: compiler-rt/trunk/test/asan/TestCases/Linux/interface_symbols_linux.c =================================================================== --- compiler-rt/trunk/test/asan/TestCases/Linux/interface_symbols_linux.c +++ compiler-rt/trunk/test/asan/TestCases/Linux/interface_symbols_linux.c @@ -1,33 +0,0 @@ -// Check the presence of interface symbols in compiled file. - -// RUN: %clang_asan -O2 %s -o %t.exe -// RUN: nm -D %t.exe | grep " [TWw] " \ -// RUN: | grep -o "\(__asan_\|__ubsan_\|__sancov_\|__sanitizer_\)[^ ]*" \ -// RUN: | grep -v "__sanitizer_syscall" \ -// RUN: | grep -v "__sanitizer_weak_hook" \ -// RUN: | grep -v "__ubsan_handle_dynamic_type_cache_miss" \ -// RUN: | grep -v "__sancov_lowest_stack" \ -// RUN: | sed -e "s/__asan_version_mismatch_check_v[0-9]+/__asan_version_mismatch_check/" \ -// RUN: > %t.exports -// -// RUN: grep -e "INTERFACE_\(WEAK_\)\?FUNCTION" \ -// RUN: %p/../../../../lib/asan/asan_interface.inc \ -// RUN: %p/../../../../lib/ubsan/ubsan_interface.inc \ -// RUN: %p/../../../../lib/sanitizer_common/sanitizer_common_interface.inc \ -// RUN: %p/../../../../lib/sanitizer_common/sanitizer_common_interface_posix.inc \ -// RUN: %p/../../../../lib/sanitizer_common/sanitizer_coverage_interface.inc \ -// RUN: | grep -v "__sanitizer_weak_hook" \ -// RUN: | sed -e "s/.*(//" -e "s/).*//" > %t.imports -// -// RUN: cat %t.imports | sort | uniq > %t.imports-sorted -// RUN: cat %t.exports | sort | uniq > %t.exports-sorted -// -// RUN: echo -// RUN: echo "=== NOTE === If you see a mismatch below, please update sanitizer_interface.inc files." -// RUN: diff %t.imports-sorted %t.exports-sorted -// -// FIXME: nm -D on powerpc somewhy shows ASan interface symbols residing -// in "initialized data section". -// REQUIRES: x86-target-arch,asan-static-runtime - -int main() { return 0; } Index: compiler-rt/trunk/test/asan/TestCases/Linux/interface_symbols_linux.cc =================================================================== --- compiler-rt/trunk/test/asan/TestCases/Linux/interface_symbols_linux.cc +++ compiler-rt/trunk/test/asan/TestCases/Linux/interface_symbols_linux.cc @@ -0,0 +1,32 @@ +// Check the presence of interface symbols in compiled file. + +// RUN: %clangxx_asan -O2 %s -o %t.exe +// RUN: nm -D %t.exe | grep " [TWw] " \ +// RUN: | grep -o "\(__asan_\|__ubsan_\|__sancov_\|__sanitizer_\)[^ ]*" \ +// RUN: | grep -v "__sanitizer_syscall" \ +// RUN: | grep -v "__sanitizer_weak_hook" \ +// RUN: | grep -v "__sancov_lowest_stack" \ +// RUN: | sed -e "s/__asan_version_mismatch_check_v[0-9]+/__asan_version_mismatch_check/" \ +// RUN: > %t.exports +// +// RUN: grep -e "INTERFACE_\(WEAK_\)\?FUNCTION" \ +// RUN: %p/../../../../lib/asan/asan_interface.inc \ +// RUN: %p/../../../../lib/ubsan/ubsan_interface.inc \ +// RUN: %p/../../../../lib/sanitizer_common/sanitizer_common_interface.inc \ +// RUN: %p/../../../../lib/sanitizer_common/sanitizer_common_interface_posix.inc \ +// RUN: %p/../../../../lib/sanitizer_common/sanitizer_coverage_interface.inc \ +// RUN: | grep -v "__sanitizer_weak_hook" \ +// RUN: | sed -e "s/.*(//" -e "s/).*//" > %t.imports +// +// RUN: cat %t.imports | sort | uniq > %t.imports-sorted +// RUN: cat %t.exports | sort | uniq > %t.exports-sorted +// +// RUN: echo +// RUN: echo "=== NOTE === If you see a mismatch below, please update sanitizer_interface.inc files." +// RUN: diff %t.imports-sorted %t.exports-sorted +// +// FIXME: nm -D on powerpc somewhy shows ASan interface symbols residing +// in "initialized data section". +// REQUIRES: x86-target-arch,asan-static-runtime + +int main() { return 0; } Index: compiler-rt/trunk/test/asan/TestCases/Windows/interface_symbols_windows.c =================================================================== --- compiler-rt/trunk/test/asan/TestCases/Windows/interface_symbols_windows.c +++ compiler-rt/trunk/test/asan/TestCases/Windows/interface_symbols_windows.c @@ -1,52 +0,0 @@ -// Check that the interface exported by asan static lib matches the list of -// functions mentioned in sanitizer_interface.inc. -// -// Just make sure we can compile this. -// RUN: %clang_cl_asan -O0 %s -Fe%t -// -// note: The mangling decoration (i.e. @4 )is removed because calling convention -// differ from 32-bit and 64-bit. -// -// RUN: dumpbin /EXPORTS %t | sed "s/=.*//" \ -// RUN: | grep -o "\(__asan_\|__ubsan_\|__sanitizer_\|__sancov_\)[^ ]*" \ -// RUN: | grep -v "__asan_wrap" \ -// RUN: | sed -e s/@.*// > %t.exports -// -// [BEWARE: be really careful with the sed commands, as this test can be run -// from different environemnts with different shells and seds] -// -// RUN: grep -e "INTERFACE_FUNCTION" \ -// RUN: %p/../../../../lib/asan/asan_interface.inc \ -// RUN: %p/../../../../lib/ubsan/ubsan_interface.inc \ -// RUN: %p/../../../../lib/sanitizer_common/sanitizer_common_interface.inc \ -// RUN: %p/../../../../lib/sanitizer_common/sanitizer_coverage_interface.inc \ -// RUN: | sed -e "s/.*(//" -e "s/).*//" > %t.imports1 -// -// RUN: grep -e "INTERFACE_WEAK_FUNCTION" \ -// RUN: %p/../../../../lib/asan/asan_interface.inc \ -// RUN: %p/../../../../lib/ubsan/ubsan_interface.inc \ -// RUN: %p/../../../../lib/sanitizer_common/sanitizer_common_interface.inc \ -// RUN: %p/../../../../lib/sanitizer_common/sanitizer_coverage_interface.inc \ -// RUN: | sed -e "s/.*(//" -e "s/).*/__dll/" > %t.imports2 -// -// Add functions not included in the interface lists: -// RUN: grep '[I]MPORT:' %s | sed -e 's/.*[I]MPORT: //' > %t.imports3 -// IMPORT: __asan_shadow_memory_dynamic_address -// IMPORT: __asan_get_shadow_memory_dynamic_address -// IMPORT: __asan_option_detect_stack_use_after_return -// IMPORT: __asan_should_detect_stack_use_after_return -// IMPORT: __asan_set_seh_filter -// IMPORT: __asan_unhandled_exception_filter -// IMPORT: __asan_test_only_reported_buggy_pointer -// IMPORT: __sancov_lowest_stack -// -// RUN: cat %t.imports1 %t.imports2 %t.imports3 | sort | uniq > %t.imports-sorted -// RUN: cat %t.exports | sort | uniq > %t.exports-sorted -// -// Now make sure the DLL thunk imports everything: -// RUN: echo -// RUN: echo "=== NOTE === If you see a mismatch below, please update interface.inc files." -// RUN: diff %t.imports-sorted %t.exports-sorted -// REQUIRES: asan-static-runtime - -int main() { return 0; } Index: compiler-rt/trunk/test/asan/TestCases/Windows/interface_symbols_windows.cc =================================================================== --- compiler-rt/trunk/test/asan/TestCases/Windows/interface_symbols_windows.cc +++ compiler-rt/trunk/test/asan/TestCases/Windows/interface_symbols_windows.cc @@ -0,0 +1,53 @@ +// Check that the interface exported by asan static lib matches the list of +// functions mentioned in sanitizer_interface.inc. +// +// Just make sure we can compile this. +// RUN: %clang_cl_asan -O0 %s -Fe%t +// +// note: The mangling decoration (i.e. @4 )is removed because calling convention +// differ from 32-bit and 64-bit. +// +// RUN: dumpbin /EXPORTS %t | sed "s/=.*//" \ +// RUN: | grep -o "\(__asan_\|__ubsan_\|__sanitizer_\|__sancov_\)[^ ]*" \ +// RUN: | grep -v "__asan_wrap" \ +// RUN: | sed -e s/@.*// > %t.exports +// +// [BEWARE: be really careful with the sed commands, as this test can be run +// from different environemnts with different shells and seds] +// +// RUN: grep -e "INTERFACE_FUNCTION" \ +// RUN: %p/../../../../lib/asan/asan_interface.inc \ +// RUN: %p/../../../../lib/ubsan/ubsan_interface.inc \ +// RUN: %p/../../../../lib/sanitizer_common/sanitizer_common_interface.inc \ +// RUN: %p/../../../../lib/sanitizer_common/sanitizer_coverage_interface.inc \ +// RUN: | sed -e "s/.*(//" -e "s/).*//" > %t.imports1 +// +// RUN: grep -e "INTERFACE_WEAK_FUNCTION" \ +// RUN: %p/../../../../lib/asan/asan_interface.inc \ +// RUN: %p/../../../../lib/ubsan/ubsan_interface.inc \ +// RUN: %p/../../../../lib/sanitizer_common/sanitizer_common_interface.inc \ +// RUN: %p/../../../../lib/sanitizer_common/sanitizer_coverage_interface.inc \ +// RUN: | sed -e "s/.*(//" -e "s/).*/__dll/" > %t.imports2 +// +// Add functions not included in the interface lists: +// RUN: grep '[I]MPORT:' %s | sed -e 's/.*[I]MPORT: //' > %t.imports3 +// IMPORT: __asan_shadow_memory_dynamic_address +// IMPORT: __asan_get_shadow_memory_dynamic_address +// IMPORT: __asan_option_detect_stack_use_after_return +// IMPORT: __asan_should_detect_stack_use_after_return +// IMPORT: __asan_set_seh_filter +// IMPORT: __asan_unhandled_exception_filter +// IMPORT: __asan_test_only_reported_buggy_pointer +// IMPORT: __sancov_lowest_stack +// IMPORT: __ubsan_vptr_type_cache +// +// RUN: cat %t.imports1 %t.imports2 %t.imports3 | sort | uniq > %t.imports-sorted +// RUN: cat %t.exports | sort | uniq > %t.exports-sorted +// +// Now make sure the DLL thunk imports everything: +// RUN: echo +// RUN: echo "=== NOTE === If you see a mismatch below, please update interface.inc files." +// RUN: diff %t.imports-sorted %t.exports-sorted +// REQUIRES: asan-static-runtime + +int main() { return 0; }