annotate libcxx/fuzzing/fuzzing.h @ 150:1d019706d866

LLVM10
author anatofuz
date Thu, 13 Feb 2020 15:10:13 +0900
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 // -*- C++ -*-
anatofuz
parents:
diff changeset
2 //===-------------------------- fuzzing.h --------------------------------===//
anatofuz
parents:
diff changeset
3 //
anatofuz
parents:
diff changeset
4 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
anatofuz
parents:
diff changeset
5 // See https://llvm.org/LICENSE.txt for license information.
anatofuz
parents:
diff changeset
6 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
anatofuz
parents:
diff changeset
7 //
anatofuz
parents:
diff changeset
8 //===----------------------------------------------------------------------===//
anatofuz
parents:
diff changeset
9
anatofuz
parents:
diff changeset
10 #ifndef _LIBCPP_FUZZING
anatofuz
parents:
diff changeset
11 #define _LIBCPP_FUZZING
anatofuz
parents:
diff changeset
12
anatofuz
parents:
diff changeset
13 #include <cstddef> // for size_t
anatofuz
parents:
diff changeset
14 #include <cstdint> // for uint8_t
anatofuz
parents:
diff changeset
15
anatofuz
parents:
diff changeset
16 namespace fuzzing {
anatofuz
parents:
diff changeset
17
anatofuz
parents:
diff changeset
18 // These all return 0 on success; != 0 on failure
anatofuz
parents:
diff changeset
19 int sort (const uint8_t *data, size_t size);
anatofuz
parents:
diff changeset
20 int stable_sort (const uint8_t *data, size_t size);
anatofuz
parents:
diff changeset
21 int partition (const uint8_t *data, size_t size);
anatofuz
parents:
diff changeset
22 int partition_copy (const uint8_t *data, size_t size);
anatofuz
parents:
diff changeset
23 int stable_partition (const uint8_t *data, size_t size);
anatofuz
parents:
diff changeset
24 int unique (const uint8_t *data, size_t size);
anatofuz
parents:
diff changeset
25 int unique_copy (const uint8_t *data, size_t size);
anatofuz
parents:
diff changeset
26
anatofuz
parents:
diff changeset
27 // partition and stable_partition take Bi-Di iterators.
anatofuz
parents:
diff changeset
28 // Should test those, too
anatofuz
parents:
diff changeset
29 int nth_element (const uint8_t *data, size_t size);
anatofuz
parents:
diff changeset
30 int partial_sort (const uint8_t *data, size_t size);
anatofuz
parents:
diff changeset
31 int partial_sort_copy (const uint8_t *data, size_t size);
anatofuz
parents:
diff changeset
32
anatofuz
parents:
diff changeset
33 // Heap operations
anatofuz
parents:
diff changeset
34 int make_heap (const uint8_t *data, size_t size);
anatofuz
parents:
diff changeset
35 int push_heap (const uint8_t *data, size_t size);
anatofuz
parents:
diff changeset
36 int pop_heap (const uint8_t *data, size_t size);
anatofuz
parents:
diff changeset
37
anatofuz
parents:
diff changeset
38 // Various flavors of regex
anatofuz
parents:
diff changeset
39 int regex_ECMAScript (const uint8_t *data, size_t size);
anatofuz
parents:
diff changeset
40 int regex_POSIX (const uint8_t *data, size_t size);
anatofuz
parents:
diff changeset
41 int regex_extended (const uint8_t *data, size_t size);
anatofuz
parents:
diff changeset
42 int regex_awk (const uint8_t *data, size_t size);
anatofuz
parents:
diff changeset
43 int regex_grep (const uint8_t *data, size_t size);
anatofuz
parents:
diff changeset
44 int regex_egrep (const uint8_t *data, size_t size);
anatofuz
parents:
diff changeset
45
anatofuz
parents:
diff changeset
46 // Searching
anatofuz
parents:
diff changeset
47 int search (const uint8_t *data, size_t size);
anatofuz
parents:
diff changeset
48 // int search_boyer_moore (const uint8_t *data, size_t size);
anatofuz
parents:
diff changeset
49 // int search_boyer_moore_horspool (const uint8_t *data, size_t size);
anatofuz
parents:
diff changeset
50
anatofuz
parents:
diff changeset
51 // Set operations
anatofuz
parents:
diff changeset
52 // int includes (const uint8_t *data, size_t size);
anatofuz
parents:
diff changeset
53 // int set_union (const uint8_t *data, size_t size);
anatofuz
parents:
diff changeset
54 // int set_intersection (const uint8_t *data, size_t size);
anatofuz
parents:
diff changeset
55 // int set_difference (const uint8_t *data, size_t size);
anatofuz
parents:
diff changeset
56 // int set_symmetric_difference (const uint8_t *data, size_t size);
anatofuz
parents:
diff changeset
57 // int merge (const uint8_t *data, size_t size);
anatofuz
parents:
diff changeset
58
anatofuz
parents:
diff changeset
59 // Random numbers
anatofuz
parents:
diff changeset
60 int uniform_int_distribution(const uint8_t*, size_t);
anatofuz
parents:
diff changeset
61 int uniform_real_distribution(const uint8_t*, size_t);
anatofuz
parents:
diff changeset
62 int bernoulli_distribution(const uint8_t*, size_t);
anatofuz
parents:
diff changeset
63 int poisson_distribution(const uint8_t*, size_t);
anatofuz
parents:
diff changeset
64 int geometric_distribution(const uint8_t*, size_t);
anatofuz
parents:
diff changeset
65 int binomial_distribution(const uint8_t*, size_t);
anatofuz
parents:
diff changeset
66 int negative_binomial_distribution(const uint8_t*, size_t);
anatofuz
parents:
diff changeset
67 int exponential_distribution(const uint8_t*, size_t);
anatofuz
parents:
diff changeset
68 int gamma_distribution(const uint8_t*, size_t);
anatofuz
parents:
diff changeset
69 int weibull_distribution(const uint8_t*, size_t);
anatofuz
parents:
diff changeset
70 int extreme_value_distribution(const uint8_t*, size_t);
anatofuz
parents:
diff changeset
71 int normal_distribution(const uint8_t*, size_t);
anatofuz
parents:
diff changeset
72 int lognormal_distribution(const uint8_t*, size_t);
anatofuz
parents:
diff changeset
73 int chi_squared_distribution(const uint8_t*, size_t);
anatofuz
parents:
diff changeset
74 int cauchy_distribution(const uint8_t*, size_t);
anatofuz
parents:
diff changeset
75 int fisher_f_distribution(const uint8_t*, size_t);
anatofuz
parents:
diff changeset
76 int student_t_distribution(const uint8_t*, size_t);
anatofuz
parents:
diff changeset
77 int discrete_distribution(const uint8_t*, size_t);
anatofuz
parents:
diff changeset
78 int piecewise_constant_distribution(const uint8_t*, size_t);
anatofuz
parents:
diff changeset
79 int piecewise_linear_distribution(const uint8_t*, size_t);
anatofuz
parents:
diff changeset
80
anatofuz
parents:
diff changeset
81 } // namespace fuzzing
anatofuz
parents:
diff changeset
82
anatofuz
parents:
diff changeset
83 #endif // _LIBCPP_FUZZING