diff options
author | Anders Carlsson <andersca@mac.com> | 2009-12-11 00:32:37 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2009-12-11 00:32:37 +0000 |
commit | afd1edb52efbc7f981320c90910e8c0562702092 (patch) | |
tree | 9b0421b4de88cfb48abd38d5ec14051b0010b3db /clang/test/CodeGenCXX/exceptions.cpp | |
parent | ff141799fbbb573d35b2066fd75fcf1340a6c7d7 (diff) | |
download | bcm5719-llvm-afd1edb52efbc7f981320c90910e8c0562702092.tar.gz bcm5719-llvm-afd1edb52efbc7f981320c90910e8c0562702092.zip |
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.
llvm-svn: 91084
Diffstat (limited to 'clang/test/CodeGenCXX/exceptions.cpp')
-rw-r--r-- | clang/test/CodeGenCXX/exceptions.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/exceptions.cpp b/clang/test/CodeGenCXX/exceptions.cpp new file mode 100644 index 00000000000..396ff441ef9 --- /dev/null +++ b/clang/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(); +} |