1 // RUN: %clangxx_asan %s -o %t
4 // RUN: not %t 2> %t.out
5 // RUN: FileCheck %s --check-prefix=CHECK-ERROR < %t.out
9 // RUN: ASAN_OPTIONS=log_path=%t.log not %t 2> %t.out
10 // RUN: FileCheck %s --check-prefix=CHECK-ERROR < %t.log.*
13 // RUN: ASAN_OPTIONS=log_path=/INVALID not %t 2> %t.out
14 // RUN: FileCheck %s --check-prefix=CHECK-INVALID < %t.out
17 // RUN: ASAN_OPTIONS=log_path=`for((i=0;i<10000;i++)); do echo -n $i; done` \
18 // RUN: not %t 2> %t.out
19 // RUN: FileCheck %s --check-prefix=CHECK-LONG < %t.out
21 // Run w/o errors should not produce any log.
22 // RUN: rm -f %t.log.*
23 // RUN: ASAN_OPTIONS=log_path=%t.log %t ARG ARG ARG
24 // RUN: not cat %t.log.*
29 int main(int argc
, char **argv
) {
30 if (argc
> 2) return 0;
31 char *x
= (char*)malloc(10);
33 int res
= x
[argc
* 10]; // BOOOM
37 // CHECK-ERROR: ERROR: AddressSanitizer
38 // CHECK-INVALID: ERROR: Can't open file: /INVALID
39 // CHECK-LONG: ERROR: Path is too long: 01234