Home | History | Annotate | Download | only in TestCases
      1 // RUN: %clangxx_asan %s -o %T/verbose-log-path_test-binary
      2 
      3 // The glob below requires bash.
      4 // REQUIRES: shell
      5 
      6 // Good log_path.
      7 // RUN: rm -f %T/asan.log.*
      8 // RUN: %env_asan_opts=log_path=%T/asan.log:log_exe_name=1 not %run %T/verbose-log-path_test-binary 2> %t.out
      9 // RUN: FileCheck %s --check-prefix=CHECK-ERROR < %T/asan.log.verbose-log-path_test-binary.*
     10 
     11 // FIXME: only FreeBSD and Linux have verbose log paths now.
     12 // XFAIL: win32,android
     13 
     14 #include <stdlib.h>
     15 #include <string.h>
     16 int main(int argc, char **argv) {
     17   if (argc > 2) return 0;
     18   char *x = (char*)malloc(10);
     19   memset(x, 0, 10);
     20   int res = x[argc * 10];  // BOOOM
     21   free(x);
     22   return res;
     23 }
     24 // CHECK-ERROR: ERROR: AddressSanitizer
     25