1 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
2 // See https://llvm.org/LICENSE.txt for license information.
3 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
5 // Source code for a simple DSO.
11 extern int DSO1(int a
);
12 extern int DSO2(int a
);
13 extern int DSOTestExtra(int a
);
15 static volatile int *nil
= 0;
17 extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data
, size_t Size
) {
19 if (Size
< sizeof(int) * 3) {
22 memcpy(&x
, Data
+ 0 * sizeof(int), sizeof(int));
23 memcpy(&y
, Data
+ 1 * sizeof(int), sizeof(int));
24 memcpy(&z
, Data
+ 2 * sizeof(int), sizeof(int));
26 int sum
= DSO1(x
) + DSO2(y
) + (z
? DSOTestExtra(z
) : 0);
28 fprintf(stderr
, "BINGO %d %d %d\n", x
, y
, z
);