blob: bd9bbee84a9276f9cf286db8a8e747ac8361e770 [file] [log] [blame]
Stephen Hines2d1fdb22014-05-28 23:58:16 -07001// 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: %clang_asan -dead_strip -O2 %s -o %t.exe
6// RUN: rm -f %t.symbols %t.interface
7
Stephen Hines6d186232014-11-26 17:56:19 -08008// 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/'` \
Stephen Hines2d1fdb22014-05-28 23:58:16 -07009// RUN: | grep " T " | sed "s/.* T //" \
10// RUN: | grep "__asan_" | sed "s/___asan_/__asan_/" \
Stephen Hines6d186232014-11-26 17:56:19 -080011// RUN: | sed -E "s/__asan_init_v[0-9]+/__asan_init/" \
Stephen Hines2d1fdb22014-05-28 23:58:16 -070012// RUN: | grep -v "__asan_default_options" \
13// RUN: | grep -v "__asan_on_error" > %t.symbols
14
15// RUN: cat %p/../../../../lib/asan/asan_interface_internal.h \
Stephen Hines2d1fdb22014-05-28 23:58:16 -070016// RUN: | sed "s/\/\/.*//" | sed "s/typedef.*//" \
17// RUN: | grep -v "OPTIONAL" \
18// RUN: | grep "__asan_.*(" | sed "s/.* __asan_/__asan_/;s/(.*//" \
19// RUN: > %t.interface
20// RUN: echo __asan_report_load1 >> %t.interface
21// RUN: echo __asan_report_load2 >> %t.interface
22// RUN: echo __asan_report_load4 >> %t.interface
23// RUN: echo __asan_report_load8 >> %t.interface
24// RUN: echo __asan_report_load16 >> %t.interface
25// RUN: echo __asan_report_store1 >> %t.interface
26// RUN: echo __asan_report_store2 >> %t.interface
27// RUN: echo __asan_report_store4 >> %t.interface
28// RUN: echo __asan_report_store8 >> %t.interface
29// RUN: echo __asan_report_store16 >> %t.interface
30// RUN: echo __asan_report_load_n >> %t.interface
31// RUN: echo __asan_report_store_n >> %t.interface
Pirama Arumuga Nainar7c915052015-04-08 08:58:29 -070032// RUN: echo __asan_report_exp_load1 >> %t.interface
33// RUN: echo __asan_report_exp_load2 >> %t.interface
34// RUN: echo __asan_report_exp_load4 >> %t.interface
35// RUN: echo __asan_report_exp_load8 >> %t.interface
36// RUN: echo __asan_report_exp_load16 >> %t.interface
37// RUN: echo __asan_report_exp_store1 >> %t.interface
38// RUN: echo __asan_report_exp_store2 >> %t.interface
39// RUN: echo __asan_report_exp_store4 >> %t.interface
40// RUN: echo __asan_report_exp_store8 >> %t.interface
41// RUN: echo __asan_report_exp_store16 >> %t.interface
42// RUN: echo __asan_report_exp_load_n >> %t.interface
43// RUN: echo __asan_report_exp_store_n >> %t.interface
Stephen Hines2d1fdb22014-05-28 23:58:16 -070044// RUN: echo __asan_get_current_fake_stack >> %t.interface
45// RUN: echo __asan_addr_is_in_fake_stack >> %t.interface
Stephen Hines86277eb2015-03-23 12:06:32 -070046// RUN: echo __asan_mz_calloc >> %t.interface
47// RUN: echo __asan_mz_destroy >> %t.interface
48// RUN: echo __asan_mz_free >> %t.interface
49// RUN: echo __asan_mz_malloc >> %t.interface
50// RUN: echo __asan_mz_memalign >> %t.interface
51// RUN: echo __asan_mz_realloc >> %t.interface
52// RUN: echo __asan_mz_size >> %t.interface
53// RUN: echo __asan_mz_valloc >> %t.interface
54
Stephen Hines2d1fdb22014-05-28 23:58:16 -070055// RUN: for i in `jot - 0 10`; do echo __asan_stack_malloc_$i >> %t.interface; done
56// RUN: for i in `jot - 0 10`; do echo __asan_stack_free_$i >> %t.interface; done
57
58// RUN: cat %t.interface | sort -u | diff %t.symbols -
59
60int main() { return 0; }