150
|
1 // -*- C++ -*-
|
|
2 //===-------------------------- fuzzing.h --------------------------------===//
|
|
3 //
|
|
4 // 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
|
|
7 //
|
|
8 //===----------------------------------------------------------------------===//
|
|
9
|
|
10 #ifndef _LIBCPP_FUZZING
|
|
11 #define _LIBCPP_FUZZING
|
|
12
|
|
13 #include <cstddef> // for size_t
|
|
14 #include <cstdint> // for uint8_t
|
|
15
|
|
16 namespace fuzzing {
|
|
17
|
|
18 // 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);
|
|
22 int partition_copy (const uint8_t *data, size_t size);
|
|
23 int stable_partition (const uint8_t *data, size_t size);
|
|
24 int unique (const uint8_t *data, size_t size);
|
|
25 int unique_copy (const uint8_t *data, size_t size);
|
|
26
|
|
27 // partition and stable_partition take Bi-Di iterators.
|
|
28 // Should test those, too
|
|
29 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);
|
|
32
|
|
33 // 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);
|
|
37
|
|
38 // 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);
|
|
50
|
|
51 // 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
|
|
59 // Random numbers
|
|
60 int uniform_int_distribution(const uint8_t*, size_t);
|
|
61 int uniform_real_distribution(const uint8_t*, size_t);
|
|
62 int bernoulli_distribution(const uint8_t*, size_t);
|
|
63 int poisson_distribution(const uint8_t*, size_t);
|
|
64 int geometric_distribution(const uint8_t*, size_t);
|
|
65 int binomial_distribution(const uint8_t*, size_t);
|
|
66 int negative_binomial_distribution(const uint8_t*, size_t);
|
|
67 int exponential_distribution(const uint8_t*, size_t);
|
|
68 int gamma_distribution(const uint8_t*, size_t);
|
|
69 int weibull_distribution(const uint8_t*, size_t);
|
|
70 int extreme_value_distribution(const uint8_t*, size_t);
|
|
71 int normal_distribution(const uint8_t*, size_t);
|
|
72 int lognormal_distribution(const uint8_t*, size_t);
|
|
73 int chi_squared_distribution(const uint8_t*, size_t);
|
|
74 int cauchy_distribution(const uint8_t*, size_t);
|
|
75 int fisher_f_distribution(const uint8_t*, size_t);
|
|
76 int student_t_distribution(const uint8_t*, size_t);
|
|
77 int discrete_distribution(const uint8_t*, size_t);
|
|
78 int piecewise_constant_distribution(const uint8_t*, size_t);
|
|
79 int piecewise_linear_distribution(const uint8_t*, size_t);
|
|
80
|
|
81 } // namespace fuzzing
|
|
82
|
|
83 #endif // _LIBCPP_FUZZING
|