aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGenCXX/exceptions.cpp
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2009-12-11 00:32:37 +0000
committerAnders Carlsson <andersca@mac.com>2009-12-11 00:32:37 +0000
commit8370c58b9295b32bee50443fe3ac43a47a2047e8 (patch)
tree684eab922ccb9658aa430d9992f6d22aed54fcb5 /test/CodeGenCXX/exceptions.cpp
parent5c2609a1f9c68bbbb3dc665df212988133e85439 (diff)
When an exception needs to be freed by calling __cxa_exception_free, make sure to stash away the exception pointer somewhere.
This fixes an "Instruction does not dominate all uses!" verification error when compiling TableGen. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91084 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/exceptions.cpp')
-rw-r--r--test/CodeGenCXX/exceptions.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/CodeGenCXX/exceptions.cpp b/test/CodeGenCXX/exceptions.cpp
new file mode 100644
index 0000000000..396ff441ef
--- /dev/null
+++ b/test/CodeGenCXX/exceptions.cpp
@@ -0,0 +1,18 @@
+// RUN: clang-cc %s -triple=x86_64-apple-darwin10 -emit-llvm -o - -fexceptions
+
+struct allocator {
+ allocator();
+ allocator(const allocator&);
+ ~allocator();
+};
+
+void f();
+void g(bool b, bool c) {
+ if (b) {
+ if (!c)
+ throw allocator();
+
+ return;
+ }
+ f();
+}