blob: 6093c32c2262337c7d9278ad987e02773a63a615 [file] [log] [blame]
Marshall Clow29ae2ba2017-10-04 22:23:03 +00001// -*- C++ -*-
2//===-------------------------- fuzzing.h --------------------------------===//
3//
4// The LLVM Compiler Infrastructure
5//
6// This file is dual licensed under the MIT and the University of Illinois Open
7// Source Licenses. See LICENSE.TXT for details.
8//
9//===----------------------------------------------------------------------===//
10
11#ifndef _LIBCPP_FUZZING
12#define _LIBCPP_FUZZING
13
14#include <cstddef> // for size_t
15#include <cstdint> // for uint8_t
16
17namespace fuzzing {
18
Marshall Clowf45f32b2017-10-23 23:19:30 +000019// These all return 0 on success; != 0 on failure
20 int sort (const uint8_t *data, size_t size);
21 int stable_sort (const uint8_t *data, size_t size);
22 int partition (const uint8_t *data, size_t size);
23 int stable_partition (const uint8_t *data, size_t size);
Marshall Clow29ae2ba2017-10-04 22:23:03 +000024
Marshall Clowf45f32b2017-10-23 23:19:30 +000025// partition and stable_partition take Bi-Di iterators.
26// Should test those, too
27 int nth_element (const uint8_t *data, size_t size);
28 int partial_sort (const uint8_t *data, size_t size);
Marshall Clow29ae2ba2017-10-04 22:23:03 +000029
Marshall Clowf45f32b2017-10-23 23:19:30 +000030// Heap operations
31 int make_heap (const uint8_t *data, size_t size);
32 int push_heap (const uint8_t *data, size_t size);
33 int pop_heap (const uint8_t *data, size_t size);
Marshall Clowc85f85a2017-10-12 14:48:09 +000034
Marshall Clowf45f32b2017-10-23 23:19:30 +000035// Various flavors of regex
36 int regex_ECMAScript (const uint8_t *data, size_t size);
37 int regex_POSIX (const uint8_t *data, size_t size);
38 int regex_extended (const uint8_t *data, size_t size);
39 int regex_awk (const uint8_t *data, size_t size);
40 int regex_grep (const uint8_t *data, size_t size);
41 int regex_egrep (const uint8_t *data, size_t size);
42
43// Searching
44 int search (const uint8_t *data, size_t size);
45// int search_boyer_moore (const uint8_t *data, size_t size);
46// int search_boyer_moore_horspool (const uint8_t *data, size_t size);
Marshall Clowc85f85a2017-10-12 14:48:09 +000047
Marshall Clow29ae2ba2017-10-04 22:23:03 +000048} // namespace fuzzing
49
50#endif // _LIBCPP_FUZZING