about summary refs log tree commit diff homepage
path: root/test
diff options
context:
space:
mode:
authorLukas Wölfer <lukas.woelfer@rwth-aachen.de>2018-06-02 19:45:58 +0200
committerCristian Cadar <c.cadar@imperial.ac.uk>2018-11-05 20:14:07 +0000
commit548e51daca5d53127b1ba5988048a23b8cd6c17b (patch)
tree39ffbe7b3eb752fcce2717c5f220240ccd633c8f /test
parentea2b756666fa60b47efe16510d81c3b29beab4df (diff)
downloadklee-548e51daca5d53127b1ba5988048a23b8cd6c17b.tar.gz
Fixed crash on zero size arrays
Diffstat (limited to 'test')
-rw-r--r--test/CXX/LandingPad.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/CXX/LandingPad.cpp b/test/CXX/LandingPad.cpp
new file mode 100644
index 00000000..1b0c0f30
--- /dev/null
+++ b/test/CXX/LandingPad.cpp
@@ -0,0 +1,19 @@
+// RUN: %llvmgxx %s -emit-llvm -c -o %t1.bc
+// RUN: rm -rf %t.klee-out
+// RUN: klee --output-dir=%t.klee-out %t1.bc 2>&1 | FileCheck %s
+
+// CHECK: Using zero size array fix for landingpad instruction filter
+
+// Check that the zero size array in the landing pad filter does not crash KLEE
+int p() throw() { throw 'a'; }
+int main(int argc, char **) {
+  if (argc < 3) {
+    return 0;
+  }
+
+  try {
+    return p();
+  } catch (...) {
+    return 1;
+  }
+}