about summary refs log tree commit diff homepage
path: root/test/CXX/symex/libc++/rethrow.cpp
blob: 149fe693d54d07f3e20edbecd1d76f946890340d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// REQUIRES: uclibc
// REQUIRES: libcxx
// REQUIRES: eh-cxx
// 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;
}