about summary refs log tree commit diff homepage
path: root/test/DeterministicAllocation/nullpage-write.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/DeterministicAllocation/nullpage-write.c')
-rw-r--r--test/DeterministicAllocation/nullpage-write.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/DeterministicAllocation/nullpage-write.c b/test/DeterministicAllocation/nullpage-write.c
new file mode 100644
index 00000000..950e2e17
--- /dev/null
+++ b/test/DeterministicAllocation/nullpage-write.c
@@ -0,0 +1,19 @@
+// RUN: %clang %s -emit-llvm -g -c -o %t.bc
+// RUN: rm -rf %t.klee-out
+// RUN: %klee -kdalloc -kdalloc-quarantine=1 -output-dir=%t.klee-out %t.bc -exit-on-error >%t.output 2>&1
+// RUN: FileCheck %s -input-file=%t.output
+
+#include <stdlib.h>
+#include <string.h>
+
+int main() {
+  struct {
+    int x;
+    int y;
+  } *ptr = NULL;
+
+  // CHECK: null page access
+  memset(&ptr->y, 0, sizeof(ptr->y));
+
+  return 0;
+}