xref: /llvm-project/compiler-rt/test/fuzzer/SleepOneSecondTest.cpp (revision 2946cd701067404b99c39fb29dc9c74bd7193eb3)
1*2946cd70SChandler Carruth // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
2*2946cd70SChandler Carruth // See https://llvm.org/LICENSE.txt for license information.
3*2946cd70SChandler Carruth // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
4a2ca2dccSKostya Serebryany 
5a2ca2dccSKostya Serebryany // Simple test for a fuzzer: it simply sleeps for 1 second.
6a2ca2dccSKostya Serebryany #include <cstddef>
7a2ca2dccSKostya Serebryany #include <cstdint>
8a2ca2dccSKostya Serebryany #include <thread>
9a2ca2dccSKostya Serebryany 
LLVMFuzzerTestOneInput(const uint8_t * Data,size_t Size)10a2ca2dccSKostya Serebryany extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
11a2ca2dccSKostya Serebryany   std::this_thread::sleep_for(std::chrono::seconds(1));
12a2ca2dccSKostya Serebryany   return 0;
13a2ca2dccSKostya Serebryany }
14a2ca2dccSKostya Serebryany 
15