summaryrefslogtreecommitdiffstats
path: root/test/CodeGenCXX/eh.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2010-07-07 06:56:46 +0000
committerJohn McCall <rjmccall@apple.com>2010-07-07 06:56:46 +0000
commit59a7000a79118e4c140885ccbb2ac6a686a73092 (patch)
tree803331196f70138a85888e168a5ce1721c6c425b /test/CodeGenCXX/eh.cpp
parent8b5dec3002bd3e17061a8bf1fc35ba82912ec768 (diff)
Teach function-try-blocks on constructors and destructors to implicitly
rethrow. Fixes rdar://problem/7696603 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107757 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/eh.cpp')
-rw-r--r--test/CodeGenCXX/eh.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/test/CodeGenCXX/eh.cpp b/test/CodeGenCXX/eh.cpp
index 4d0955877d..d03dc91715 100644
--- a/test/CodeGenCXX/eh.cpp
+++ b/test/CodeGenCXX/eh.cpp
@@ -193,3 +193,30 @@ namespace test8 {
}
}
}
+
+// Constructor function-try-block must rethrow on fallthrough.
+// rdar://problem/7696603
+namespace test9 {
+ void opaque();
+
+ struct A { A(); };
+
+ // CHECK: define void @_ZN5test91AC1Ev
+ // CHECK: call void @_ZN5test91AC2Ev
+ // CHECK-NEXT: ret void
+
+ // CHECK: define void @_ZN5test91AC2Ev(
+ A::A() try {
+ // CHECK: invoke void @_ZN5test96opaqueEv()
+ opaque();
+ } catch (int x) {
+ // CHECK: call i8* @__cxa_begin_catch
+ // CHECK: invoke void @_ZN5test96opaqueEv()
+ // CHECK: invoke void @__cxa_rethrow()
+ opaque();
+ }
+
+ // landing pad from first call to invoke
+ // CHECK: call i8* @llvm.eh.exception
+ // CHECK: call i32 (i8*, i8*, ...)* @llvm.eh.selector(i8* {{.*}}, i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*), i8* bitcast (i8** @_ZTIi to i8*), i8* null)
+}