diff options
author | Anders Carlsson <andersca@mac.com> | 2011-04-11 14:13:40 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2011-04-11 14:13:40 +0000 |
commit | 4bdbc0cb1e29ac870b7e7985cf4a1b5c34176e8c (patch) | |
tree | b13b23a6072bd5bf6a862c0c389f5ea4ec247f4b /test/CodeGenCXX/typeid.cpp | |
parent | 379b5155b4566f63679e1da6b0ceb5fdfa2aec6d (diff) |
If there's an invoke destination, we should use invoke instead of call when calling the __cxa_bad_typeid function. Fixes PR7400.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129273 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/typeid.cpp')
-rw-r--r-- | test/CodeGenCXX/typeid.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/CodeGenCXX/typeid.cpp b/test/CodeGenCXX/typeid.cpp new file mode 100644 index 0000000000..c2990586b5 --- /dev/null +++ b/test/CodeGenCXX/typeid.cpp @@ -0,0 +1,18 @@ +// RUN: %clang_cc1 -I%S %s -triple x86_64-apple-darwin10 -emit-llvm -fcxx-exceptions -fexceptions -o - | FileCheck %s +#include <typeinfo> + +// PR7400 +struct A { virtual void f(); }; + +// CHECK: define i8* @_Z1fv +const char *f() { + try { + // CHECK: br i1 + // CHECK: invoke void @__cxa_bad_typeid() noreturn + return typeid(*static_cast<A *>(0)).name(); + } catch (...) { + // CHECK: call i8* @llvm.eh.exception + } + + return 0; +} |