1 // RUN: %clangxx_asan -O0 -DSHARED_LIB %s %fPIC -shared -o %dynamiclib %ld_flags_rpath_so
2 // RUN: %clangxx_asan -O0 %s -o %t %ld_flags_rpath_exe
4 // Check that without suppressions, we catch the issue.
5 // RUN: not %run %t 2>&1 | FileCheck --check-prefix=CHECK-CRASH %s
9 // RUN: echo "interceptor_via_lib:"%xdynamiclib_filename > %t.supp
10 // RUN: %env_asan_opts=suppressions='"%t.supp"' %run %t 2>&1 | FileCheck --check-prefix=CHECK-IGNORE %s
18 #if !defined(SHARED_LIB)
20 void crash_function();
22 int main(int argc
, char *argv
[]) {
29 void crash_function() {
30 char *a
= (char *)malloc(6);
32 size_t len
= strlen(a
); // BOOM
33 fprintf(stderr
, "strlen ignored, %zu\n", len
);
38 // CHECK-CRASH: AddressSanitizer: heap-use-after-free
39 // CHECK-CRASH-NOT: strlen ignored
40 // CHECK-IGNORE-NOT: AddressSanitizer: heap-use-after-free
41 // CHECK-IGNORE: strlen ignored