Pirama Arumuga Nainar | cdce50b | 2015-07-01 12:26:56 -0700 | [diff] [blame] | 1 | // RUN: %clangxx_asan %s -o %T/verbose-log-path_test-binary |
| 2 | |
| 3 | // Good log_path. |
| 4 | // RUN: rm -f %T/asan.log.* |
| 5 | // RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:log_path=%T/asan.log:log_exe_name=1 not %run %T/verbose-log-path_test-binary 2> %t.out |
| 6 | // RUN: FileCheck %s --check-prefix=CHECK-ERROR < %T/asan.log.verbose-log-path_test-binary.* |
| 7 | |
| 8 | // FIXME: only FreeBSD and Linux have verbose log paths now. |
| 9 | // XFAIL: win32,android |
| 10 | |
| 11 | #include <stdlib.h> |
| 12 | #include <string.h> |
| 13 | int main(int argc, char **argv) { |
| 14 | if (argc > 2) return 0; |
| 15 | char *x = (char*)malloc(10); |
| 16 | memset(x, 0, 10); |
| 17 | int res = x[argc * 10]; // BOOOM |
| 18 | free(x); |
| 19 | return res; |
| 20 | } |
| 21 | // CHECK-ERROR: ERROR: AddressSanitizer |