diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2017-04-16 16:02:53 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2017-04-16 16:02:53 +0000 |
| commit | ab0bf875a5f328a6710f4e48258979ae1bc8da1c (patch) | |
| tree | 66903cf9f73151825893dcc216b04c0930317a10 /test/asan/TestCases/Linux/interface_symbols_linux.c | |
| parent | abacad30a54c59ad437ccf54ec5236a8dd7f3ba9 (diff) | |
Notes
Diffstat (limited to 'test/asan/TestCases/Linux/interface_symbols_linux.c')
| -rw-r--r-- | test/asan/TestCases/Linux/interface_symbols_linux.c | 77 |
1 files changed, 24 insertions, 53 deletions
diff --git a/test/asan/TestCases/Linux/interface_symbols_linux.c b/test/asan/TestCases/Linux/interface_symbols_linux.c index 2e648575f28c..33fdd5ca1d82 100644 --- a/test/asan/TestCases/Linux/interface_symbols_linux.c +++ b/test/asan/TestCases/Linux/interface_symbols_linux.c @@ -1,59 +1,30 @@ // Check the presence of interface symbols in compiled file. // RUN: %clang_asan -O2 %s -o %t.exe -// RUN: nm -D %t.exe | grep " T " | sed "s/.* T //" \ -// RUN: | grep "__asan_" | sed "s/___asan_/__asan_/" \ -// RUN: | sed -E "s/__asan_version_mismatch_check_v[0-9]+/__asan_version_mismatch_check/" \ -// RUN: | grep -v "__asan_default_options" \ -// RUN: | grep -v "__asan_stack_" \ -// RUN: | grep -v "__asan_on_error" > %t.symbols -// RUN: cat %p/../../../../lib/asan/asan_interface_internal.h \ -// 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 -// RUN: echo __asan_report_load_n >> %t.interface -// RUN: echo __asan_report_store_n >> %t.interface -// RUN: echo __asan_report_load1_noabort >> %t.interface -// RUN: echo __asan_report_load2_noabort >> %t.interface -// RUN: echo __asan_report_load4_noabort >> %t.interface -// RUN: echo __asan_report_load8_noabort >> %t.interface -// RUN: echo __asan_report_load16_noabort >> %t.interface -// RUN: echo __asan_report_store1_noabort >> %t.interface -// RUN: echo __asan_report_store2_noabort >> %t.interface -// RUN: echo __asan_report_store4_noabort >> %t.interface -// RUN: echo __asan_report_store8_noabort >> %t.interface -// RUN: echo __asan_report_store16_noabort >> %t.interface -// RUN: echo __asan_report_load_n_noabort >> %t.interface -// RUN: echo __asan_report_store_n_noabort >> %t.interface -// RUN: echo __asan_report_exp_load1 >> %t.interface -// RUN: echo __asan_report_exp_load2 >> %t.interface -// RUN: echo __asan_report_exp_load4 >> %t.interface -// RUN: echo __asan_report_exp_load8 >> %t.interface -// RUN: echo __asan_report_exp_load16 >> %t.interface -// RUN: echo __asan_report_exp_store1 >> %t.interface -// RUN: echo __asan_report_exp_store2 >> %t.interface -// RUN: echo __asan_report_exp_store4 >> %t.interface -// RUN: echo __asan_report_exp_store8 >> %t.interface -// RUN: echo __asan_report_exp_store16 >> %t.interface -// RUN: echo __asan_report_exp_load_n >> %t.interface -// RUN: echo __asan_report_exp_store_n >> %t.interface -// RUN: echo __asan_get_current_fake_stack >> %t.interface -// RUN: echo __asan_addr_is_in_fake_stack >> %t.interface -// RUN: echo __asan_alloca_poison >> %t.interface -// RUN: echo __asan_allocas_unpoison >> %t.interface -// RUN: cat %t.interface | sort -u | diff %t.symbols - - +// RUN: nm -D %t.exe | grep " [TWw] " \ +// RUN: | grep -o "\(__asan_\|__ubsan_\|__sancov_\|__sanitizer_\)[^ ]*" \ +// RUN: | grep -v "__sanitizer_syscall" \ +// RUN: | grep -v "__sanitizer_weak_hook" \ +// RUN: | grep -v "__ubsan_handle_dynamic_type_cache_miss" \ +// RUN: | sed -e "s/__asan_version_mismatch_check_v[0-9]+/__asan_version_mismatch_check/" \ +// RUN: > %t.exports +// +// RUN: grep -e "INTERFACE_\(WEAK_\)\?FUNCTION" \ +// RUN: %p/../../../../lib/asan/asan_interface.inc \ +// RUN: %p/../../../../lib/ubsan/ubsan_interface.inc \ +// RUN: %p/../../../../lib/sanitizer_common/sanitizer_common_interface.inc \ +// RUN: %p/../../../../lib/sanitizer_common/sanitizer_common_interface_posix.inc \ +// RUN: %p/../../../../lib/sanitizer_common/sanitizer_coverage_interface.inc \ +// RUN: | grep -v "__sanitizer_weak_hook" \ +// RUN: | sed -e "s/.*(//" -e "s/).*//" > %t.imports +// +// RUN: cat %t.imports | sort | uniq > %t.imports-sorted +// RUN: cat %t.exports | sort | uniq > %t.exports-sorted +// +// RUN: echo +// RUN: echo "=== NOTE === If you see a mismatch below, please update sanitizer_interface.inc files." +// RUN: diff %t.imports-sorted %t.exports-sorted +// // FIXME: nm -D on powerpc somewhy shows ASan interface symbols residing // in "initialized data section". // REQUIRES: x86-target-arch,asan-static-runtime |
