Home | History | Annotate | Download | only in lit_tests
      1 // RUN: %clangxx_msan -m64 -O0 %s -o %t && not %t >%t.out 2>&1
      2 // FileCheck %s <%t.out
      3 // RUN: %clangxx_msan -m64 -O0 %s -o %t && MSAN_OPTIONS=keep_going=0 not %t >%t.out 2>&1
      4 // FileCheck %s <%t.out
      5 // RUN: %clangxx_msan -m64 -O0 %s -o %t && MSAN_OPTIONS=keep_going=1 not %t >%t.out 2>&1
      6 // FileCheck %s <%t.out
      7 
      8 // RUN: %clangxx_msan -m64 -mllvm -msan-keep-going=1 -O0 %s -o %t && not %t >%t.out 2>&1
      9 // FileCheck --check-prefix=CHECK-KEEP-GOING %s <%t.out
     10 // RUN: %clangxx_msan -m64 -mllvm -msan-keep-going=1 -O0 %s -o %t && MSAN_OPTIONS=keep_going=0 not %t >%t.out 2>&1
     11 // FileCheck %s <%t.out
     12 // RUN: %clangxx_msan -m64 -mllvm -msan-keep-going=1 -O0 %s -o %t && MSAN_OPTIONS=keep_going=1 not %t >%t.out 2>&1
     13 // FileCheck --check-prefix=CHECK-KEEP-GOING %s <%t.out
     14 
     15 // Test behaviour of -mllvm -msan-keep-going and MSAN_OPTIONS=keep_going.
     16 // -mllvm -msan-keep-going provides the default value of keep_going flag; value
     17 // of 1 can be overwritten by MSAN_OPTIONS, value of 0 can not.
     18 
     19 #include <stdio.h>
     20 #include <stdlib.h>
     21 
     22 int main(int argc, char **argv) {
     23   char *volatile x = (char*)malloc(5 * sizeof(char));
     24   if (x[0])
     25     exit(0);
     26   fprintf(stderr, "Done\n");
     27   // CHECK-NOT: Done
     28   // CHECK-KEEP-GOING: Done
     29   return 0;
     30 }
     31