1 // Check the presence of interface symbols in the ASan runtime dylib.
2 // If you're changing this file, please also change
3 // ../Linux/interface_symbols.c
4
5 // RUN: %clangxx_asan -dead_strip -O2 %s -o %t.exe
6 //
7 // note: we can not use -D on Darwin.
8 // 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/'` \
9 // RUN: | grep " [TU] " \
10 // RUN: | grep -o "\(__asan_\|__ubsan_\|__sancov_\|__sanitizer_\)[^ ]*" \
11 // RUN: | grep -v "__sanitizer_syscall" \
12 // RUN: | grep -v "__sanitizer_weak_hook" \
13 // RUN: | grep -v "__sanitizer_mz" \
14 // RUN: | grep -v "__sancov_lowest_stack" \
15 // RUN: | sed -e "s/__asan_version_mismatch_check_v[0-9]+/__asan_version_mismatch_check/" \
16 // RUN: > %t.exports
17 //
18 // RUN: grep -e "INTERFACE_\(WEAK_\)\?FUNCTION" \
19 // RUN: %p/../../../../lib/asan/asan_interface.inc \
20 // RUN: %p/../../../../lib/ubsan/ubsan_interface.inc \
21 // RUN: %p/../../../../lib/sanitizer_common/sanitizer_common_interface.inc \
22 // RUN: %p/../../../../lib/sanitizer_common/sanitizer_common_interface_posix.inc \
23 // RUN: %p/../../../../lib/sanitizer_common/sanitizer_coverage_interface.inc \
24 // RUN: | grep -v "__sanitizer_weak_hook" \
25 // RUN: | sed -e "s/.*(//" -e "s/).*//" > %t.imports
26 //
27 // RUN: cat %t.imports | sort | uniq > %t.imports-sorted
28 // RUN: cat %t.exports | sort | uniq > %t.exports-sorted
29 //
30 // RUN: echo
31 // RUN: echo "=== NOTE === If you see a mismatch below, please update sanitizer_interface.inc files."
32 // RUN: diff %t.imports-sorted %t.exports-sorted
33
34 // UNSUPPORTED: ios
35
main()36 int main() { return 0; }
37