[compiler-rt] r338307 - [NFC] Rename test/ubsan/TestCases/{ImplicitCast => ImplicitConversion}

Roman Lebedev via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 30 14:11:34 PDT 2018


Author: lebedevri
Date: Mon Jul 30 14:11:34 2018
New Revision: 338307

URL: http://llvm.org/viewvc/llvm-project?rev=338307&view=rev
Log:
[NFC] Rename test/ubsan/TestCases/{ImplicitCast => ImplicitConversion}

Just to be consistent with the rest.
I should have done that in the commit itself, but the filepaths
is one thing i forgot to verify :S

Added:
    compiler-rt/trunk/test/ubsan/TestCases/ImplicitConversion/
    compiler-rt/trunk/test/ubsan/TestCases/ImplicitConversion/integer-truncation-blacklist.c
      - copied, changed from r338296, compiler-rt/trunk/test/ubsan/TestCases/ImplicitCast/integer-truncation-blacklist.c
    compiler-rt/trunk/test/ubsan/TestCases/ImplicitConversion/integer-truncation-summary.cpp
      - copied, changed from r338296, compiler-rt/trunk/test/ubsan/TestCases/ImplicitCast/integer-truncation-summary.cpp
    compiler-rt/trunk/test/ubsan/TestCases/ImplicitConversion/integer-truncation.c
      - copied, changed from r338296, compiler-rt/trunk/test/ubsan/TestCases/ImplicitCast/integer-truncation.c
Removed:
    compiler-rt/trunk/test/ubsan/TestCases/ImplicitCast/integer-truncation-blacklist.c
    compiler-rt/trunk/test/ubsan/TestCases/ImplicitCast/integer-truncation-summary.cpp
    compiler-rt/trunk/test/ubsan/TestCases/ImplicitCast/integer-truncation.c

Removed: compiler-rt/trunk/test/ubsan/TestCases/ImplicitCast/integer-truncation-blacklist.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/ubsan/TestCases/ImplicitCast/integer-truncation-blacklist.c?rev=338306&view=auto
==============================================================================
--- compiler-rt/trunk/test/ubsan/TestCases/ImplicitCast/integer-truncation-blacklist.c (original)
+++ compiler-rt/trunk/test/ubsan/TestCases/ImplicitCast/integer-truncation-blacklist.c (removed)
@@ -1,20 +0,0 @@
-// FIXME: https://code.google.com/p/address-sanitizer/issues/detail?id=316
-// I'm not sure this is actually *that* issue, but this seems oddly similar to the other XFAIL'ed cases.
-// XFAIL: android
-// UNSUPPORTED: ios
-
-// RUN: rm -f %tmp
-// RUN: echo "[implicit-integer-truncation]" >> %tmp
-// RUN: echo "fun:*implicitTruncation*" >> %tmp
-// RUN: %clang -fsanitize=implicit-integer-truncation -fno-sanitize-recover=implicit-integer-truncation -fsanitize-blacklist=%tmp -O0 %s -o %t && not %run %t 2>&1
-// RUN: %clang -fsanitize=implicit-integer-truncation -fno-sanitize-recover=implicit-integer-truncation -fsanitize-blacklist=%tmp -O1 %s -o %t && not %run %t 2>&1
-// RUN: %clang -fsanitize=implicit-integer-truncation -fno-sanitize-recover=implicit-integer-truncation -fsanitize-blacklist=%tmp -O2 %s -o %t && not %run %t 2>&1
-// RUN: %clang -fsanitize=implicit-integer-truncation -fno-sanitize-recover=implicit-integer-truncation -fsanitize-blacklist=%tmp -O3 %s -o %t && not %run %t 2>&1
-
-unsigned char implicitTruncation(unsigned int argc) {
-  return argc; // BOOM
-}
-
-int main(int argc, char **argv) {
-  return implicitTruncation(~0U);
-}

Removed: compiler-rt/trunk/test/ubsan/TestCases/ImplicitCast/integer-truncation-summary.cpp
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/ubsan/TestCases/ImplicitCast/integer-truncation-summary.cpp?rev=338306&view=auto
==============================================================================
--- compiler-rt/trunk/test/ubsan/TestCases/ImplicitCast/integer-truncation-summary.cpp (original)
+++ compiler-rt/trunk/test/ubsan/TestCases/ImplicitCast/integer-truncation-summary.cpp (removed)
@@ -1,13 +0,0 @@
-// RUN: %clangxx -fsanitize=implicit-integer-truncation %s -o %t
-// RUN: %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-NOTYPE
-// RUN: %env_ubsan_opts=report_error_type=1 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-TYPE
-// REQUIRES: !ubsan-standalone && !ubsan-standalone-static
-
-#include <stdint.h>
-
-int main() {
-  uint8_t t0 = (~(uint32_t(0)));
-  // CHECK-NOTYPE: SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior {{.*}}summary.cpp:[[@LINE-1]]:16
-  // CHECK-TYPE: SUMMARY: UndefinedBehaviorSanitizer: implicit-integer-truncation {{.*}}summary.cpp:[[@LINE-2]]:16
-  return 0;
-}

Removed: compiler-rt/trunk/test/ubsan/TestCases/ImplicitCast/integer-truncation.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/ubsan/TestCases/ImplicitCast/integer-truncation.c?rev=338306&view=auto
==============================================================================
--- compiler-rt/trunk/test/ubsan/TestCases/ImplicitCast/integer-truncation.c (original)
+++ compiler-rt/trunk/test/ubsan/TestCases/ImplicitCast/integer-truncation.c (removed)
@@ -1,63 +0,0 @@
-// RUN: %clang   -x c   -fsanitize=implicit-integer-truncation %s -o %t && %run %t 2>&1 | FileCheck %s --check-prefixes=CHECK
-// RUN: %clangxx -x c++ -fsanitize=implicit-integer-truncation %s -o %t && %run %t 2>&1 | FileCheck %s --check-prefixes=CHECK
-
-#include <stdint.h>
-
-#if !defined(__cplusplus)
-#define bool _Bool
-#endif
-
-int main() {
-// CHECK-NOT: integer-truncation.c
-
-  // Negative tests. Even if they produce unexpected results, this sanitizer does not care.
-  int8_t n0 = (~((uint32_t)0)); // ~0 -> -1, but do not warn.
-  uint8_t n2 = 128;
-  uint8_t n3 = 255;
-  // Bools do not count
-  bool b0 = (~((uint32_t)0));
-  bool b1 = 255;
-
-  // Explicit and-ing of bits will silence it.
-  uint8_t nc0 = (~((uint32_t)0)) & 255;
-
-  // Explicit casts
-  uint8_t i0 = (uint8_t)(~((uint32_t)0));
-
-#if defined(__cplusplus)
-  uint8_t i1 = uint8_t(~(uint32_t(0)));
-  uint8_t i2 = static_cast<uint8_t>(~(uint32_t(0)));
-#endif
-
-  // Positive tests.
-
-  uint8_t t_b0 = (~((uint16_t)(0)));
-// CHECK: {{.*}}integer-truncation.c:[[@LINE-1]]:18: runtime error: implicit conversion from type 'int' of value -1 (32-bit, signed) to type 'uint8_t' (aka 'unsigned char') changed the value to 255 (8-bit, unsigned)
-
-  uint8_t t_b1 = (~((uint32_t)0));
-// CHECK: {{.*}}integer-truncation.c:[[@LINE-1]]:18: runtime error: implicit conversion from type 'uint32_t' (aka 'unsigned int') of value 4294967295 (32-bit, unsigned) to type 'uint8_t' (aka 'unsigned char') changed the value to 255 (8-bit, unsigned)
-  uint16_t t_b2 = (~((uint32_t)0));
-// CHECK: {{.*}}integer-truncation.c:[[@LINE-1]]:19: runtime error: implicit conversion from type 'uint32_t' (aka 'unsigned int') of value 4294967295 (32-bit, unsigned) to type 'uint16_t' (aka 'unsigned short') changed the value to 65535 (16-bit, unsigned)
-
-  uint8_t t_b3 = ~((uint64_t)0);
-// CHECK: {{.*}}integer-truncation.c:[[@LINE-1]]:18: runtime error: implicit conversion from type 'uint64_t' (aka 'unsigned long{{[^']*}}') of value 18446744073709551615 (64-bit, unsigned) to type 'uint8_t' (aka 'unsigned char') changed the value to 255 (8-bit, unsigned)
-  uint16_t t_b4 = ~((uint64_t)0);
-// CHECK: {{.*}}integer-truncation.c:[[@LINE-1]]:19: runtime error: implicit conversion from type 'uint64_t' (aka 'unsigned long{{[^']*}}') of value 18446744073709551615 (64-bit, unsigned) to type 'uint16_t' (aka 'unsigned short') changed the value to 65535 (16-bit, unsigned)
-  uint32_t t_b5 = ~((uint64_t)0);
-// CHECK: {{.*}}integer-truncation.c:[[@LINE-1]]:19: runtime error: implicit conversion from type 'uint64_t' (aka 'unsigned long{{[^']*}}') of value 18446744073709551615 (64-bit, unsigned) to type 'uint32_t' (aka 'unsigned int') changed the value to 4294967295 (32-bit, unsigned)
-
-  int8_t t1 = 255;
-// CHECK: {{.*}}integer-truncation.c:[[@LINE-1]]:15: runtime error: implicit conversion from type 'int' of value 255 (32-bit, signed) to type 'int8_t' (aka 'signed char') changed the value to -1 (8-bit, signed)
-  uint8_t t2 = 256;
-// CHECK: {{.*}}integer-truncation.c:[[@LINE-1]]:16: runtime error: implicit conversion from type 'int' of value 256 (32-bit, signed) to type 'uint8_t' (aka 'unsigned char') changed the value to 0 (8-bit, unsigned)
-  int8_t t3 = 256;
-// CHECK: {{.*}}integer-truncation.c:[[@LINE-1]]:15: runtime error: implicit conversion from type 'int' of value 256 (32-bit, signed) to type 'int8_t' (aka 'signed char') changed the value to 0 (8-bit, signed)
-  uint8_t t4 = 257;
-// CHECK: {{.*}}integer-truncation.c:[[@LINE-1]]:16: runtime error: implicit conversion from type 'int' of value 257 (32-bit, signed) to type 'uint8_t' (aka 'unsigned char') changed the value to 1 (8-bit, unsigned)
-  int8_t t5 = 257;
-// CHECK: {{.*}}integer-truncation.c:[[@LINE-1]]:15: runtime error: implicit conversion from type 'int' of value 257 (32-bit, signed) to type 'int8_t' (aka 'signed char') changed the value to 1 (8-bit, signed)
-  int8_t t6 = 128;
-// CHECK: {{.*}}integer-truncation.c:[[@LINE-1]]:15: runtime error: implicit conversion from type 'int' of value 128 (32-bit, signed) to type 'int8_t' (aka 'signed char') changed the value to -128 (8-bit, signed)
-
-  return 0;
-}

Copied: compiler-rt/trunk/test/ubsan/TestCases/ImplicitConversion/integer-truncation-blacklist.c (from r338296, compiler-rt/trunk/test/ubsan/TestCases/ImplicitCast/integer-truncation-blacklist.c)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/ubsan/TestCases/ImplicitConversion/integer-truncation-blacklist.c?p2=compiler-rt/trunk/test/ubsan/TestCases/ImplicitConversion/integer-truncation-blacklist.c&p1=compiler-rt/trunk/test/ubsan/TestCases/ImplicitCast/integer-truncation-blacklist.c&r1=338296&r2=338307&rev=338307&view=diff
==============================================================================
    (empty)

Copied: compiler-rt/trunk/test/ubsan/TestCases/ImplicitConversion/integer-truncation-summary.cpp (from r338296, compiler-rt/trunk/test/ubsan/TestCases/ImplicitCast/integer-truncation-summary.cpp)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/ubsan/TestCases/ImplicitConversion/integer-truncation-summary.cpp?p2=compiler-rt/trunk/test/ubsan/TestCases/ImplicitConversion/integer-truncation-summary.cpp&p1=compiler-rt/trunk/test/ubsan/TestCases/ImplicitCast/integer-truncation-summary.cpp&r1=338296&r2=338307&rev=338307&view=diff
==============================================================================
    (empty)

Copied: compiler-rt/trunk/test/ubsan/TestCases/ImplicitConversion/integer-truncation.c (from r338296, compiler-rt/trunk/test/ubsan/TestCases/ImplicitCast/integer-truncation.c)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/ubsan/TestCases/ImplicitConversion/integer-truncation.c?p2=compiler-rt/trunk/test/ubsan/TestCases/ImplicitConversion/integer-truncation.c&p1=compiler-rt/trunk/test/ubsan/TestCases/ImplicitCast/integer-truncation.c&r1=338296&r2=338307&rev=338307&view=diff
==============================================================================
    (empty)




More information about the llvm-commits mailing list