From 062c26f1f0133f8dd5fb657eb1fffef3c1274be4 Mon Sep 17 00:00:00 2001 From: Evgeniy Stepanov Date: Wed, 15 Jun 2016 21:18:17 +0000 Subject: [PATCH] Merge two coverage tests undef UBSan into one. Also replace mkdir -p with rm -rf && mkdir. llvm-svn: 272839 --- .../ubsan/TestCases/Misc/coverage-levels.cc | 6 +++++- compiler-rt/test/ubsan/TestCases/coverage.cc | 18 ------------------ 2 files changed, 5 insertions(+), 19 deletions(-) delete mode 100644 compiler-rt/test/ubsan/TestCases/coverage.cc diff --git a/compiler-rt/test/ubsan/TestCases/Misc/coverage-levels.cc b/compiler-rt/test/ubsan/TestCases/Misc/coverage-levels.cc index bc973c4dc994..f96b487a487f 100644 --- a/compiler-rt/test/ubsan/TestCases/Misc/coverage-levels.cc +++ b/compiler-rt/test/ubsan/TestCases/Misc/coverage-levels.cc @@ -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 diff --git a/compiler-rt/test/ubsan/TestCases/coverage.cc b/compiler-rt/test/ubsan/TestCases/coverage.cc deleted file mode 100644 index 2f3caccbf894..000000000000 --- a/compiler-rt/test/ubsan/TestCases/coverage.cc +++ /dev/null @@ -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