12946cd70SChandler Carruth // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
22946cd70SChandler Carruth // See https://llvm.org/LICENSE.txt for license information.
32946cd70SChandler Carruth // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
428fe54faSKostya Serebryany 
528fe54faSKostya Serebryany // When tracing data flow, explode the number of DFSan labels.
628fe54faSKostya Serebryany #include <cstddef>
728fe54faSKostya Serebryany #include <cstdint>
828fe54faSKostya Serebryany 
928fe54faSKostya Serebryany static volatile int sink;
1028fe54faSKostya Serebryany 
1128fe54faSKostya Serebryany __attribute__((noinline))
f(uint8_t a,uint8_t b,uint8_t c,uint8_t d)1228fe54faSKostya Serebryany void f(uint8_t a, uint8_t b, uint8_t c, uint8_t d) {
1328fe54faSKostya Serebryany   if (a == b + 1 && c == d + 2)
1428fe54faSKostya Serebryany     sink++;
15*ae667c49SKostya Serebryany   if (a == d + 1 && c == b + 2)
16*ae667c49SKostya Serebryany     sink++;
1728fe54faSKostya Serebryany }
1828fe54faSKostya Serebryany 
LLVMFuzzerTestOneInput(const uint8_t * Data,size_t Size)1928fe54faSKostya Serebryany extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
2028fe54faSKostya Serebryany   for (size_t a = 0; a < Size; a++)
2128fe54faSKostya Serebryany     for (size_t b = 0; b < Size; b++)
2228fe54faSKostya Serebryany       for (size_t c = 0; c < Size; c++)
2328fe54faSKostya Serebryany         for (size_t d = 0; d < Size; d++)
2428fe54faSKostya Serebryany           f(Data[a], Data[b], Data[c], Data[d]);
2528fe54faSKostya Serebryany   return 0;
2628fe54faSKostya Serebryany }
27