[compiler-rt] r272839 - Merge two coverage tests undef UBSan into one.

Evgeniy Stepanov via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 15 14:18:17 PDT 2016


Author: eugenis
Date: Wed Jun 15 16:18:17 2016
New Revision: 272839

URL: http://llvm.org/viewvc/llvm-project?rev=272839&view=rev
Log:
Merge two coverage tests undef UBSan into one.

Also replace mkdir -p with rm -rf && mkdir.

Removed:
    compiler-rt/trunk/test/ubsan/TestCases/coverage.cc
Modified:
    compiler-rt/trunk/test/ubsan/TestCases/Misc/coverage-levels.cc

Modified: 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=272839&r1=272838&r2=272839&view=diff
==============================================================================
--- compiler-rt/trunk/test/ubsan/TestCases/Misc/coverage-levels.cc (original)
+++ compiler-rt/trunk/test/ubsan/TestCases/Misc/coverage-levels.cc Wed Jun 15 16:18:17 2016
@@ -3,12 +3,16 @@
 // FIXME: Port the environment variable logic below for the lit shell.
 // REQUIRES: shell
 //
-// RUN: mkdir -p %T/coverage-levels
+// RUN: rm -rf %T/coverage-levels && mkdir %T/coverage-levels
 // RUN: %clangxx -fsanitize=shift                        -DGOOD_SHIFT=1 -O1 -fsanitize-coverage=func  %s -o %t
 // RUN: %env_ubsan_opts=coverage=1:verbosity=1:coverage_dir='"%T/coverage-levels"' %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: %env_ubsan_opts=coverage=1:verbosity=1:coverage_dir='"%T/coverage-levels"' %run %t 2>&1 | FileCheck %s --check-prefix=CHECK1 --check-prefix=CHECK_NOWARN
 
+// Also works without any sanitizer.
+// RUN: %clangxx                                         -DGOOD_SHIFT=1 -O1 -fsanitize-coverage=func  %s -o %t
+// RUN: %env_ubsan_opts=coverage=1:verbosity=1:coverage_dir='"%T/coverage-levels"' %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: %env_ubsan_opts=coverage=1:verbosity=1:coverage_dir='"%T/coverage-levels"' %run %t 2>&1 | FileCheck %s --check-prefix=CHECK1 --check-prefix=CHECK_WARN
 // RUN: %clangxx -fsanitize=shift -O1 -fsanitize-coverage=bb  %s -o %t

Removed: compiler-rt/trunk/test/ubsan/TestCases/coverage.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/ubsan/TestCases/coverage.cc?rev=272838&view=auto
==============================================================================
--- compiler-rt/trunk/test/ubsan/TestCases/coverage.cc (original)
+++ compiler-rt/trunk/test/ubsan/TestCases/coverage.cc (removed)
@@ -1,18 +0,0 @@
-// RUN: mkdir -p %T/coverage
-// RUN: %clangxx -O1 -fsanitize-coverage=func  %s -o %t
-// RUN: %env_ubsan_opts=coverage=1:coverage_bitset=1:verbosity=1:coverage_dir=%T/coverage %run %t 2>&1 | FileCheck %s --check-prefix=CHECK1
-// RUN: %clangxx -O1 -fsanitize-coverage=bb  %s -o %t
-// RUN: %env_ubsan_opts=coverage=1:coverage_bitset=1:verbosity=1:coverage_dir=%T/coverage %run %t 2>&1 | FileCheck %s --check-prefix=CHECK2
-//
-// UNSUPPORTED: ubsan-tsan
-// UNSUPPORTED: android
-volatile int sink;
-int main(int argc, char **argv) {
-  if (argc == 0)
-    sink = 0;
-}
-
-// CHECK1: CovDump: bitset of 1 bits written for '{{.*}}', 1 bits are set
-// CHECK1:  1 PCs written
-// CHECK2: CovDump: bitset of 2 bits written for '{{.*}}', 1 bits are set
-// CHECK2:  1 PCs written




More information about the llvm-commits mailing list