blob: 47a5c226a1bf0f7b4af7380896a9986c2266de6c [file] [log] [blame]
Pirama Arumuga Nainarcdce50b2015-07-01 12:26:56 -07001// RUN: %clangxx_asan %s -o %T/verbose-log-path_test-binary
2
Pirama Arumuga Nainar799172d2016-03-03 15:50:30 -08003// The glob below requires bash.
4// REQUIRES: shell
5
Pirama Arumuga Nainarcdce50b2015-07-01 12:26:56 -07006// Good log_path.
7// RUN: rm -f %T/asan.log.*
Pirama Arumuga Nainar799172d2016-03-03 15:50:30 -08008// RUN: %env_asan_opts=log_path=%T/asan.log:log_exe_name=1 not %run %T/verbose-log-path_test-binary 2> %t.out
Pirama Arumuga Nainarcdce50b2015-07-01 12:26:56 -07009// 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>
16int 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