1 // This file is distributed under the University of Illinois Open Source
2 // License. See LICENSE.TXT for details.
4 // Simple test for a fuzzer. The fuzzer must find the interesting switch value.
13 case 100001: return 1;
14 case 100002: return 2;
15 case 100003: return 4;
20 extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
22 if (Size < N * sizeof(int)) return 0;
24 for (int i = 0; i < N; i++) {
26 memcpy(&X, Data + i * sizeof(int), sizeof(int));
29 if (Res == 5 || Res == 3 || Res == 6 || Res == 7) {
30 fprintf(stderr, "BINGO; Found the target, exiting; Res=%d\n", Res);