1 // RUN: %clangxx_msan -O0 %s -o %t && not %run %t >%t.out 2>&1
2 // FileCheck --check-prefix=CHECK-RECOVER %s <%t.out
3 // RUN: %clangxx_msan -O0 %s -o %t && MSAN_OPTIONS=keep_going=0 not %run %t >%t.out 2>&1
4 // FileCheck %s <%t.out
5 // RUN: %clangxx_msan -O0 %s -o %t && MSAN_OPTIONS=keep_going=1 not %run %t >%t.out 2>&1
6 // FileCheck --check-prefix=CHECK-RECOVER %s <%t.out
8 // Test how -fsanitize-recover=memory and MSAN_OPTIONS=keep_going affect reports
10 // -fsanitize-recover=memory provides the default value of keep_going flag, but is
11 // always overwritten by MSAN_OPTIONS
13 // RUN: %clangxx_msan -fsanitize-recover=memory -O0 %s -o %t && not %run %t >%t.out 2>&1
14 // FileCheck --check-prefix=CHECK-RECOVER %s <%t.out
15 // RUN: %clangxx_msan -fsanitize-recover=memory -O0 %s -o %t && MSAN_OPTIONS=keep_going=0 not %run %t >%t.out 2>&1
16 // FileCheck %s <%t.out
17 // RUN: %clangxx_msan -fsanitize-recover=memory -O0 %s -o %t && MSAN_OPTIONS=keep_going=1 not %run %t >%t.out 2>&1
18 // FileCheck --check-prefix=CHECK-RECOVER %s <%t.out
20 // Test how legacy -mllvm -msan-keep-going and MSAN_OPTIONS=keep_going affect
21 // reports from interceptors.
23 // RUN: %clangxx_msan -mllvm -msan-keep-going=1 -O0 %s -o %t && not %run %t >%t.out 2>&1
24 // FileCheck --check-prefix=CHECK-RECOVER %s <%t.out
30 int main(int argc
, char **argv
) {
31 char *volatile x
= (char*)malloc(5 * sizeof(char));
35 fprintf(stderr
, "Done\n");
37 // CHECK-RECOVER: Done