[PATCH] D10415: [UBSan] Test: Move coverage-levels.cc out of Linux directory

Filipe Cabecinhas filcab+llvm.phabricator at gmail.com
Fri Jul 31 11:18:44 PDT 2015


This revision was automatically updated to reflect the committed changes.
Closed by commit rL243771: [UBSan] Test: Move coverage-levels.cc out of Linux directory (authored by filcab).

Changed prior to commit:
  http://reviews.llvm.org/D10415?vs=27590&id=31143#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D10415

Files:
  compiler-rt/trunk/test/ubsan/TestCases/Misc/Linux/coverage-levels.cc
  compiler-rt/trunk/test/ubsan/TestCases/Misc/coverage-levels.cc

Index: compiler-rt/trunk/test/ubsan/TestCases/Misc/coverage-levels.cc
===================================================================
--- compiler-rt/trunk/test/ubsan/TestCases/Misc/coverage-levels.cc
+++ compiler-rt/trunk/test/ubsan/TestCases/Misc/coverage-levels.cc
@@ -0,0 +1,39 @@
+// Test various levels of coverage
+//
+// RUN: mkdir -p %T/coverage-levels
+// RUN: OPT=coverage=1:verbosity=1:coverage_dir=%T/coverage-levels
+// RUN: %clangxx -fsanitize=shift                        -DGOOD_SHIFT=1 -O1 -fsanitize-coverage=func  %s -o %t
+// RUN: UBSAN_OPTIONS=$OPT %run %t 2>&1 | FileCheck %s --check-prefix=CHECK1 --check-prefix=CHECK_NOWARN
+// RUN: %clangxx -fsanitize=undefined                    -DGOOD_SHIFT=1 -O1 -fsanitize-coverage=func  %s -o %t
+// RUN: UBSAN_OPTIONS=$OPT %run %t 2>&1 | FileCheck %s --check-prefix=CHECK1 --check-prefix=CHECK_NOWARN
+
+// RUN: %clangxx -fsanitize=shift -O1 -fsanitize-coverage=func  %s -o %t
+// RUN: UBSAN_OPTIONS=$OPT %run %t 2>&1 | FileCheck %s --check-prefix=CHECK1 --check-prefix=CHECK_WARN
+// RUN: %clangxx -fsanitize=shift -O1 -fsanitize-coverage=bb  %s -o %t
+// RUN: UBSAN_OPTIONS=$OPT %run %t 2>&1 | FileCheck %s --check-prefix=CHECK2 --check-prefix=CHECK_WARN
+// RUN: %clangxx -fsanitize=shift -O1 -fsanitize-coverage=edge  %s -o %t
+// RUN: UBSAN_OPTIONS=$OPT %run %t 2>&1 | FileCheck %s --check-prefix=CHECK3 --check-prefix=CHECK_WARN
+
+// Coverage is not yet implemented in TSan.
+// XFAIL: ubsan-tsan
+
+volatile int sink;
+int main(int argc, char **argv) {
+  int shift = argc * 32;
+#if GOOD_SHIFT
+  shift = 3;
+#endif
+  if ((argc << shift) == 16)  // False.
+    return 1;
+  return 0;
+}
+
+// CHECK_WARN: shift exponent 32 is too large
+// CHECK_NOWARN-NOT: ERROR
+// FIXME: Currently, coverage instrumentation kicks in after ubsan, so we get
+// more than the minimal number of instrumented blocks.
+// FIXME: Currently, ubsan with -fno-sanitize-recover and w/o asan will fail
+// to dump coverage.
+// CHECK1:  1 PCs written
+// CHECK2:  3 PCs written
+// CHECK3:  4 PCs written
Index: compiler-rt/trunk/test/ubsan/TestCases/Misc/Linux/coverage-levels.cc
===================================================================
--- compiler-rt/trunk/test/ubsan/TestCases/Misc/Linux/coverage-levels.cc
+++ compiler-rt/trunk/test/ubsan/TestCases/Misc/Linux/coverage-levels.cc
@@ -1,39 +0,0 @@
-// Test various levels of coverage
-//
-// RUN: mkdir -p %T/coverage-levels
-// RUN: OPT=coverage=1:verbosity=1:coverage_dir=%T/coverage-levels
-// RUN: %clangxx -fsanitize=shift                        -DGOOD_SHIFT=1 -O1 -fsanitize-coverage=func  %s -o %t
-// RUN: UBSAN_OPTIONS=$OPT %run %t 2>&1 | FileCheck %s --check-prefix=CHECK1 --check-prefix=CHECK_NOWARN
-// RUN: %clangxx -fsanitize=undefined                    -DGOOD_SHIFT=1 -O1 -fsanitize-coverage=func  %s -o %t
-// RUN: UBSAN_OPTIONS=$OPT %run %t 2>&1 | FileCheck %s --check-prefix=CHECK1 --check-prefix=CHECK_NOWARN
-
-// RUN: %clangxx -fsanitize=shift -O1 -fsanitize-coverage=func  %s -o %t
-// RUN: UBSAN_OPTIONS=$OPT %run %t 2>&1 | FileCheck %s --check-prefix=CHECK1 --check-prefix=CHECK_WARN
-// RUN: %clangxx -fsanitize=shift -O1 -fsanitize-coverage=bb  %s -o %t
-// RUN: UBSAN_OPTIONS=$OPT %run %t 2>&1 | FileCheck %s --check-prefix=CHECK2 --check-prefix=CHECK_WARN
-// RUN: %clangxx -fsanitize=shift -O1 -fsanitize-coverage=edge  %s -o %t
-// RUN: UBSAN_OPTIONS=$OPT %run %t 2>&1 | FileCheck %s --check-prefix=CHECK3 --check-prefix=CHECK_WARN
-
-// Coverage is not yet implemented in TSan.
-// XFAIL: ubsan-tsan
-
-volatile int sink;
-int main(int argc, char **argv) {
-  int shift = argc * 32;
-#if GOOD_SHIFT
-  shift = 3;
-#endif
-  if ((argc << shift) == 16)  // False.
-    return 1;
-  return 0;
-}
-
-// CHECK_WARN: shift exponent 32 is too large
-// CHECK_NOWARN-NOT: ERROR
-// FIXME: Currently, coverage instrumentation kicks in after ubsan, so we get
-// more than the minimal number of instrumented blocks.
-// FIXME: Currently, ubsan with -fno-sanitize-recover and w/o asan will fail
-// to dump coverage.
-// CHECK1:  1 PCs written
-// CHECK2:  3 PCs written
-// CHECK3:  4 PCs written


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D10415.31143.patch
Type: text/x-patch
Size: 4138 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150731/275a541a/attachment.bin>


More information about the llvm-commits mailing list