case 14: __asan_set_death_callback(0); break;
case 15: __asan_set_error_report_callback(0); break;
case 16: __asan_handle_no_return(); break;
+ case 17: __asan_address_is_poisoned(0); break;
+ case 18: __asan_get_allocated_size(0); break;
+ case 19: __asan_get_current_allocated_bytes(); break;
+ case 20: __asan_get_estimated_allocated_size(0); break;
+ case 21: __asan_get_free_bytes(); break;
+ case 22: __asan_get_heap_size(); break;
+ case 23: __asan_get_ownership(0); break;
+ case 24: __asan_get_unmapped_bytes(); break;
+ case 25: __asan_poison_memory_region(0, 0); break;
+ case 26: __asan_unpoison_memory_region(0, 0); break;
+ case 27: __asan_set_error_exit_code(0); break;
+ case 28: __asan_stack_free(0, 0, 0); break;
+ case 29: __asan_stack_malloc(0, 0); break;
}
}
// ---------------------- Interface ---------------- {{{1
using namespace __asan; // NOLINT
-int __asan_set_error_exit_code(int exit_code) {
+int NOINLINE __asan_set_error_exit_code(int exit_code) {
int old = flags()->exitcode;
flags()->exitcode = exit_code;
return old;
FILE_CHECK=$3
CXXFLAGS="-mno-omit-leaf-frame-pointer -fno-omit-frame-pointer -fno-optimize-sibling-calls -g"
SYMBOLIZER=../scripts/asan_symbolize.py
+ASAN_INTERFACE_H=../asan_interface.h
TMP_ASAN_REPORT=asan_report.tmp
run_program() {
export ASAN_OPTIONS=""
rm ./a.out
+echo "Checking the presense of interface symbols in compiled file"
+$CC -g -faddress-sanitizer -dead_strip -O2 $C_TEST.c
+nm ./a.out | grep " T " | sed "s/.* T //" | grep "__asan_" | sed "s/___asan_/__asan_/" > symbols.txt
+cat $ASAN_INTERFACE_H | sed "s/\/\/.*//" | grep "__asan_.*(" | sed "s/.* __asan_/__asan_/;s/(.*//" > interface.txt
+for i in __asan_report_{load,store}{1,2,4,8,16}
+do
+ echo $i >> interface.txt
+done
+cat interface.txt | sort | uniq | diff symbols.txt - || exit 1
+rm ./a.out interface.txt symbols.txt
+
+
# FIXME: some tests do not need to be ran for all the combinations of arch
# and optimization mode.
for t in *.cc; do