summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Fuzzer/test/LeakTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Fuzzer/test/LeakTest.cpp')
-rw-r--r--llvm/lib/Fuzzer/test/LeakTest.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/llvm/lib/Fuzzer/test/LeakTest.cpp b/llvm/lib/Fuzzer/test/LeakTest.cpp
new file mode 100644
index 00000000000..7d153e45691
--- /dev/null
+++ b/llvm/lib/Fuzzer/test/LeakTest.cpp
@@ -0,0 +1,11 @@
+// Test with a leak.
+#include <cstdint>
+#include <cstddef>
+
+static volatile void *Sink;
+
+extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
+ Sink = new int;
+ return 0;
+}
+
OpenPOWER on IntegriCloud