aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-08-27 18:19:53 +0000
committerChris Lattner <sabre@nondot.org>2003-08-27 18:19:53 +0000
commit2917ea11c34a4036a4add814a6b8489ece347f2e (patch)
tree21bee89d874982494722fcde625f5c0b25e04371
parentd04087cce67de5f5c2cb490a2ef673c66e5cb89d (diff)
downloadexternal_llvm-2917ea11c34a4036a4add814a6b8489ece347f2e.zip
external_llvm-2917ea11c34a4036a4add814a6b8489ece347f2e.tar.gz
external_llvm-2917ea11c34a4036a4add814a6b8489ece347f2e.tar.bz2
New testcase. Unfortunately, native GCC gets this wrong. Someday we will have to figure out how to deal with this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8162 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--test/C++Frontend/EH/copy_ctor_throw.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/C++Frontend/EH/copy_ctor_throw.cpp b/test/C++Frontend/EH/copy_ctor_throw.cpp
new file mode 100644
index 0000000..1c50984
--- /dev/null
+++ b/test/C++Frontend/EH/copy_ctor_throw.cpp
@@ -0,0 +1,25 @@
+/* Test for throwing an exception from the copy ctor of the exception object
+ * invoked while building an exception.
+ */
+#include <stdio.h>
+
+struct foo {
+ foo() {}
+ foo(const foo &F) { throw 1; }
+};
+
+int main() {
+ try {
+ foo f;
+ throw f;
+ } catch (int i) {
+ printf("Success!\n");
+ return 0;
+ } catch (foo &f) {
+ printf("Failure: caught a foo!\n");
+ return 1;
+ } catch (...) {
+ printf("Failure: caught something else!\n");
+ return 1;
+ }
+}