Move ASan lit-tests under test/asan
[blocksruntime.git] / test / asan / TestCases / Darwin / interface_symbols_darwin.c
blob03042d62a5487971f0a6629b040664ab2840fff1
1 // Check the presense of interface symbols in the ASan runtime dylib.
2 // If you're changing this file, please also change
3 // ../Linux/interface_symbols.c
5 // RUN: %clang_asan -dead_strip -O2 %s -o %t.exe
6 // RUN: rm -f %t.symbols %t.interface
8 // RUN: nm -g `otool -L %t.exe | grep "asan_osx_dynamic.dylib" | \
9 // RUN: tr -d '\011' | \
10 // RUN: sed "s/.dylib.*/.dylib/"` \
11 // RUN: | grep " T " | sed "s/.* T //" \
12 // RUN: | grep "__asan_" | sed "s/___asan_/__asan_/" \
13 // RUN: | grep -v "__asan_malloc_hook" \
14 // RUN: | grep -v "__asan_free_hook" \
15 // RUN: | grep -v "__asan_default_options" \
16 // RUN: | grep -v "__asan_on_error" > %t.symbols
18 // RUN: cat %p/../../../../lib/asan/asan_interface_internal.h \
19 // RUN: | sed "s/\/\/.*//" | sed "s/typedef.*//" \
20 // RUN: | grep -v "OPTIONAL" \
21 // RUN: | grep "__asan_.*(" | sed "s/.* __asan_/__asan_/;s/(.*//" \
22 // RUN: > %t.interface
23 // RUN: echo __asan_report_load1 >> %t.interface
24 // RUN: echo __asan_report_load2 >> %t.interface
25 // RUN: echo __asan_report_load4 >> %t.interface
26 // RUN: echo __asan_report_load8 >> %t.interface
27 // RUN: echo __asan_report_load16 >> %t.interface
28 // RUN: echo __asan_report_store1 >> %t.interface
29 // RUN: echo __asan_report_store2 >> %t.interface
30 // RUN: echo __asan_report_store4 >> %t.interface
31 // RUN: echo __asan_report_store8 >> %t.interface
32 // RUN: echo __asan_report_store16 >> %t.interface
33 // RUN: echo __asan_report_load_n >> %t.interface
34 // RUN: echo __asan_report_store_n >> %t.interface
35 // RUN: echo __asan_get_current_fake_stack >> %t.interface
36 // RUN: echo __asan_addr_is_in_fake_stack >> %t.interface
37 // RUN: for i in `jot - 0 10`; do echo __asan_stack_malloc_$i >> %t.interface; done
38 // RUN: for i in `jot - 0 10`; do echo __asan_stack_free_$i >> %t.interface; done
40 // RUN: cat %t.interface | sort -u | diff %t.symbols -
42 int main() { return 0; }