Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / compiler-rt / test / fuzzer / UseAfterDtor.cpp
blobdcefca5cc7d58ae7f8fdf2c46b67757b2e8b05d3
1 #include <cstdint>
2 #include <cstdio>
4 struct Simple {
5 int x_;
6 Simple() {
7 x_ = 5;
9 ~Simple() {
10 x_ += 1;
14 Simple *volatile SimpleSink;
16 extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
17 if (Size < 4) return 0;
18 if (Data[0] == 'F' && Data[1] == 'U' && Data[2] == 'Z' && Data[3] == 'Z') {
20 Simple S;
21 SimpleSink = &S;
23 if (SimpleSink->x_) fprintf(stderr, "Failed to catch use-after-dtor\n");
25 return 0;