diff options
Diffstat (limited to 'compiler-rt/test')
| -rw-r--r-- | compiler-rt/test/asan/TestCases/Posix/bcmp_test.cc | 19 | ||||
| -rw-r--r-- | compiler-rt/test/asan/TestCases/memcmp_test.cc | 4 | ||||
| -rw-r--r-- | compiler-rt/test/msan/memcmp_test.cc | 2 | ||||
| -rw-r--r-- | compiler-rt/test/msan/scoped-interceptors.cc | 2 | ||||
| -rw-r--r-- | compiler-rt/test/sanitizer_common/TestCases/Posix/weak_hook_test.cc | 12 |
5 files changed, 5 insertions, 34 deletions
diff --git a/compiler-rt/test/asan/TestCases/Posix/bcmp_test.cc b/compiler-rt/test/asan/TestCases/Posix/bcmp_test.cc deleted file mode 100644 index e4e9739d7c9..00000000000 --- a/compiler-rt/test/asan/TestCases/Posix/bcmp_test.cc +++ /dev/null @@ -1,19 +0,0 @@ -// RUN: %clangxx_asan -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s -// RUN: %clangxx_asan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s -// RUN: %clangxx_asan -O2 %s -o %t && not %run %t 2>&1 | FileCheck %s -// RUN: %clangxx_asan -O3 %s -o %t && not %run %t 2>&1 | FileCheck %s - -// REQUIRES: compiler-rt-optimized -// UNSUPPORTED: android -// XFAIL: darwin - -#include <string.h> -int main(int argc, char **argv) { - char a1[] = {static_cast<char>(argc), 2, 3, 4}; - char a2[] = {1, static_cast<char>(2 * argc), 3, 4}; - int res = bcmp(a1, a2, 4 + argc); // BOOM - // CHECK: AddressSanitizer: stack-buffer-overflow - // CHECK: {{#1.*bcmp}} - // CHECK: {{#2.*main}} - return res; -} diff --git a/compiler-rt/test/asan/TestCases/memcmp_test.cc b/compiler-rt/test/asan/TestCases/memcmp_test.cc index e666b6d162b..0dd9820f52a 100644 --- a/compiler-rt/test/asan/TestCases/memcmp_test.cc +++ b/compiler-rt/test/asan/TestCases/memcmp_test.cc @@ -11,7 +11,7 @@ int main(int argc, char **argv) { char a2[] = {1, static_cast<char>(2*argc), 3, 4}; int res = memcmp(a1, a2, 4 + argc); // BOOM // CHECK: AddressSanitizer: stack-buffer-overflow - // CHECK: {{#1.*memcmp}} - // CHECK: {{#2.*main}} + // CHECK: {{#0.*memcmp}} + // CHECK: {{#1.*main}} return res; } diff --git a/compiler-rt/test/msan/memcmp_test.cc b/compiler-rt/test/msan/memcmp_test.cc index 42230cc4d0c..5ade58a6004 100644 --- a/compiler-rt/test/msan/memcmp_test.cc +++ b/compiler-rt/test/msan/memcmp_test.cc @@ -13,6 +13,6 @@ int main(int argc, char **argv) { if (!res) printf("equals"); return 0; - // CHECK: Uninitialized bytes in MemcmpInterceptorCommon at offset 3 + // CHECK: Uninitialized bytes in __interceptor_memcmp at offset 3 // CHECK: MemorySanitizer: use-of-uninitialized-value } diff --git a/compiler-rt/test/msan/scoped-interceptors.cc b/compiler-rt/test/msan/scoped-interceptors.cc index 5eff33d6bf6..fc7d4578482 100644 --- a/compiler-rt/test/msan/scoped-interceptors.cc +++ b/compiler-rt/test/msan/scoped-interceptors.cc @@ -37,7 +37,7 @@ int main(int argc, char *argv[]) { case '2': { int cmp = memcmp(uninit, uninit, sizeof(uninit)); // BOOM break; - // CASE-2: Uninitialized bytes in MemcmpInterceptorCommon + // CASE-2: Uninitialized bytes in __interceptor_memcmp } case '3': { size_t len = strlen(uninit); // BOOM diff --git a/compiler-rt/test/sanitizer_common/TestCases/Posix/weak_hook_test.cc b/compiler-rt/test/sanitizer_common/TestCases/Posix/weak_hook_test.cc index 9439e518146..9176a524dbe 100644 --- a/compiler-rt/test/sanitizer_common/TestCases/Posix/weak_hook_test.cc +++ b/compiler-rt/test/sanitizer_common/TestCases/Posix/weak_hook_test.cc @@ -6,11 +6,8 @@ // XFAIL: lsan // XFAIL: ubsan -#include <assert.h> #include <string.h> -#if defined(_GNU_SOURCE) -#include <strings.h> // for bcmp -#endif +#include <assert.h> bool seen_memcmp, seen_strncmp, seen_strncasecmp, seen_strcmp, seen_strcasecmp, seen_strstr, seen_strcasestr, seen_memmem; @@ -62,13 +59,6 @@ int main() { int_sink = memcmp(s1, s2, sizeof(s2)); assert(seen_memcmp); -#if defined(_GNU_SOURCE) || defined(__NetBSD__) || defined(__FreeBSD__) || \ - defined(__OpenBSD__) - seen_memcmp = false; - int_sink = bcmp(s1, s2, sizeof(s2)); - assert(seen_memcmp); -#endif - int_sink = strncmp(s1, s2, sizeof(s2)); assert(seen_strncmp); |

