[compiler-rt] r232025 - Make the UBSan coverage-levels.cc test be Linux specific

Kuba Brecka kuba.brecka at gmail.com
Thu Mar 12 03:44:34 PDT 2015


Author: kuba.brecka
Date: Thu Mar 12 05:44:34 2015
New Revision: 232025

URL: http://llvm.org/viewvc/llvm-project?rev=232025&view=rev
Log:
Make the UBSan coverage-levels.cc test be Linux specific

Reviewed at http://reviews.llvm.org/D8278


Added:
    compiler-rt/trunk/test/ubsan/TestCases/Misc/Linux/
    compiler-rt/trunk/test/ubsan/TestCases/Misc/Linux/coverage-levels.cc
      - copied, changed from r231986, compiler-rt/trunk/test/ubsan/TestCases/Misc/coverage-levels.cc
    compiler-rt/trunk/test/ubsan/TestCases/Misc/Linux/lit.local.cfg
Removed:
    compiler-rt/trunk/test/ubsan/TestCases/Misc/coverage-levels.cc

Copied: compiler-rt/trunk/test/ubsan/TestCases/Misc/Linux/coverage-levels.cc (from r231986, compiler-rt/trunk/test/ubsan/TestCases/Misc/coverage-levels.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/ubsan/TestCases/Misc/Linux/coverage-levels.cc?p2=compiler-rt/trunk/test/ubsan/TestCases/Misc/Linux/coverage-levels.cc&p1=compiler-rt/trunk/test/ubsan/TestCases/Misc/coverage-levels.cc&r1=231986&r2=232025&rev=232025&view=diff
==============================================================================
--- compiler-rt/trunk/test/ubsan/TestCases/Misc/coverage-levels.cc (original)
+++ compiler-rt/trunk/test/ubsan/TestCases/Misc/Linux/coverage-levels.cc Thu Mar 12 05:44:34 2015
@@ -14,8 +14,6 @@
 // RUN: %clangxx -fsanitize=shift -O1 -fsanitize-coverage=3  %s -o %t
 // RUN: UBSAN_OPTIONS=$OPT ASAN_OPTIONS=$OPT %run %t 2>&1 | FileCheck %s --check-prefix=CHECK3 --check-prefix=CHECK_WARN
 
-// XFAIL: darwin
-
 volatile int sink;
 int main(int argc, char **argv) {
   int shift = argc * 32;

Added: compiler-rt/trunk/test/ubsan/TestCases/Misc/Linux/lit.local.cfg
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/ubsan/TestCases/Misc/Linux/lit.local.cfg?rev=232025&view=auto
==============================================================================
--- compiler-rt/trunk/test/ubsan/TestCases/Misc/Linux/lit.local.cfg (added)
+++ compiler-rt/trunk/test/ubsan/TestCases/Misc/Linux/lit.local.cfg Thu Mar 12 05:44:34 2015
@@ -0,0 +1,9 @@
+def getRoot(config):
+  if not config.parent:
+    return config
+  return getRoot(config.parent)
+
+root = getRoot(config)
+
+if root.host_os not in ['Linux']:
+  config.unsupported = True

Removed: compiler-rt/trunk/test/ubsan/TestCases/Misc/coverage-levels.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/ubsan/TestCases/Misc/coverage-levels.cc?rev=232024&view=auto
==============================================================================
--- compiler-rt/trunk/test/ubsan/TestCases/Misc/coverage-levels.cc (original)
+++ compiler-rt/trunk/test/ubsan/TestCases/Misc/coverage-levels.cc (removed)
@@ -1,38 +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=1  %s -o %t
-// RUN: UBSAN_OPTIONS=$OPT ASAN_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=1  %s -o %t
-// RUN: UBSAN_OPTIONS=$OPT ASAN_OPTIONS=$OPT %run %t 2>&1 | FileCheck %s --check-prefix=CHECK1 --check-prefix=CHECK_NOWARN
-
-// RUN: %clangxx -fsanitize=shift -O1 -fsanitize-coverage=1  %s -o %t
-// RUN: UBSAN_OPTIONS=$OPT ASAN_OPTIONS=$OPT %run %t 2>&1 | FileCheck %s --check-prefix=CHECK1 --check-prefix=CHECK_WARN
-// RUN: %clangxx -fsanitize=shift -O1 -fsanitize-coverage=2  %s -o %t
-// RUN: UBSAN_OPTIONS=$OPT ASAN_OPTIONS=$OPT %run %t 2>&1 | FileCheck %s --check-prefix=CHECK2 --check-prefix=CHECK_WARN
-// RUN: %clangxx -fsanitize=shift -O1 -fsanitize-coverage=3  %s -o %t
-// RUN: UBSAN_OPTIONS=$OPT ASAN_OPTIONS=$OPT %run %t 2>&1 | FileCheck %s --check-prefix=CHECK3 --check-prefix=CHECK_WARN
-
-// XFAIL: darwin
-
-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





More information about the llvm-commits mailing list