[compiler-rt] r286149 - Use -fsanitize-recover instead of -mllvm -msan-keep-going: tests.

Evgeniy Stepanov via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 7 13:02:57 PST 2016


Author: eugenis
Date: Mon Nov  7 15:02:56 2016
New Revision: 286149

URL: http://llvm.org/viewvc/llvm-project?rev=286149&view=rev
Log:
Use -fsanitize-recover instead of -mllvm -msan-keep-going: tests.

Summary: Use -fsanitize-recover instead of -mllvm -msan-keep-going: unit tests.

Reviewers: eugenis

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D26355

Patch by Aleksey Shlyapnikov.

Added:
    compiler-rt/trunk/test/msan/recover-dso.cc
      - copied, changed from r285821, compiler-rt/trunk/test/msan/keep-going-dso.cc
    compiler-rt/trunk/test/msan/recover.cc
      - copied, changed from r285821, compiler-rt/trunk/test/msan/keep-going.cc
Removed:
    compiler-rt/trunk/test/msan/keep-going-dso.cc
    compiler-rt/trunk/test/msan/keep-going.cc
Modified:
    compiler-rt/trunk/test/msan/print_stats.cc

Removed: compiler-rt/trunk/test/msan/keep-going-dso.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/msan/keep-going-dso.cc?rev=286148&view=auto
==============================================================================
--- compiler-rt/trunk/test/msan/keep-going-dso.cc (original)
+++ compiler-rt/trunk/test/msan/keep-going-dso.cc (removed)
@@ -1,33 +0,0 @@
-// RUN: %clangxx_msan -O0 %s -o %t && not %run %t >%t.out 2>&1
-// FileCheck --check-prefix=CHECK-KEEP-GOING %s <%t.out
-// RUN: %clangxx_msan -O0 %s -o %t && MSAN_OPTIONS=keep_going=0 not %run %t >%t.out 2>&1
-// FileCheck %s <%t.out
-// RUN: %clangxx_msan -O0 %s -o %t && MSAN_OPTIONS=keep_going=1 not %run %t >%t.out 2>&1
-// FileCheck --check-prefix=CHECK-KEEP-GOING %s <%t.out
-
-// RUN: %clangxx_msan -mllvm -msan-keep-going=1 -O0 %s -o %t && not %run %t >%t.out 2>&1
-// FileCheck --check-prefix=CHECK-KEEP-GOING %s <%t.out
-// RUN: %clangxx_msan -mllvm -msan-keep-going=1 -O0 %s -o %t && MSAN_OPTIONS=keep_going=0 not %run %t >%t.out 2>&1
-// FileCheck %s <%t.out
-// RUN: %clangxx_msan -mllvm -msan-keep-going=1 -O0 %s -o %t && MSAN_OPTIONS=keep_going=1 not %run %t >%t.out 2>&1
-// FileCheck --check-prefix=CHECK-KEEP-GOING %s <%t.out
-
-// Test how -mllvm -msan-keep-going and MSAN_OPTIONS=keep_going affect reports
-// from interceptors.
-// -mllvm -msan-keep-going provides the default value of keep_going flag, but is
-// always overwritten by MSAN_OPTIONS
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-int main(int argc, char **argv) {
-  char *volatile x = (char*)malloc(5 * sizeof(char));
-  x[4] = 0;
-  if (strlen(x) < 3)
-    exit(0);
-  fprintf(stderr, "Done\n");
-  // CHECK-NOT: Done
-  // CHECK-KEEP-GOING: Done
-  return 0;
-}

Removed: compiler-rt/trunk/test/msan/keep-going.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/msan/keep-going.cc?rev=286148&view=auto
==============================================================================
--- compiler-rt/trunk/test/msan/keep-going.cc (original)
+++ compiler-rt/trunk/test/msan/keep-going.cc (removed)
@@ -1,34 +0,0 @@
-// RUN: %clangxx_msan -O0 %s -o %t && not %run %t >%t.out 2>&1
-// FileCheck %s <%t.out
-// RUN: %clangxx_msan -O0 %s -o %t && MSAN_OPTIONS=keep_going=0 not %run %t >%t.out 2>&1
-// FileCheck %s <%t.out
-// RUN: %clangxx_msan -O0 %s -o %t && MSAN_OPTIONS=keep_going=1 not %run %t >%t.out 2>&1
-// FileCheck %s <%t.out
-
-// RUN: %clangxx_msan -mllvm -msan-keep-going=1 -O0 %s -o %t && not %run %t >%t.out 2>&1
-// FileCheck --check-prefix=CHECK-KEEP-GOING %s <%t.out
-// RUN: %clangxx_msan -mllvm -msan-keep-going=1 -O0 %s -o %t && MSAN_OPTIONS=keep_going=0 not %run %t >%t.out 2>&1
-// FileCheck %s <%t.out
-// RUN: %clangxx_msan -mllvm -msan-keep-going=1 -O0 %s -o %t && MSAN_OPTIONS=keep_going=1 not %run %t >%t.out 2>&1
-// FileCheck --check-prefix=CHECK-KEEP-GOING %s <%t.out
-// RUN: %clangxx_msan -mllvm -msan-keep-going=1 -O0 %s -o %t && MSAN_OPTIONS=halt_on_error=1 not %run %t >%t.out 2>&1
-// FileCheck %s <%t.out
-// RUN: %clangxx_msan -mllvm -msan-keep-going=1 -O0 %s -o %t && MSAN_OPTIONS=halt_on_error=0 not %run %t >%t.out 2>&1
-// FileCheck --check-prefix=CHECK-KEEP-GOING %s <%t.out
-
-// Test behaviour of -mllvm -msan-keep-going and MSAN_OPTIONS=keep_going.
-// -mllvm -msan-keep-going provides the default value of keep_going flag; value
-// of 1 can be overwritten by MSAN_OPTIONS, value of 0 can not.
-
-#include <stdio.h>
-#include <stdlib.h>
-
-int main(int argc, char **argv) {
-  char *volatile x = (char*)malloc(5 * sizeof(char));
-  if (x[0])
-    exit(0);
-  fprintf(stderr, "Done\n");
-  // CHECK-NOT: Done
-  // CHECK-KEEP-GOING: Done
-  return 0;
-}

Modified: compiler-rt/trunk/test/msan/print_stats.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/msan/print_stats.cc?rev=286149&r1=286148&r2=286149&view=diff
==============================================================================
--- compiler-rt/trunk/test/msan/print_stats.cc (original)
+++ compiler-rt/trunk/test/msan/print_stats.cc Mon Nov  7 15:02:56 2016
@@ -1,22 +1,22 @@
 // RUN: %clangxx_msan -fsanitize-memory-track-origins=2 -g %s -o %t 
 // RUN: %run %t 2>&1 | \
-// RUN:   FileCheck --check-prefix=CHECK --check-prefix=CHECK-NOSTATS %s
+// RUN:   FileCheck --check-prefixes=CHECK,CHECK-NOSTATS %s
 // RUN: MSAN_OPTIONS=print_stats=1 %run %t 2>&1 | \
-// RUN:   FileCheck --check-prefix=CHECK --check-prefix=CHECK-NOSTATS %s
+// RUN:   FileCheck --check-prefixes=CHECK,CHECK-NOSTATS %s
 // RUN: MSAN_OPTIONS=print_stats=1,atexit=1 %run %t 2>&1 | \
-// RUN:   FileCheck --check-prefix=CHECK --check-prefix=CHECK-STATS %s
+// RUN:   FileCheck --check-prefixes=CHECK,CHECK-STATS %s
 
 // RUN: %clangxx_msan -fsanitize-memory-track-origins=2 -g -DPOSITIVE=1 %s -o %t 
 // RUN: not %run %t 2>&1 | \
-// RUN:   FileCheck --check-prefix=CHECK --check-prefix=CHECK-NOSTATS %s
+// RUN:   FileCheck --check-prefixes=CHECK,CHECK-NOSTATS %s
 // RUN: MSAN_OPTIONS=print_stats=1 not %run %t 2>&1 | \
-// RUN:   FileCheck --check-prefix=CHECK --check-prefix=CHECK-STATS %s
+// RUN:   FileCheck --check-prefixes=CHECK,CHECK-STATS %s
 
-// RUN: %clangxx_msan -fsanitize-memory-track-origins=2 -g -DPOSITIVE=1 -mllvm -msan-keep-going=1 %s -o %t 
+// RUN: %clangxx_msan -fsanitize-memory-track-origins=2 -fsanitize-recover=memory -g -DPOSITIVE=1 %s -o %t
 // RUN: not %run %t 2>&1 | \
-// RUN:  FileCheck --check-prefix=CHECK --check-prefix=CHECK-NOSTATS --check-prefix=CHECK-KEEPGOING %s
+// RUN:  FileCheck --check-prefixes=CHECK,CHECK-NOSTATS,CHECK-RECOVER %s
 // RUN: MSAN_OPTIONS=print_stats=1 not %run %t 2>&1 | \
-// RUN:   FileCheck --check-prefix=CHECK --check-prefix=CHECK-STATS --check-prefix=CHECK-KEEPGOING %s
+// RUN:   FileCheck --check-prefixes=CHECK,CHECK-STATS,CHECK-RECOVER %s
 
 #include <stdio.h>
 int main(int argc, char **argv) {
@@ -42,4 +42,4 @@ int main(int argc, char **argv) {
 // CHECK-NOSTATS-NOT: Unique origin histories:
 // CHECK-NOSTATS-NOT: History depot allocated bytes:
 
-// CHECK-KEEPGOING: MemorySanitizer: 1 warnings reported.
+// CHECK-RECOVER: MemorySanitizer: 1 warnings reported.

Copied: compiler-rt/trunk/test/msan/recover-dso.cc (from r285821, compiler-rt/trunk/test/msan/keep-going-dso.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/msan/recover-dso.cc?p2=compiler-rt/trunk/test/msan/recover-dso.cc&p1=compiler-rt/trunk/test/msan/keep-going-dso.cc&r1=285821&r2=286149&rev=286149&view=diff
==============================================================================
--- compiler-rt/trunk/test/msan/keep-going-dso.cc (original)
+++ compiler-rt/trunk/test/msan/recover-dso.cc Mon Nov  7 15:02:56 2016
@@ -1,22 +1,28 @@
 // RUN: %clangxx_msan -O0 %s -o %t && not %run %t >%t.out 2>&1
-// FileCheck --check-prefix=CHECK-KEEP-GOING %s <%t.out
+// FileCheck --check-prefix=CHECK-RECOVER %s <%t.out
 // RUN: %clangxx_msan -O0 %s -o %t && MSAN_OPTIONS=keep_going=0 not %run %t >%t.out 2>&1
 // FileCheck %s <%t.out
 // RUN: %clangxx_msan -O0 %s -o %t && MSAN_OPTIONS=keep_going=1 not %run %t >%t.out 2>&1
-// FileCheck --check-prefix=CHECK-KEEP-GOING %s <%t.out
+// FileCheck --check-prefix=CHECK-RECOVER %s <%t.out
 
-// RUN: %clangxx_msan -mllvm -msan-keep-going=1 -O0 %s -o %t && not %run %t >%t.out 2>&1
-// FileCheck --check-prefix=CHECK-KEEP-GOING %s <%t.out
-// RUN: %clangxx_msan -mllvm -msan-keep-going=1 -O0 %s -o %t && MSAN_OPTIONS=keep_going=0 not %run %t >%t.out 2>&1
-// FileCheck %s <%t.out
-// RUN: %clangxx_msan -mllvm -msan-keep-going=1 -O0 %s -o %t && MSAN_OPTIONS=keep_going=1 not %run %t >%t.out 2>&1
-// FileCheck --check-prefix=CHECK-KEEP-GOING %s <%t.out
-
-// Test how -mllvm -msan-keep-going and MSAN_OPTIONS=keep_going affect reports
+// Test how -fsanitize-recover=memory and MSAN_OPTIONS=keep_going affect reports
 // from interceptors.
-// -mllvm -msan-keep-going provides the default value of keep_going flag, but is
+// -fsanitize-recover=memory provides the default value of keep_going flag, but is
 // always overwritten by MSAN_OPTIONS
 
+// RUN: %clangxx_msan -fsanitize-recover=memory -O0 %s -o %t && not %run %t >%t.out 2>&1
+// FileCheck --check-prefix=CHECK-RECOVER %s <%t.out
+// RUN: %clangxx_msan -fsanitize-recover=memory -O0 %s -o %t && MSAN_OPTIONS=keep_going=0 not %run %t >%t.out 2>&1
+// FileCheck %s <%t.out
+// RUN: %clangxx_msan -fsanitize-recover=memory -O0 %s -o %t && MSAN_OPTIONS=keep_going=1 not %run %t >%t.out 2>&1
+// FileCheck --check-prefix=CHECK-RECOVER %s <%t.out
+
+// Test how legacy -mllvm -msan-keep-going and MSAN_OPTIONS=keep_going affect
+// reports from interceptors.
+
+// RUN: %clangxx_msan -mllvm -msan-keep-going=1 -O0 %s -o %t && not %run %t >%t.out 2>&1
+// FileCheck --check-prefix=CHECK-RECOVER %s <%t.out
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -28,6 +34,6 @@ int main(int argc, char **argv) {
     exit(0);
   fprintf(stderr, "Done\n");
   // CHECK-NOT: Done
-  // CHECK-KEEP-GOING: Done
+  // CHECK-RECOVER: Done
   return 0;
 }

Copied: compiler-rt/trunk/test/msan/recover.cc (from r285821, compiler-rt/trunk/test/msan/keep-going.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/msan/recover.cc?p2=compiler-rt/trunk/test/msan/recover.cc&p1=compiler-rt/trunk/test/msan/keep-going.cc&r1=285821&r2=286149&rev=286149&view=diff
==============================================================================
--- compiler-rt/trunk/test/msan/keep-going.cc (original)
+++ compiler-rt/trunk/test/msan/recover.cc Mon Nov  7 15:02:56 2016
@@ -5,20 +5,27 @@
 // RUN: %clangxx_msan -O0 %s -o %t && MSAN_OPTIONS=keep_going=1 not %run %t >%t.out 2>&1
 // FileCheck %s <%t.out
 
-// RUN: %clangxx_msan -mllvm -msan-keep-going=1 -O0 %s -o %t && not %run %t >%t.out 2>&1
-// FileCheck --check-prefix=CHECK-KEEP-GOING %s <%t.out
-// RUN: %clangxx_msan -mllvm -msan-keep-going=1 -O0 %s -o %t && MSAN_OPTIONS=keep_going=0 not %run %t >%t.out 2>&1
+// Test behavior of -fsanitize-recover=memory and MSAN_OPTIONS=keep_going.
+// -fsanitize-recover=memory provides the default value of keep_going flag; value
+// of 1 can be overwritten by MSAN_OPTIONS, value of 0 can not.
+
+// RUN: %clangxx_msan -fsanitize-recover=memory -O0 %s -o %t && not %run %t >%t.out 2>&1
+// FileCheck --check-prefix=CHECK-RECOVER %s <%t.out
+// RUN: %clangxx_msan -fsanitize-recover=memory -O0 %s -o %t && MSAN_OPTIONS=keep_going=0 not %run %t >%t.out 2>&1
 // FileCheck %s <%t.out
-// RUN: %clangxx_msan -mllvm -msan-keep-going=1 -O0 %s -o %t && MSAN_OPTIONS=keep_going=1 not %run %t >%t.out 2>&1
-// FileCheck --check-prefix=CHECK-KEEP-GOING %s <%t.out
-// RUN: %clangxx_msan -mllvm -msan-keep-going=1 -O0 %s -o %t && MSAN_OPTIONS=halt_on_error=1 not %run %t >%t.out 2>&1
+// RUN: %clangxx_msan -fsanitize-recover=memory -O0 %s -o %t && MSAN_OPTIONS=keep_going=1 not %run %t >%t.out 2>&1
+// FileCheck --check-prefix=CHECK-RECOVER %s <%t.out
+// RUN: %clangxx_msan -fsanitize-recover=memory -O0 %s -o %t && MSAN_OPTIONS=halt_on_error=1 not %run %t >%t.out 2>&1
 // FileCheck %s <%t.out
-// RUN: %clangxx_msan -mllvm -msan-keep-going=1 -O0 %s -o %t && MSAN_OPTIONS=halt_on_error=0 not %run %t >%t.out 2>&1
-// FileCheck --check-prefix=CHECK-KEEP-GOING %s <%t.out
+// RUN: %clangxx_msan -fsanitize-recover=memory -O0 %s -o %t && MSAN_OPTIONS=halt_on_error=0 not %run %t >%t.out 2>&1
+// FileCheck --check-prefix=CHECK-RECOVER %s <%t.out
 
-// Test behaviour of -mllvm -msan-keep-going and MSAN_OPTIONS=keep_going.
-// -mllvm -msan-keep-going provides the default value of keep_going flag; value
-// of 1 can be overwritten by MSAN_OPTIONS, value of 0 can not.
+// Basic test of legacy -mllvm -msan-keep-going and MSAN_OPTIONS=keep_going.
+
+// RUN: %clangxx_msan -mllvm -msan-keep-going=1 -O0 %s -o %t && not %run %t >%t.out 2>&1
+// FileCheck --check-prefix=CHECK-RECOVER %s <%t.out
+// RUN: %clangxx_msan -mllvm -msan-keep-going=1 -O0 %s -o %t && MSAN_OPTIONS=keep_going=0 not %run %t >%t.out 2>&1
+// FileCheck %s <%t.out
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -29,6 +36,6 @@ int main(int argc, char **argv) {
     exit(0);
   fprintf(stderr, "Done\n");
   // CHECK-NOT: Done
-  // CHECK-KEEP-GOING: Done
+  // CHECK-RECOVER: Done
   return 0;
 }




More information about the llvm-commits mailing list