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 | |
Pirama Arumuga Nainar | 799172d | 2016-03-03 15:50:30 -0800 | [diff] [blame^] | 3 | // The glob below requires bash. |
| 4 | // REQUIRES: shell |
| 5 | |
Pirama Arumuga Nainar | cdce50b | 2015-07-01 12:26:56 -0700 | [diff] [blame] | 6 | // Good log_path. |
| 7 | // RUN: rm -f %T/asan.log.* |
Pirama Arumuga Nainar | 799172d | 2016-03-03 15:50:30 -0800 | [diff] [blame^] | 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 |
Pirama Arumuga Nainar | cdce50b | 2015-07-01 12:26:56 -0700 | [diff] [blame] | 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 |