From 769dab207e8bdd25127aaabb04e8ec5c249a7cb4 Mon Sep 17 00:00:00 2001 From: Dokyung Song Date: Thu, 23 Jul 2020 16:31:12 +0000 Subject: [PATCH] [libFuzzer] Disable interceptor tests on non-Linux platforms. Summary: libFuzzer's interceptor support added in 831ae45e3dc609e43ba561af07670a8fe47461ef currently only works on Linux. This patch disables the test cases added as part of that commit on non-Linux platforms. Reviewers: morehouse, hctim Subscribers: #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D84434 --- compiler-rt/test/fuzzer/custom-allocator.test | 3 +-- compiler-rt/test/fuzzer/memcmp.test | 7 ------- compiler-rt/test/fuzzer/noasan-memcmp.test | 9 +++++++++ compiler-rt/test/fuzzer/noasan-strcmp.test | 9 +++++++++ compiler-rt/test/fuzzer/noasan-strncmp.test | 9 +++++++++ compiler-rt/test/fuzzer/noasan-strstr.test | 9 +++++++++ compiler-rt/test/fuzzer/strcmp.test | 7 ------- compiler-rt/test/fuzzer/strncmp.test | 7 ------- compiler-rt/test/fuzzer/strstr.test | 7 ------- 9 files changed, 37 insertions(+), 30 deletions(-) create mode 100644 compiler-rt/test/fuzzer/noasan-memcmp.test create mode 100644 compiler-rt/test/fuzzer/noasan-strcmp.test create mode 100644 compiler-rt/test/fuzzer/noasan-strncmp.test create mode 100644 compiler-rt/test/fuzzer/noasan-strstr.test diff --git a/compiler-rt/test/fuzzer/custom-allocator.test b/compiler-rt/test/fuzzer/custom-allocator.test index e7eb51b9c149..a1f41c5f867d 100644 --- a/compiler-rt/test/fuzzer/custom-allocator.test +++ b/compiler-rt/test/fuzzer/custom-allocator.test @@ -1,6 +1,5 @@ -UNSUPPORTED: freebsd +UNSUPPORTED: darwin, freebsd, windows RUN: %cpp_compiler -fno-sanitize=address -fno-builtin %S/CustomAllocator.cpp %S/EmptyTest.cpp -o %t-NoAsanCustomAllocatorTest - RUN: %run %t-NoAsanCustomAllocatorTest -runs=1 2>&1 | FileCheck %s CHECK: CALLOC-MEMCMP diff --git a/compiler-rt/test/fuzzer/memcmp.test b/compiler-rt/test/fuzzer/memcmp.test index bd656264d57a..5657cab41dfc 100644 --- a/compiler-rt/test/fuzzer/memcmp.test +++ b/compiler-rt/test/fuzzer/memcmp.test @@ -1,11 +1,4 @@ UNSUPPORTED: freebsd RUN: %cpp_compiler %S/MemcmpTest.cpp -o %t-MemcmpTest RUN: not %run %t-MemcmpTest -seed=1 -runs=10000000 2>&1 | FileCheck %s - -RUN: %cpp_compiler -fno-sanitize=address -fno-builtin-memcmp %S/MemcmpTest.cpp -o %t-NoAsanMemcmpTest -RUN: not %run %t-NoAsanMemcmpTest -seed=1 -runs=10000000 2>&1 | FileCheck %s - -RUN: %cpp_compiler -fno-sanitize=address -fno-builtin-calloc -fno-builtin-memcmp %S/CustomAllocator.cpp %S/MemcmpTest.cpp -o %t-NoAsanCustomAllocatorMemcmpTest -RUN: not %run %t-NoAsanCustomAllocatorMemcmpTest -seed=1 -runs=10000000 2>&1 | FileCheck %s - CHECK: BINGO diff --git a/compiler-rt/test/fuzzer/noasan-memcmp.test b/compiler-rt/test/fuzzer/noasan-memcmp.test new file mode 100644 index 000000000000..c90755c53a90 --- /dev/null +++ b/compiler-rt/test/fuzzer/noasan-memcmp.test @@ -0,0 +1,9 @@ +UNSUPPORTED: darwin, freebsd, windows + +RUN: %cpp_compiler -fno-sanitize=address -fno-builtin-memcmp %S/MemcmpTest.cpp -o %t-NoAsanMemcmpTest +RUN: not %run %t-NoAsanMemcmpTest -seed=1 -runs=10000000 2>&1 | FileCheck %s + +RUN: %cpp_compiler -fno-sanitize=address -fno-builtin-calloc -fno-builtin-memcmp %S/CustomAllocator.cpp %S/MemcmpTest.cpp -o %t-NoAsanCustomAllocatorMemcmpTest +RUN: not %run %t-NoAsanCustomAllocatorMemcmpTest -seed=1 -runs=10000000 2>&1 | FileCheck %s + +CHECK: BINGO diff --git a/compiler-rt/test/fuzzer/noasan-strcmp.test b/compiler-rt/test/fuzzer/noasan-strcmp.test new file mode 100644 index 000000000000..76b7c5de7c7b --- /dev/null +++ b/compiler-rt/test/fuzzer/noasan-strcmp.test @@ -0,0 +1,9 @@ +UNSUPPORTED: darwin, freebsd, windows + +RUN: %cpp_compiler -fno-sanitize=address -fno-builtin-strcmp %S/StrcmpTest.cpp -o %t-NoAsanStrcmpTest +RUN: not %run %t-NoAsanStrcmpTest -seed=1 -runs=2000000 2>&1 | FileCheck %s + +RUN: %cpp_compiler -fno-sanitize=address -fno-builtin-calloc -fno-builtin-strcmp %S/CustomAllocator.cpp %S/StrcmpTest.cpp -o %t-NoAsanCustomAllocatorStrcmpTest +RUN: not %run %t-NoAsanCustomAllocatorStrcmpTest -seed=1 -runs=2000000 2>&1 | FileCheck %s + +CHECK: BINGO diff --git a/compiler-rt/test/fuzzer/noasan-strncmp.test b/compiler-rt/test/fuzzer/noasan-strncmp.test new file mode 100644 index 000000000000..705781ec3958 --- /dev/null +++ b/compiler-rt/test/fuzzer/noasan-strncmp.test @@ -0,0 +1,9 @@ +UNSUPPORTED: darwin, freebsd, windows + +RUN: %cpp_compiler -fno-sanitize=address -fno-builtin-strncmp %S/StrncmpTest.cpp -o %t-NoAsanStrncmpTest +RUN: not %run %t-NoAsanStrncmpTest -seed=2 -runs=10000000 2>&1 | FileCheck %s + +RUN: %cpp_compiler -fno-sanitize=address -fno-builtin-calloc -fno-builtin-strncmp %S/CustomAllocator.cpp %S/StrncmpTest.cpp -o %t-NoAsanCustomAllocatorStrncmpTest +RUN: not %run %t-NoAsanCustomAllocatorStrncmpTest -seed=2 -runs=10000000 2>&1 | FileCheck %s + +CHECK: BINGO diff --git a/compiler-rt/test/fuzzer/noasan-strstr.test b/compiler-rt/test/fuzzer/noasan-strstr.test new file mode 100644 index 000000000000..f06e903149bd --- /dev/null +++ b/compiler-rt/test/fuzzer/noasan-strstr.test @@ -0,0 +1,9 @@ +UNSUPPORTED: darwin, freebsd, windows + +RUN: %cpp_compiler -fno-sanitize=address -fno-builtin-strstr %S/StrstrTest.cpp -o %t-NoAsanStrstrTest +RUN: not %run %t-NoAsanStrstrTest -seed=1 -runs=2000000 2>&1 | FileCheck %s + +RUN: %cpp_compiler -fno-sanitize=address -fno-builtin-calloc -fno-builtin-strstr %S/CustomAllocator.cpp %S/StrstrTest.cpp -o %t-NoAsanCustomAllocatorStrstrTest +RUN: not %run %t-NoAsanCustomAllocatorStrstrTest -seed=1 -runs=2000000 2>&1 | FileCheck %s + +CHECK: BINGO diff --git a/compiler-rt/test/fuzzer/strcmp.test b/compiler-rt/test/fuzzer/strcmp.test index 89acbd68c924..14c22635fb16 100644 --- a/compiler-rt/test/fuzzer/strcmp.test +++ b/compiler-rt/test/fuzzer/strcmp.test @@ -1,11 +1,4 @@ UNSUPPORTED: freebsd RUN: %cpp_compiler %S/StrcmpTest.cpp -o %t-StrcmpTest RUN: not %run %t-StrcmpTest -seed=1 -runs=2000000 2>&1 | FileCheck %s - -RUN: %cpp_compiler -fno-sanitize=address -fno-builtin-strcmp %S/StrcmpTest.cpp -o %t-NoAsanStrcmpTest -RUN: not %run %t-NoAsanStrcmpTest -seed=1 -runs=2000000 2>&1 | FileCheck %s - -RUN: %cpp_compiler -fno-sanitize=address -fno-builtin-calloc -fno-builtin-strcmp %S/CustomAllocator.cpp %S/StrcmpTest.cpp -o %t-NoAsanCustomAllocatorStrcmpTest -RUN: not %run %t-NoAsanCustomAllocatorStrcmpTest -seed=1 -runs=2000000 2>&1 | FileCheck %s - CHECK: BINGO diff --git a/compiler-rt/test/fuzzer/strncmp.test b/compiler-rt/test/fuzzer/strncmp.test index 95c9153f9893..fb820b7d20e8 100644 --- a/compiler-rt/test/fuzzer/strncmp.test +++ b/compiler-rt/test/fuzzer/strncmp.test @@ -1,11 +1,4 @@ UNSUPPORTED: freebsd RUN: %cpp_compiler %S/StrncmpTest.cpp -o %t-StrncmpTest RUN: not %run %t-StrncmpTest -seed=2 -runs=10000000 2>&1 | FileCheck %s - -RUN: %cpp_compiler -fno-sanitize=address -fno-builtin-strncmp %S/StrncmpTest.cpp -o %t-NoAsanStrncmpTest -RUN: not %run %t-NoAsanStrncmpTest -seed=2 -runs=10000000 2>&1 | FileCheck %s - -RUN: %cpp_compiler -fno-sanitize=address -fno-builtin-calloc -fno-builtin-strncmp %S/CustomAllocator.cpp %S/StrncmpTest.cpp -o %t-NoAsanCustomAllocatorStrncmpTest -RUN: not %run %t-NoAsanCustomAllocatorStrncmpTest -seed=2 -runs=10000000 2>&1 | FileCheck %s - CHECK: BINGO diff --git a/compiler-rt/test/fuzzer/strstr.test b/compiler-rt/test/fuzzer/strstr.test index 28be6069c06f..60261e3f1ff3 100644 --- a/compiler-rt/test/fuzzer/strstr.test +++ b/compiler-rt/test/fuzzer/strstr.test @@ -1,11 +1,4 @@ UNSUPPORTED: freebsd RUN: %cpp_compiler %S/StrstrTest.cpp -o %t-StrstrTest RUN: not %run %t-StrstrTest -seed=1 -runs=2000000 2>&1 | FileCheck %s - -RUN: %cpp_compiler -fno-sanitize=address -fno-builtin-strstr %S/StrstrTest.cpp -o %t-NoAsanStrstrTest -RUN: not %run %t-NoAsanStrstrTest -seed=1 -runs=2000000 2>&1 | FileCheck %s - -RUN: %cpp_compiler -fno-sanitize=address -fno-builtin-calloc -fno-builtin-strstr %S/CustomAllocator.cpp %S/StrstrTest.cpp -o %t-NoAsanCustomAllocatorStrstrTest -RUN: not %run %t-NoAsanCustomAllocatorStrstrTest -seed=1 -runs=2000000 2>&1 | FileCheck %s - CHECK: BINGO