[compiler-rt] r367855 - compiler-rt: Rename last few cc files below test/ubsan to cpp

Nico Weber via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 5 06:23:38 PDT 2019


Author: nico
Date: Mon Aug  5 06:23:38 2019
New Revision: 367855

URL: http://llvm.org/viewvc/llvm-project?rev=367855&view=rev
Log:
compiler-rt: Rename last few cc files below test/ubsan to cpp

See r367803 and similar other changes.

Added:
    compiler-rt/trunk/test/ubsan/TestCases/Misc/Linux/print_stack_trace.cpp
      - copied, changed from r367854, compiler-rt/trunk/test/ubsan/TestCases/Misc/Linux/print_stack_trace.cc
    compiler-rt/trunk/test/ubsan/TestCases/Misc/Linux/ubsan_options.cpp
      - copied, changed from r367854, compiler-rt/trunk/test/ubsan/TestCases/Misc/Linux/ubsan_options.cc
    compiler-rt/trunk/test/ubsan/TestCases/Misc/coverage-levels.cpp
      - copied unchanged from r367854, compiler-rt/trunk/test/ubsan/TestCases/Misc/coverage-levels.cc
    compiler-rt/trunk/test/ubsan/TestCases/Misc/log-path_test.cpp
      - copied unchanged from r367854, compiler-rt/trunk/test/ubsan/TestCases/Misc/log-path_test.cc
Removed:
    compiler-rt/trunk/test/ubsan/TestCases/Misc/Linux/print_stack_trace.cc
    compiler-rt/trunk/test/ubsan/TestCases/Misc/Linux/ubsan_options.cc
    compiler-rt/trunk/test/ubsan/TestCases/Misc/coverage-levels.cc
    compiler-rt/trunk/test/ubsan/TestCases/Misc/log-path_test.cc
Modified:
    compiler-rt/trunk/test/ubsan/lit.common.cfg.py

Removed: compiler-rt/trunk/test/ubsan/TestCases/Misc/Linux/print_stack_trace.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/ubsan/TestCases/Misc/Linux/print_stack_trace.cc?rev=367854&view=auto
==============================================================================
--- compiler-rt/trunk/test/ubsan/TestCases/Misc/Linux/print_stack_trace.cc (original)
+++ compiler-rt/trunk/test/ubsan/TestCases/Misc/Linux/print_stack_trace.cc (removed)
@@ -1,23 +0,0 @@
-// RUN: %clangxx -fsanitize=undefined -O0 %s -o %t && UBSAN_OPTIONS=stack_trace_format=DEFAULT:fast_unwind_on_fatal=1 %run %t 2>&1 | FileCheck %s
-// RUN: %clangxx -fsanitize=undefined -O0 %s -o %t && UBSAN_OPTIONS=stack_trace_format=DEFAULT:fast_unwind_on_fatal=0 %run %t 2>&1 | FileCheck %s
-
-// This test is temporarily disabled due to broken unwinding on ARM.
-// UNSUPPORTED: -linux-
-
-// The test doesn't pass on Darwin in UBSan-TSan configuration, because TSan is
-// using the slow unwinder which is not supported on Darwin. The test should
-// be universal after landing of https://reviews.llvm.org/D32806.
-
-#include <sanitizer/common_interface_defs.h>
-
-static inline void FooBarBaz() {
-  __sanitizer_print_stack_trace();
-}
-
-int main() {
-  FooBarBaz();
-  return 0;
-}
-
-// CHECK: {{.*}} in FooBarBaz{{.*}}print_stack_trace.cc{{.*}}
-// CHECK: {{.*}} in main{{.*}}print_stack_trace.cc{{.*}}

Copied: compiler-rt/trunk/test/ubsan/TestCases/Misc/Linux/print_stack_trace.cpp (from r367854, compiler-rt/trunk/test/ubsan/TestCases/Misc/Linux/print_stack_trace.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/ubsan/TestCases/Misc/Linux/print_stack_trace.cpp?p2=compiler-rt/trunk/test/ubsan/TestCases/Misc/Linux/print_stack_trace.cpp&p1=compiler-rt/trunk/test/ubsan/TestCases/Misc/Linux/print_stack_trace.cc&r1=367854&r2=367855&rev=367855&view=diff
==============================================================================
--- compiler-rt/trunk/test/ubsan/TestCases/Misc/Linux/print_stack_trace.cc (original)
+++ compiler-rt/trunk/test/ubsan/TestCases/Misc/Linux/print_stack_trace.cpp Mon Aug  5 06:23:38 2019
@@ -19,5 +19,5 @@ int main() {
   return 0;
 }
 
-// CHECK: {{.*}} in FooBarBaz{{.*}}print_stack_trace.cc{{.*}}
-// CHECK: {{.*}} in main{{.*}}print_stack_trace.cc{{.*}}
+// CHECK: {{.*}} in FooBarBaz{{.*}}print_stack_trace.cpp{{.*}}
+// CHECK: {{.*}} in main{{.*}}print_stack_trace.cpp{{.*}}

Removed: compiler-rt/trunk/test/ubsan/TestCases/Misc/Linux/ubsan_options.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/ubsan/TestCases/Misc/Linux/ubsan_options.cc?rev=367854&view=auto
==============================================================================
--- compiler-rt/trunk/test/ubsan/TestCases/Misc/Linux/ubsan_options.cc (original)
+++ compiler-rt/trunk/test/ubsan/TestCases/Misc/Linux/ubsan_options.cc (removed)
@@ -1,18 +0,0 @@
-// RUN: %clangxx -fsanitize=integer -fsanitize-recover=integer %s -o %t
-// RUN: not %run %t 2>&1 | FileCheck %s
-
-// __ubsan_default_options() doesn't work on Darwin.
-// XFAIL: darwin
-
-#include <stdint.h>
-
-extern "C" const char *__ubsan_default_options() {
-  return "halt_on_error=1";
-}
-
-int main() {
-  (void)(uint64_t(10000000000000000000ull) + uint64_t(9000000000000000000ull));
-  // CHECK: ubsan_options.cc:[[@LINE-1]]:44: runtime error: unsigned integer overflow
-  return 0;
-}
-

Copied: compiler-rt/trunk/test/ubsan/TestCases/Misc/Linux/ubsan_options.cpp (from r367854, compiler-rt/trunk/test/ubsan/TestCases/Misc/Linux/ubsan_options.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/ubsan/TestCases/Misc/Linux/ubsan_options.cpp?p2=compiler-rt/trunk/test/ubsan/TestCases/Misc/Linux/ubsan_options.cpp&p1=compiler-rt/trunk/test/ubsan/TestCases/Misc/Linux/ubsan_options.cc&r1=367854&r2=367855&rev=367855&view=diff
==============================================================================
--- compiler-rt/trunk/test/ubsan/TestCases/Misc/Linux/ubsan_options.cc (original)
+++ compiler-rt/trunk/test/ubsan/TestCases/Misc/Linux/ubsan_options.cpp Mon Aug  5 06:23:38 2019
@@ -12,7 +12,7 @@ extern "C" const char *__ubsan_default_o
 
 int main() {
   (void)(uint64_t(10000000000000000000ull) + uint64_t(9000000000000000000ull));
-  // CHECK: ubsan_options.cc:[[@LINE-1]]:44: runtime error: unsigned integer overflow
+  // CHECK: ubsan_options.cpp:[[@LINE-1]]:44: runtime error: unsigned integer overflow
   return 0;
 }
 

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=367854&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,48 +0,0 @@
-// Test various levels of coverage
-//
-// FIXME: Port the environment variable logic below for the lit shell.
-// REQUIRES: shell
-//
-// RUN: rm -rf %t-dir && mkdir %t-dir
-// 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-dir"' %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-dir"' %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-dir"' %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-dir"' %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: %env_ubsan_opts=coverage=1:verbosity=1:coverage_dir='"%t-dir"' %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: %env_ubsan_opts=coverage=1:verbosity=1:coverage_dir='"%t-dir"' %run %t 2>&1 | FileCheck %s --check-prefix=CHECK3 --check-prefix=CHECK_WARN
-
-// Coverage is not yet implemented in TSan.
-// XFAIL: ubsan-tsan
-// UNSUPPORTED: ubsan-standalone-static
-// No coverage support
-// UNSUPPORTED: openbsd
-
-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:  2 PCs written
-// CHECK3:  2 PCs written

Removed: compiler-rt/trunk/test/ubsan/TestCases/Misc/log-path_test.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/ubsan/TestCases/Misc/log-path_test.cc?rev=367854&view=auto
==============================================================================
--- compiler-rt/trunk/test/ubsan/TestCases/Misc/log-path_test.cc (original)
+++ compiler-rt/trunk/test/ubsan/TestCases/Misc/log-path_test.cc (removed)
@@ -1,38 +0,0 @@
-// FIXME: https://code.google.com/p/address-sanitizer/issues/detail?id=316
-// XFAIL: android
-
-// The globs below do not work in the lit shell.
-// REQUIRES: shell
-
-// RUN: %clangxx -fsanitize=undefined %s -O1 -o %t
-
-// Regular run.
-// RUN: %run %t -4 2> %t.out
-// RUN: FileCheck %s --check-prefix=CHECK-ERROR < %t.out
-
-// Good log_path.
-// RUN: rm -f %t.log.*
-// RUN: %device_rm -f '%t.log.*'
-// RUN: %env_ubsan_opts=log_path='"%t.log"' %run %t -4 2> %t.out
-// RUN: FileCheck %s --check-prefix=CHECK-ERROR < %t.log.*
-
-// Run w/o errors should not produce any log.
-// RUN: rm -f %t.log.*
-// RUN: %device_rm -f '%t.log.*'
-// RUN: %env_ubsan_opts=log_path='"%t.log"'  %run %t 4
-// RUN: not cat %t.log.*
-
-// FIXME: log_path is not supported on Windows yet.
-// XFAIL: windows-msvc
-
-#include <stdio.h>
-#include <stdlib.h>
-int main(int argc, char *argv[]) {
-  double a = atof(argv[1]);
-  unsigned int ai = (unsigned int) a;
-  printf("%f %u\n", a, ai);
-  return 0;
-}
-
-// CHECK-ERROR: runtime error: -4 is outside the range of representable values of type 'unsigned int'
-

Modified: compiler-rt/trunk/test/ubsan/lit.common.cfg.py
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/ubsan/lit.common.cfg.py?rev=367855&r1=367854&r2=367855&view=diff
==============================================================================
--- compiler-rt/trunk/test/ubsan/lit.common.cfg.py (original)
+++ compiler-rt/trunk/test/ubsan/lit.common.cfg.py Mon Aug  5 06:23:38 2019
@@ -65,7 +65,7 @@ config.substitutions.append( ("%clangxx
 config.substitutions.append( ("%gmlt ", " ".join(config.debug_info_flags) + " ") )
 
 # Default test suffixes.
-config.suffixes = ['.c', '.cc', '.cpp']
+config.suffixes = ['.c', '.cpp']
 
 # Check that the host supports UndefinedBehaviorSanitizer tests
 if config.host_os not in ['Linux', 'Darwin', 'FreeBSD', 'Windows', 'NetBSD', 'SunOS', 'OpenBSD']:




More information about the llvm-commits mailing list