blob: 64103e59007d032ca0143451ea032d41a9cfb5f8 [file] [log] [blame]
Marshall Clowbaa6fb32017-10-04 22:23:03 +00001// -*- C++ -*-
2//===-------------------------- fuzzing.h --------------------------------===//
3//
Chandler Carruthd2012102019-01-19 10:56:40 +00004// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5// See https://llvm.org/LICENSE.txt for license information.
6// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
Marshall Clowbaa6fb32017-10-04 22:23:03 +00007//
8//===----------------------------------------------------------------------===//
9
10#ifndef _LIBCPP_FUZZING
11#define _LIBCPP_FUZZING
12
13#include <cstddef> // for size_t
14#include <cstdint> // for uint8_t
15
16namespace fuzzing {
17
Marshall Clowa97ab842017-10-23 23:19:30 +000018// These all return 0 on success; != 0 on failure
19 int sort (const uint8_t *data, size_t size);
20 int stable_sort (const uint8_t *data, size_t size);
21 int partition (const uint8_t *data, size_t size);
Marshall Clow974677c2017-10-30 19:51:58 +000022 int partition_copy (const uint8_t *data, size_t size);
Marshall Clowa97ab842017-10-23 23:19:30 +000023 int stable_partition (const uint8_t *data, size_t size);
Marshall Clow974677c2017-10-30 19:51:58 +000024 int unique (const uint8_t *data, size_t size);
25 int unique_copy (const uint8_t *data, size_t size);
Marshall Clowbaa6fb32017-10-04 22:23:03 +000026
Marshall Clowa97ab842017-10-23 23:19:30 +000027// partition and stable_partition take Bi-Di iterators.
28// Should test those, too
Marshall Clow974677c2017-10-30 19:51:58 +000029 int nth_element (const uint8_t *data, size_t size);
30 int partial_sort (const uint8_t *data, size_t size);
31 int partial_sort_copy (const uint8_t *data, size_t size);
Marshall Clowbaa6fb32017-10-04 22:23:03 +000032
Marshall Clowa97ab842017-10-23 23:19:30 +000033// Heap operations
34 int make_heap (const uint8_t *data, size_t size);
35 int push_heap (const uint8_t *data, size_t size);
36 int pop_heap (const uint8_t *data, size_t size);
Marshall Clowd84736b2017-10-12 14:48:09 +000037
Marshall Clowa97ab842017-10-23 23:19:30 +000038// Various flavors of regex
39 int regex_ECMAScript (const uint8_t *data, size_t size);
40 int regex_POSIX (const uint8_t *data, size_t size);
41 int regex_extended (const uint8_t *data, size_t size);
42 int regex_awk (const uint8_t *data, size_t size);
43 int regex_grep (const uint8_t *data, size_t size);
44 int regex_egrep (const uint8_t *data, size_t size);
45
46// Searching
47 int search (const uint8_t *data, size_t size);
48// int search_boyer_moore (const uint8_t *data, size_t size);
49// int search_boyer_moore_horspool (const uint8_t *data, size_t size);
Marshall Clowd84736b2017-10-12 14:48:09 +000050
Marshall Clow974677c2017-10-30 19:51:58 +000051// Set operations
52// int includes (const uint8_t *data, size_t size);
53// int set_union (const uint8_t *data, size_t size);
54// int set_intersection (const uint8_t *data, size_t size);
55// int set_difference (const uint8_t *data, size_t size);
56// int set_symmetric_difference (const uint8_t *data, size_t size);
57// int merge (const uint8_t *data, size_t size);
58
Marshall Clowbaa6fb32017-10-04 22:23:03 +000059} // namespace fuzzing
60
61#endif // _LIBCPP_FUZZING