2014-05-15 10:22:34 +08:00
|
|
|
// Check the presence of interface symbols in the ASan runtime dylib.
|
2013-01-22 17:14:54 +08:00
|
|
|
// If you're changing this file, please also change
|
|
|
|
// ../Linux/interface_symbols.c
|
|
|
|
|
2013-06-07 17:38:55 +08:00
|
|
|
// RUN: %clang_asan -dead_strip -O2 %s -o %t.exe
|
2013-01-22 17:14:54 +08:00
|
|
|
// RUN: rm -f %t.symbols %t.interface
|
|
|
|
|
2013-05-16 21:49:12 +08:00
|
|
|
// RUN: nm -g `otool -L %t.exe | grep "asan_osx_dynamic.dylib" | \
|
2013-01-22 17:14:54 +08:00
|
|
|
// RUN: tr -d '\011' | \
|
|
|
|
// RUN: sed "s/.dylib.*/.dylib/"` \
|
|
|
|
// RUN: | grep " T " | sed "s/.* T //" \
|
|
|
|
// RUN: | grep "__asan_" | sed "s/___asan_/__asan_/" \
|
2014-07-15 16:16:04 +08:00
|
|
|
// RUN: | sed "s/__asan_init_v[0-9]\+/__asan_init/" \
|
2013-01-22 17:14:54 +08:00
|
|
|
// RUN: | grep -v "__asan_malloc_hook" \
|
|
|
|
// RUN: | grep -v "__asan_free_hook" \
|
|
|
|
// RUN: | grep -v "__asan_default_options" \
|
|
|
|
// RUN: | grep -v "__asan_on_error" > %t.symbols
|
|
|
|
|
2014-02-14 22:06:10 +08:00
|
|
|
// RUN: cat %p/../../../../lib/asan/asan_interface_internal.h \
|
2013-01-22 17:14:54 +08:00
|
|
|
// RUN: | sed "s/\/\/.*//" | sed "s/typedef.*//" \
|
|
|
|
// RUN: | grep -v "OPTIONAL" \
|
|
|
|
// RUN: | grep "__asan_.*(" | sed "s/.* __asan_/__asan_/;s/(.*//" \
|
|
|
|
// RUN: > %t.interface
|
|
|
|
// RUN: echo __asan_report_load1 >> %t.interface
|
|
|
|
// RUN: echo __asan_report_load2 >> %t.interface
|
|
|
|
// RUN: echo __asan_report_load4 >> %t.interface
|
|
|
|
// RUN: echo __asan_report_load8 >> %t.interface
|
|
|
|
// RUN: echo __asan_report_load16 >> %t.interface
|
|
|
|
// RUN: echo __asan_report_store1 >> %t.interface
|
|
|
|
// RUN: echo __asan_report_store2 >> %t.interface
|
|
|
|
// RUN: echo __asan_report_store4 >> %t.interface
|
|
|
|
// RUN: echo __asan_report_store8 >> %t.interface
|
|
|
|
// RUN: echo __asan_report_store16 >> %t.interface
|
2013-02-19 19:30:25 +08:00
|
|
|
// RUN: echo __asan_report_load_n >> %t.interface
|
|
|
|
// RUN: echo __asan_report_store_n >> %t.interface
|
2014-02-06 15:19:52 +08:00
|
|
|
// RUN: echo __asan_get_current_fake_stack >> %t.interface
|
|
|
|
// RUN: echo __asan_addr_is_in_fake_stack >> %t.interface
|
2013-09-23 18:38:23 +08:00
|
|
|
// RUN: for i in `jot - 0 10`; do echo __asan_stack_malloc_$i >> %t.interface; done
|
|
|
|
// RUN: for i in `jot - 0 10`; do echo __asan_stack_free_$i >> %t.interface; done
|
2013-01-22 17:14:54 +08:00
|
|
|
|
|
|
|
// RUN: cat %t.interface | sort -u | diff %t.symbols -
|
|
|
|
|
|
|
|
int main() { return 0; }
|