about summary refs log tree commit diff homepage
path: root/test/CXX/symex/libc++/rethrow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/CXX/symex/libc++/rethrow.cpp')
-rw-r--r--test/CXX/symex/libc++/rethrow.cpp35
1 files changed, 35 insertions, 0 deletions
diff --git a/test/CXX/symex/libc++/rethrow.cpp b/test/CXX/symex/libc++/rethrow.cpp
new file mode 100644
index 00000000..d6a0954d
--- /dev/null
+++ b/test/CXX/symex/libc++/rethrow.cpp
@@ -0,0 +1,35 @@
+// REQUIRES: uclibc
+// REQUIRES: libcxx
+// RUN: %clangxx %s -emit-llvm %O0opt -std=c++11 -c -I "%libcxx_include" -g -nostdinc++ -o %t.bc
+// RUN: rm -rf %t.klee-out
+// RUN: %klee --output-dir=%t.klee-out --exit-on-error --libcxx --libc=uclibc %t.bc 2>&1 | FileCheck %s
+
+#include <cstdio>
+
+class TestClass {
+public:
+  virtual ~TestClass() {}
+};
+
+class DerivedClass : public TestClass {
+};
+
+class SecondDerivedClass : public DerivedClass {
+};
+
+int main(int argc, char **args) {
+  try {
+    try {
+      throw SecondDerivedClass();
+    } catch (DerivedClass &p) {
+      puts("DerivedClass caught\n");
+      // CHECK: DerivedClass caught
+      throw;
+    }
+  } catch (TestClass &tc) {
+    puts("TestClass caught\n");
+    // CHECK: TestClass caught
+  }
+
+  return 0;
+}