Marshall Clow | 29ae2ba | 2017-10-04 22:23:03 +0000 | [diff] [blame] | 1 | // -*- 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 | |
| 17 | namespace fuzzing { |
| 18 | |
Marshall Clow | f45f32b | 2017-10-23 23:19:30 +0000 | [diff] [blame] | 19 | // 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); |
Marshall Clow | 772a6d4 | 2017-10-30 19:51:58 +0000 | [diff] [blame] | 23 | int partition_copy (const uint8_t *data, size_t size); |
Marshall Clow | f45f32b | 2017-10-23 23:19:30 +0000 | [diff] [blame] | 24 | int stable_partition (const uint8_t *data, size_t size); |
Marshall Clow | 772a6d4 | 2017-10-30 19:51:58 +0000 | [diff] [blame] | 25 | int unique (const uint8_t *data, size_t size); |
| 26 | int unique_copy (const uint8_t *data, size_t size); |
Marshall Clow | 29ae2ba | 2017-10-04 22:23:03 +0000 | [diff] [blame] | 27 | |
Marshall Clow | f45f32b | 2017-10-23 23:19:30 +0000 | [diff] [blame] | 28 | // partition and stable_partition take Bi-Di iterators. |
| 29 | // Should test those, too |
Marshall Clow | 772a6d4 | 2017-10-30 19:51:58 +0000 | [diff] [blame] | 30 | int nth_element (const uint8_t *data, size_t size); |
| 31 | int partial_sort (const uint8_t *data, size_t size); |
| 32 | int partial_sort_copy (const uint8_t *data, size_t size); |
Marshall Clow | 29ae2ba | 2017-10-04 22:23:03 +0000 | [diff] [blame] | 33 | |
Marshall Clow | f45f32b | 2017-10-23 23:19:30 +0000 | [diff] [blame] | 34 | // Heap operations |
| 35 | int make_heap (const uint8_t *data, size_t size); |
| 36 | int push_heap (const uint8_t *data, size_t size); |
| 37 | int pop_heap (const uint8_t *data, size_t size); |
Marshall Clow | c85f85a | 2017-10-12 14:48:09 +0000 | [diff] [blame] | 38 | |
Marshall Clow | f45f32b | 2017-10-23 23:19:30 +0000 | [diff] [blame] | 39 | // Various flavors of regex |
| 40 | int regex_ECMAScript (const uint8_t *data, size_t size); |
| 41 | int regex_POSIX (const uint8_t *data, size_t size); |
| 42 | int regex_extended (const uint8_t *data, size_t size); |
| 43 | int regex_awk (const uint8_t *data, size_t size); |
| 44 | int regex_grep (const uint8_t *data, size_t size); |
| 45 | int regex_egrep (const uint8_t *data, size_t size); |
| 46 | |
| 47 | // Searching |
| 48 | int search (const uint8_t *data, size_t size); |
| 49 | // int search_boyer_moore (const uint8_t *data, size_t size); |
| 50 | // int search_boyer_moore_horspool (const uint8_t *data, size_t size); |
Marshall Clow | c85f85a | 2017-10-12 14:48:09 +0000 | [diff] [blame] | 51 | |
Marshall Clow | 772a6d4 | 2017-10-30 19:51:58 +0000 | [diff] [blame] | 52 | // Set operations |
| 53 | // int includes (const uint8_t *data, size_t size); |
| 54 | // int set_union (const uint8_t *data, size_t size); |
| 55 | // int set_intersection (const uint8_t *data, size_t size); |
| 56 | // int set_difference (const uint8_t *data, size_t size); |
| 57 | // int set_symmetric_difference (const uint8_t *data, size_t size); |
| 58 | // int merge (const uint8_t *data, size_t size); |
| 59 | |
Marshall Clow | 29ae2ba | 2017-10-04 22:23:03 +0000 | [diff] [blame] | 60 | } // namespace fuzzing |
| 61 | |
| 62 | #endif // _LIBCPP_FUZZING |