Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / compiler-rt / test / asan / TestCases / verbose-log-path_test.cpp
blob37c1dab6db8ecf9d7b4d25144e549eb63055c2e1
1 // RUN: rm -rf %t-dir && mkdir -p %t-dir
2 // RUN: %clangxx_asan %s -o %t-dir/verbose-log-path_test-binary
4 // The glob below requires bash.
5 // REQUIRES: shell
7 // Good log_path.
8 // RUN: rm -f %t-dir/asan.log.*
9 // 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.out
10 // RUN: FileCheck %s --check-prefix=CHECK-ERROR < %t-dir/asan.log.verbose-log-path_test-binary.*
12 // FIXME: only FreeBSD, NetBSD and Linux have verbose log paths now.
13 // XFAIL: target={{.*windows-msvc.*}},android
14 // UNSUPPORTED: ios
16 #include <stdlib.h>
17 #include <string.h>
18 int main(int argc, char **argv) {
19 if (argc > 2) return 0;
20 char *x = (char*)malloc(10);
21 memset(x, 0, 10);
22 int res = x[argc * 10]; // BOOOM
23 free(x);
24 return res;
26 // CHECK-ERROR: ERROR: AddressSanitizer