diff options
Diffstat (limited to 'compiler-rt/test')
-rw-r--r-- | compiler-rt/test/fuzzer/PrintUnstableStatsTest.cpp | 69 | ||||
-rw-r--r-- | compiler-rt/test/fuzzer/handle-unstable.test | 43 | ||||
-rw-r--r-- | compiler-rt/test/fuzzer/print_unstable_stats.test | 24 |
3 files changed, 0 insertions, 136 deletions
diff --git a/compiler-rt/test/fuzzer/PrintUnstableStatsTest.cpp b/compiler-rt/test/fuzzer/PrintUnstableStatsTest.cpp deleted file mode 100644 index 2b9de88d730..00000000000 --- a/compiler-rt/test/fuzzer/PrintUnstableStatsTest.cpp +++ /dev/null @@ -1,69 +0,0 @@ -#include <assert.h> -#include <cstdint> -#include <cstdio> -#include <cstdlib> - -int x = 0; -bool skip0 = false; -bool skip1 = false; -bool skip2 = false; - -__attribute__((noinline)) void det0() { x++; } -__attribute__((noinline)) void det1() { x++; } -__attribute__((noinline)) void det2() { x++; } -__attribute__((noinline)) void det3() { x++; } -__attribute__((noinline)) void det4() { x++; } - -__attribute__((noinline)) void ini0() { x++; } -__attribute__((noinline)) void ini1() { x++; } -__attribute__((noinline)) void ini2() { x++; } - -__attribute__((noinline)) void t0(int a) { x += a; } -__attribute__((noinline)) void t1() { x++; } -__attribute__((noinline)) void t2(int a, int b) { x += a + b; } -__attribute__((noinline)) void t3() { x++; } -__attribute__((noinline)) void t4(int a, int b, int c) { x += a + b +c; } - -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { - if (Size == 1 && Data[0] == 'A' && !skip0) { - skip0 = true; - ini0(); - } - if (Size == 1 && Data[0] == 'B' && !skip1) { - skip1 = true; - ini1(); - } - if (Size == 1 && Data[0] == 'C' && !skip2) { - skip2 = true; - ini2(); - } - - det0(); - det1(); - int a = rand(); - det2(); - - switch (a % 5) { - case 0: - t0(a); - break; - case 1: - t1(); - break; - case 2: - t2(a, a); - break; - case 3: - t3(); - break; - case 4: - t4(a, a, a); - break; - default: - assert(false); - } - - det3(); - det4(); - return 0; -} diff --git a/compiler-rt/test/fuzzer/handle-unstable.test b/compiler-rt/test/fuzzer/handle-unstable.test deleted file mode 100644 index d202246891d..00000000000 --- a/compiler-rt/test/fuzzer/handle-unstable.test +++ /dev/null @@ -1,43 +0,0 @@ -# Tests -handle_unstable -# FIXME: Disabled on Windows until symbolization works properly. -UNSUPPORTED: windows - -RUN: %cpp_compiler %S/PrintUnstableStatsTest.cpp -o %t-HandleUnstableTest - -; Normal -RUN: %run %t-HandleUnstableTest -print_coverage=1 -runs=100000 2>&1 | FileCheck %s --check-prefix=NORMAL -NORMAL-DAG: det0() -NORMAL-DAG: det1() -NORMAL-DAG: det2() -NORMAL-DAG: det3() -NORMAL-DAG: det4() -NORMAL-DAG: ini0() -NORMAL-DAG: ini1() -NORMAL-DAG: ini2() -NORMAL-DAG: t0(int) -NORMAL-DAG: t1() -NORMAL-DAG: t2(int, int) -NORMAL-DAG: t3() -NORMAL-DAG: t4(int, int, int) - -; MinUnstable -RUN: %run %t-HandleUnstableTest -print_coverage=1 -handle_unstable=1 -runs=100000 2>&1 | FileCheck %s --check-prefix=MIN -MIN-NOT: ini0() -MIN-NOT: ini1() -MIN-NOT: ini2() -MIN: det0() -MIN: det1() -MIN: det2() -MIN: det3() -MIN: det4() - -; ZeroUnstable -RUN: %run %t-HandleUnstableTest -print_coverage=1 -handle_unstable=2 -runs=1 2>&1 | FileCheck %s --check-prefix=ZERO -ZERO-NOT: ini0() -ZERO-NOT: ini1() -ZERO-NOT: ini2() -ZERO: det0() -ZERO: det1() -ZERO: det2() -ZERO: det3() -ZERO: det4() diff --git a/compiler-rt/test/fuzzer/print_unstable_stats.test b/compiler-rt/test/fuzzer/print_unstable_stats.test deleted file mode 100644 index 41b27913076..00000000000 --- a/compiler-rt/test/fuzzer/print_unstable_stats.test +++ /dev/null @@ -1,24 +0,0 @@ -# Tests -print_unstable_stats -# Disabled on Windows because of differences symbolizing and flakiness. -UNSUPPORTED: aarch64, windows - -RUN: %cpp_compiler %S/PrintUnstableStatsTest.cpp -o %t-PrintUnstableStatsTest - -RUN: %run %t-PrintUnstableStatsTest -print_unstable_stats=1 -runs=100000 2>&1 | FileCheck %s --check-prefix=LONG -# We do not observe ini functions since we take the minimum hit counts, and minimum hit counts for ini is 0. -LONG: UNSTABLE_FUNCTIONS: -LONG-NOT: det0() -LONG-NOT: det1() -LONG-NOT: det2() -LONG-NOT: det3() -LONG-NOT: det4() -LONG-NOT: ini0() -LONG-NOT: ini1() -LONG-NOT: ini2() -LONG-DAG: t0(int) -LONG-DAG: t1() -LONG-DAG: t2(int, int) -LONG-DAG: t3() -LONG-DAG: t4(int, int, int) - -LONG-DAG: stat::stability_rate: 27.59 |