The compiler generates a 'brk' instruction for __builtin_trap on aarch64
and Linux kernel issues a SIGTRAP. It is different from x86, where
compiler emits an 'ud2' and kernel issues a SIGILL.
A straightforward is to use abort instead.
llvm-svn: 359126
// Test that fuzzer we can reload artifacts with any bytes inside.
#include <algorithm>
#include <cstdint>
+#include <cstdlib>
#include <numeric>
#include <set>
-#include <stdio.h>
extern "C" size_t LLVMFuzzerCustomMutator(uint8_t *Data, size_t Size,
size_t MaxSize, unsigned int Seed) {
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
if (Size > 5000 && std::set<uint8_t>(Data, Data + Size).size() > 255 &&
(uint8_t)std::accumulate(Data, Data + Size, uint8_t(Size)) == 0)
- __builtin_trap();
+ abort();
return 0;
}