xref: /llvm-project/compiler-rt/test/asan_abi/TestCases/Darwin/llvm_interface_symbols.cpp (revision 7cabb54f3867867451368ce72928f76cf38831cb)
1 // RUN: %clang_asan_abi -O0 -c -fsanitize-stable-abi -fsanitize=address %s -o %t.o
2 // RUN: %clangxx -c %p/../../../../lib/asan_abi/asan_abi.cpp -o asan_abi.o
3 // RUN: %clangxx -dead_strip -o %t %t.o -fsanitize-stable-abi -fsanitize=address asan_abi.o && %run %t 2>&1
4 // RUN: %clangxx -x c++-header -o - -E %p/../../../../lib/asan/asan_interface.inc \
5 // RUN: | sed "s/INTERFACE_FUNCTION/\nINTERFACE_FUNCTION/g" > %t.asan_interface.inc
6 // RUN: llvm-nm -g %libasan_abi                                   \
7 // RUN: | grep " [TU] "                                           \
8 // RUN: | grep -o "\(__asan\)[^ ]*"                               \
9 // RUN: | grep -v "\(__asan_abi\)[^ ]*"                           \
10 // RUN: > %t.exports
11 // RUN: sed -e ':a' -e 'N' -e '$!ba'                              \
12 // RUN:     -e 's/ //g'                                           \
13 // RUN:     -e ':b' -e 's/\n\n/\n/g' -e 'tb'                      \
14 // RUN:     -e 's/(\n/(/g'                                        \
15 // RUN: %t.asan_interface.inc                                     \
16 // RUN: | grep -v -f %p/../../../../lib/asan_abi/asan_abi_tbd.txt \
17 // RUN: | grep -e "INTERFACE_\(WEAK_\)\?FUNCTION"                 \
18 // RUN: | grep -v "__sanitizer[^ ]*"                              \
19 // RUN: | sed -e "s/.*(//" -e "s/).*//"                           \
20 // RUN: | sed -e "/^__asan_version_mismatch_check/d"              \
21 // RUN: > %t.imports
22 // RUN: sort %t.imports | uniq > %t.imports-sorted
23 // RUN: sort %t.exports | uniq > %t.exports-sorted
24 // RUN: diff %t.imports-sorted %t.exports-sorted
25 
26 // Ensure that there is no dynamic dylib linked.
27 // RUN: otool -L %t | (! grep -q "dynamic.dylib")
28 
29 // UNSUPPORTED: ios
30 
main()31 int main() { return 0; }
32