26 lines · cpp
1// UNSUPPORTED: system-windows2 3// RUN: rm -rf %t-dir && mkdir -p %t-dir4// RUN: %clangxx_asan %s -o %t-dir/verbose-log-path_test-binary5 6// Good log_path.7// RUN: rm -f %t-dir/asan.log.*8// RUN: %env_asan_opts=log_path=%t-dir/asan.log:log_exe_name=1 not %run %t-dir/verbose-log-path_test-binary 2> %t.out9// RUN: FileCheck %s --check-prefix=CHECK-ERROR < %t-dir/asan.log.verbose-log-path_test-binary.*10 11// FIXME: only FreeBSD, NetBSD and Linux have verbose log paths now.12// XFAIL: target={{.*windows-msvc.*}}13// UNSUPPORTED: ios, android14 15#include <stdlib.h>16#include <string.h>17int main(int argc, char **argv) {18 if (argc > 2) return 0;19 char *x = (char*)malloc(10);20 memset(x, 0, 10);21 int res = x[argc * 10]; // BOOOM22 free(x);23 return res;24}25// CHECK-ERROR: ERROR: AddressSanitizer26