summaryrefslogtreecommitdiff
path: root/test/libcxx/fuzzing
diff options
context:
space:
mode:
Diffstat (limited to 'test/libcxx/fuzzing')
-rw-r--r--test/libcxx/fuzzing/nth_element.cpp38
-rw-r--r--test/libcxx/fuzzing/partial_sort.cpp38
-rw-r--r--test/libcxx/fuzzing/partial_sort_copy.cpp38
-rw-r--r--test/libcxx/fuzzing/partition.cpp38
-rw-r--r--test/libcxx/fuzzing/partition_copy.cpp38
-rw-r--r--test/libcxx/fuzzing/regex_ECMAScript.cpp37
-rw-r--r--test/libcxx/fuzzing/regex_POSIX.cpp37
-rw-r--r--test/libcxx/fuzzing/regex_awk.cpp37
-rw-r--r--test/libcxx/fuzzing/regex_egrep.cpp37
-rw-r--r--test/libcxx/fuzzing/regex_extended.cpp37
-rw-r--r--test/libcxx/fuzzing/regex_grep.cpp37
-rw-r--r--test/libcxx/fuzzing/sort.cpp38
-rw-r--r--test/libcxx/fuzzing/stable_partition.cpp38
-rw-r--r--test/libcxx/fuzzing/stable_sort.cpp38
-rw-r--r--test/libcxx/fuzzing/unique.cpp38
-rw-r--r--test/libcxx/fuzzing/unique_copy.cpp38
16 files changed, 602 insertions, 0 deletions
diff --git a/test/libcxx/fuzzing/nth_element.cpp b/test/libcxx/fuzzing/nth_element.cpp
new file mode 100644
index 000000000000..ee7f0d824c94
--- /dev/null
+++ b/test/libcxx/fuzzing/nth_element.cpp
@@ -0,0 +1,38 @@
+// -*- C++ -*-
+//===----------------------- nth_element.cpp ------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// XFAIL
+
+#include "fuzzing.h"
+#include <cassert>
+#include <cstring> // for strlen
+
+const char * test_cases[] = {
+ "",
+ "s",
+ "bac",
+ "bacasf"
+ "lkajseravea",
+ "adsfkajdsfjkas;lnc441324513,34535r34525234"
+ };
+
+const size_t k_num_tests = sizeof(test_cases)/sizeof(test_cases[0]);
+
+
+int main ()
+{
+ for (size_t i = 0; i < k_num_tests; ++i)
+ {
+ const size_t size = std::strlen(test_cases[i]);
+ const uint8_t *data = (const uint8_t *) test_cases[i];
+ assert(0 == fuzzing::nth_element(data, size));
+ }
+ return 0;
+}
diff --git a/test/libcxx/fuzzing/partial_sort.cpp b/test/libcxx/fuzzing/partial_sort.cpp
new file mode 100644
index 000000000000..0c5889dbde8e
--- /dev/null
+++ b/test/libcxx/fuzzing/partial_sort.cpp
@@ -0,0 +1,38 @@
+// -*- C++ -*-
+//===-------------------------- partial_sort.cpp --------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// XFAIL
+
+#include "fuzzing.h"
+#include <cassert>
+#include <cstring> // for strlen
+
+const char * test_cases[] = {
+ "",
+ "s",
+ "bac",
+ "bacasf"
+ "lkajseravea",
+ "adsfkajdsfjkas;lnc441324513,34535r34525234"
+ };
+
+const size_t k_num_tests = sizeof(test_cases)/sizeof(test_cases[0]);
+
+
+int main ()
+{
+ for (size_t i = 0; i < k_num_tests; ++i)
+ {
+ const size_t size = std::strlen(test_cases[i]);
+ const uint8_t *data = (const uint8_t *) test_cases[i];
+ assert(0 == fuzzing::partial_sort(data, size));
+ }
+ return 0;
+}
diff --git a/test/libcxx/fuzzing/partial_sort_copy.cpp b/test/libcxx/fuzzing/partial_sort_copy.cpp
new file mode 100644
index 000000000000..368eed11bf7e
--- /dev/null
+++ b/test/libcxx/fuzzing/partial_sort_copy.cpp
@@ -0,0 +1,38 @@
+// -*- C++ -*-
+//===----------------------- partial_sort_copy.cpp ------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// XFAIL
+
+#include "fuzzing.h"
+#include <cassert>
+#include <cstring> // for strlen
+
+const char * test_cases[] = {
+ "",
+ "s",
+ "bac",
+ "bacasf"
+ "lkajseravea",
+ "adsfkajdsfjkas;lnc441324513,34535r34525234"
+ };
+
+const size_t k_num_tests = sizeof(test_cases)/sizeof(test_cases[0]);
+
+
+int main ()
+{
+ for (size_t i = 0; i < k_num_tests; ++i)
+ {
+ const size_t size = std::strlen(test_cases[i]);
+ const uint8_t *data = (const uint8_t *) test_cases[i];
+ assert(0 == fuzzing::partial_sort_copy(data, size));
+ }
+ return 0;
+}
diff --git a/test/libcxx/fuzzing/partition.cpp b/test/libcxx/fuzzing/partition.cpp
new file mode 100644
index 000000000000..03eed8c925ac
--- /dev/null
+++ b/test/libcxx/fuzzing/partition.cpp
@@ -0,0 +1,38 @@
+// -*- C++ -*-
+//===--------------------------- partition.cpp ----------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// XFAIL
+
+#include "fuzzing.h"
+#include <cassert>
+#include <cstring> // for strlen
+
+const char * test_cases[] = {
+ "",
+ "s",
+ "bac",
+ "bacasf"
+ "lkajseravea",
+ "adsfkajdsfjkas;lnc441324513,34535r34525234"
+ };
+
+const size_t k_num_tests = sizeof(test_cases)/sizeof(test_cases[0]);
+
+
+int main ()
+{
+ for (size_t i = 0; i < k_num_tests; ++i)
+ {
+ const size_t size = std::strlen(test_cases[i]);
+ const uint8_t *data = (const uint8_t *) test_cases[i];
+ assert(0 == fuzzing::partition(data, size));
+ }
+ return 0;
+}
diff --git a/test/libcxx/fuzzing/partition_copy.cpp b/test/libcxx/fuzzing/partition_copy.cpp
new file mode 100644
index 000000000000..68d821f632a6
--- /dev/null
+++ b/test/libcxx/fuzzing/partition_copy.cpp
@@ -0,0 +1,38 @@
+// -*- C++ -*-
+//===------------------------ partition_copy.cpp --------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// XFAIL
+
+#include "fuzzing.h"
+#include <cassert>
+#include <cstring> // for strlen
+
+const char * test_cases[] = {
+ "",
+ "s",
+ "bac",
+ "bacasf"
+ "lkajseravea",
+ "adsfkajdsfjkas;lnc441324513,34535r34525234"
+ };
+
+const size_t k_num_tests = sizeof(test_cases)/sizeof(test_cases[0]);
+
+
+int main ()
+{
+ for (size_t i = 0; i < k_num_tests; ++i)
+ {
+ const size_t size = std::strlen(test_cases[i]);
+ const uint8_t *data = (const uint8_t *) test_cases[i];
+ assert(0 == fuzzing::partition_copy(data, size));
+ }
+ return 0;
+}
diff --git a/test/libcxx/fuzzing/regex_ECMAScript.cpp b/test/libcxx/fuzzing/regex_ECMAScript.cpp
new file mode 100644
index 000000000000..2e57126022f3
--- /dev/null
+++ b/test/libcxx/fuzzing/regex_ECMAScript.cpp
@@ -0,0 +1,37 @@
+// -*- C++ -*-
+//===--------------------- regex_ECMAScript.cpp ---------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// XFAIL
+
+#include "fuzzing.h"
+#include <cassert>
+#include <cstring> // for strlen
+
+const char * test_cases[] = {
+ "",
+ "s",
+ "b*c",
+ "ba?sf"
+ "lka*ea",
+ "adsf*kas;lnc441[0-9]1r34525234"
+ };
+
+const size_t k_num_tests = sizeof(test_cases)/sizeof(test_cases[0]);
+
+int main ()
+{
+ for (size_t i = 0; i < k_num_tests; ++i)
+ {
+ const size_t size = std::strlen(test_cases[i]);
+ const uint8_t *data = (const uint8_t *) test_cases[i];
+ assert(0 == fuzzing::regex_ECMAScript(data, size));
+ }
+ return 0;
+}
diff --git a/test/libcxx/fuzzing/regex_POSIX.cpp b/test/libcxx/fuzzing/regex_POSIX.cpp
new file mode 100644
index 000000000000..f0bd28919fe5
--- /dev/null
+++ b/test/libcxx/fuzzing/regex_POSIX.cpp
@@ -0,0 +1,37 @@
+// -*- C++ -*-
+//===----------------------- regex_POSIX.cpp ------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// XFAIL
+
+#include "fuzzing.h"
+#include <cassert>
+#include <cstring> // for strlen
+
+const char * test_cases[] = {
+ "",
+ "s",
+ "b*c",
+ "ba?sf"
+ "lka*ea",
+ "adsf*kas;lnc441[0-9]1r34525234"
+ };
+
+const size_t k_num_tests = sizeof(test_cases)/sizeof(test_cases[0]);
+
+int main ()
+{
+ for (size_t i = 0; i < k_num_tests; ++i)
+ {
+ const size_t size = std::strlen(test_cases[i]);
+ const uint8_t *data = (const uint8_t *) test_cases[i];
+ assert(0 == fuzzing::regex_POSIX(data, size));
+ }
+ return 0;
+}
diff --git a/test/libcxx/fuzzing/regex_awk.cpp b/test/libcxx/fuzzing/regex_awk.cpp
new file mode 100644
index 000000000000..2e57126022f3
--- /dev/null
+++ b/test/libcxx/fuzzing/regex_awk.cpp
@@ -0,0 +1,37 @@
+// -*- C++ -*-
+//===--------------------- regex_ECMAScript.cpp ---------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// XFAIL
+
+#include "fuzzing.h"
+#include <cassert>
+#include <cstring> // for strlen
+
+const char * test_cases[] = {
+ "",
+ "s",
+ "b*c",
+ "ba?sf"
+ "lka*ea",
+ "adsf*kas;lnc441[0-9]1r34525234"
+ };
+
+const size_t k_num_tests = sizeof(test_cases)/sizeof(test_cases[0]);
+
+int main ()
+{
+ for (size_t i = 0; i < k_num_tests; ++i)
+ {
+ const size_t size = std::strlen(test_cases[i]);
+ const uint8_t *data = (const uint8_t *) test_cases[i];
+ assert(0 == fuzzing::regex_ECMAScript(data, size));
+ }
+ return 0;
+}
diff --git a/test/libcxx/fuzzing/regex_egrep.cpp b/test/libcxx/fuzzing/regex_egrep.cpp
new file mode 100644
index 000000000000..056869f5222c
--- /dev/null
+++ b/test/libcxx/fuzzing/regex_egrep.cpp
@@ -0,0 +1,37 @@
+// -*- C++ -*-
+//===------------------------ regex_egrep.cpp -----------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// XFAIL
+
+#include "fuzzing.h"
+#include <cassert>
+#include <cstring> // for strlen
+
+const char * test_cases[] = {
+ "",
+ "s",
+ "b*c",
+ "ba?sf"
+ "lka*ea",
+ "adsf*kas;lnc441[0-9]1r34525234"
+ };
+
+const size_t k_num_tests = sizeof(test_cases)/sizeof(test_cases[0]);
+
+int main ()
+{
+ for (size_t i = 0; i < k_num_tests; ++i)
+ {
+ const size_t size = std::strlen(test_cases[i]);
+ const uint8_t *data = (const uint8_t *) test_cases[i];
+ assert(0 == fuzzing::regex_egrep(data, size));
+ }
+ return 0;
+}
diff --git a/test/libcxx/fuzzing/regex_extended.cpp b/test/libcxx/fuzzing/regex_extended.cpp
new file mode 100644
index 000000000000..ac850eb5cbb4
--- /dev/null
+++ b/test/libcxx/fuzzing/regex_extended.cpp
@@ -0,0 +1,37 @@
+// -*- C++ -*-
+//===---------------------- regex_extended.cpp ----------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// XFAIL
+
+#include "fuzzing.h"
+#include <cassert>
+#include <cstring> // for strlen
+
+const char * test_cases[] = {
+ "",
+ "s",
+ "b*c",
+ "ba?sf"
+ "lka*ea",
+ "adsf*kas;lnc441[0-9]1r34525234"
+ };
+
+const size_t k_num_tests = sizeof(test_cases)/sizeof(test_cases[0]);
+
+int main ()
+{
+ for (size_t i = 0; i < k_num_tests; ++i)
+ {
+ const size_t size = std::strlen(test_cases[i]);
+ const uint8_t *data = (const uint8_t *) test_cases[i];
+ assert(0 == fuzzing::regex_extended(data, size));
+ }
+ return 0;
+}
diff --git a/test/libcxx/fuzzing/regex_grep.cpp b/test/libcxx/fuzzing/regex_grep.cpp
new file mode 100644
index 000000000000..5b1dda293dfa
--- /dev/null
+++ b/test/libcxx/fuzzing/regex_grep.cpp
@@ -0,0 +1,37 @@
+// -*- C++ -*-
+//===------------------------ regex_grep.cpp ------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// XFAIL
+
+#include "fuzzing.h"
+#include <cassert>
+#include <cstring> // for strlen
+
+const char * test_cases[] = {
+ "",
+ "s",
+ "b*c",
+ "ba?sf"
+ "lka*ea",
+ "adsf*kas;lnc441[0-9]1r34525234"
+ };
+
+const size_t k_num_tests = sizeof(test_cases)/sizeof(test_cases[0]);
+
+int main ()
+{
+ for (size_t i = 0; i < k_num_tests; ++i)
+ {
+ const size_t size = std::strlen(test_cases[i]);
+ const uint8_t *data = (const uint8_t *) test_cases[i];
+ assert(0 == fuzzing::regex_grep(data, size));
+ }
+ return 0;
+}
diff --git a/test/libcxx/fuzzing/sort.cpp b/test/libcxx/fuzzing/sort.cpp
new file mode 100644
index 000000000000..4c468948deb6
--- /dev/null
+++ b/test/libcxx/fuzzing/sort.cpp
@@ -0,0 +1,38 @@
+// -*- C++ -*-
+//===--------------------------- sort.cpp ---------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// XFAIL
+
+#include "fuzzing.h"
+#include <cassert>
+#include <cstring> // for strlen
+
+const char * test_cases[] = {
+ "",
+ "s",
+ "bac",
+ "bacasf"
+ "lkajseravea",
+ "adsfkajdsfjkas;lnc441324513,34535r34525234"
+ };
+
+const size_t k_num_tests = sizeof(test_cases)/sizeof(test_cases[0]);
+
+
+int main ()
+{
+ for (size_t i = 0; i < k_num_tests; ++i)
+ {
+ const size_t size = std::strlen(test_cases[i]);
+ const uint8_t *data = (const uint8_t *) test_cases[i];
+ assert(0 == fuzzing::sort(data, size));
+ }
+ return 0;
+}
diff --git a/test/libcxx/fuzzing/stable_partition.cpp b/test/libcxx/fuzzing/stable_partition.cpp
new file mode 100644
index 000000000000..c21e6489049c
--- /dev/null
+++ b/test/libcxx/fuzzing/stable_partition.cpp
@@ -0,0 +1,38 @@
+// -*- C++ -*-
+//===--------------------- stable_partition.cpp ---------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// XFAIL
+
+#include "fuzzing.h"
+#include <cassert>
+#include <cstring> // for strlen
+
+const char * test_cases[] = {
+ "",
+ "s",
+ "bac",
+ "bacasf"
+ "lkajseravea",
+ "adsfkajdsfjkas;lnc441324513,34535r34525234"
+ };
+
+const size_t k_num_tests = sizeof(test_cases)/sizeof(test_cases[0]);
+
+
+int main ()
+{
+ for (size_t i = 0; i < k_num_tests; ++i)
+ {
+ const size_t size = std::strlen(test_cases[i]);
+ const uint8_t *data = (const uint8_t *) test_cases[i];
+ assert(0 == fuzzing::stable_partition(data, size));
+ }
+ return 0;
+}
diff --git a/test/libcxx/fuzzing/stable_sort.cpp b/test/libcxx/fuzzing/stable_sort.cpp
new file mode 100644
index 000000000000..1a7bbb9528e2
--- /dev/null
+++ b/test/libcxx/fuzzing/stable_sort.cpp
@@ -0,0 +1,38 @@
+// -*- C++ -*-
+//===------------------------ stable_sort.cpp ----------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// XFAIL
+
+#include "fuzzing.h"
+#include <cassert>
+#include <cstring> // for strlen
+
+const char * test_cases[] = {
+ "",
+ "s",
+ "bac",
+ "bacasf"
+ "lkajseravea",
+ "adsfkajdsfjkas;lnc441324513,34535r34525234"
+ };
+
+const size_t k_num_tests = sizeof(test_cases)/sizeof(test_cases[0]);
+
+
+int main ()
+{
+ for (size_t i = 0; i < k_num_tests; ++i)
+ {
+ const size_t size = std::strlen(test_cases[i]);
+ const uint8_t *data = (const uint8_t *) test_cases[i];
+ assert(0 == fuzzing::stable_sort(data, size));
+ }
+ return 0;
+}
diff --git a/test/libcxx/fuzzing/unique.cpp b/test/libcxx/fuzzing/unique.cpp
new file mode 100644
index 000000000000..4bfa25a2b5c1
--- /dev/null
+++ b/test/libcxx/fuzzing/unique.cpp
@@ -0,0 +1,38 @@
+// -*- C++ -*-
+//===--------------------------- unique.cpp -------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// XFAIL
+
+#include "fuzzing.h"
+#include <cassert>
+#include <cstring> // for strlen
+
+const char * test_cases[] = {
+ "",
+ "s",
+ "bac",
+ "bacasf"
+ "lkajseravea",
+ "adsfkajdsfjkas;lnc441324513,34535r34525234"
+ };
+
+const size_t k_num_tests = sizeof(test_cases)/sizeof(test_cases[0]);
+
+
+int main ()
+{
+ for (size_t i = 0; i < k_num_tests; ++i)
+ {
+ const size_t size = std::strlen(test_cases[i]);
+ const uint8_t *data = (const uint8_t *) test_cases[i];
+ assert(0 == fuzzing::unique(data, size));
+ }
+ return 0;
+}
diff --git a/test/libcxx/fuzzing/unique_copy.cpp b/test/libcxx/fuzzing/unique_copy.cpp
new file mode 100644
index 000000000000..ed6fc7ea5513
--- /dev/null
+++ b/test/libcxx/fuzzing/unique_copy.cpp
@@ -0,0 +1,38 @@
+// -*- C++ -*-
+//===------------------------ unique_copy.cpp -----------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// XFAIL
+
+#include "fuzzing.h"
+#include <cassert>
+#include <cstring> // for strlen
+
+const char * test_cases[] = {
+ "",
+ "s",
+ "bac",
+ "bacasf"
+ "lkajseravea",
+ "adsfkajdsfjkas;lnc441324513,34535r34525234"
+ };
+
+const size_t k_num_tests = sizeof(test_cases)/sizeof(test_cases[0]);
+
+
+int main ()
+{
+ for (size_t i = 0; i < k_num_tests; ++i)
+ {
+ const size_t size = std::strlen(test_cases[i]);
+ const uint8_t *data = (const uint8_t *) test_cases[i];
+ assert(0 == fuzzing::unique_copy(data, size));
+ }
+ return 0;
+}