summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/microsoft-abi-exceptions.cpp
diff options
context:
space:
mode:
authorTimur Iskhodzhanov <timurrrr@google.com>2013-10-17 09:11:45 +0000
committerTimur Iskhodzhanov <timurrrr@google.com>2013-10-17 09:11:45 +0000
commit406a479ddb5c55394f7bb8866416146d22535484 (patch)
treef13fd4d2bf6447620ec7e44007728a08dfad77c3 /clang/test/CodeGenCXX/microsoft-abi-exceptions.cpp
parent333112a4397deba64c73e9f255ce0d320360dc0f (diff)
downloadbcm5719-llvm-406a479ddb5c55394f7bb8866416146d22535484.tar.gz
bcm5719-llvm-406a479ddb5c55394f7bb8866416146d22535484.zip
Follow-up to r192822: fix Clang assertion when building with -fexceptions
llvm-svn: 192875
Diffstat (limited to 'clang/test/CodeGenCXX/microsoft-abi-exceptions.cpp')
-rw-r--r--clang/test/CodeGenCXX/microsoft-abi-exceptions.cpp41
1 files changed, 40 insertions, 1 deletions
diff --git a/clang/test/CodeGenCXX/microsoft-abi-exceptions.cpp b/clang/test/CodeGenCXX/microsoft-abi-exceptions.cpp
index 383270a1f2e..c95adcd8eeb 100644
--- a/clang/test/CodeGenCXX/microsoft-abi-exceptions.cpp
+++ b/clang/test/CodeGenCXX/microsoft-abi-exceptions.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -emit-llvm %s -o - -triple=i386-pc-win32 -cxx-abi microsoft -fexceptions | FileCheck -check-prefix WIN32 %s
+// RUN: %clang_cc1 -emit-llvm %s -o - -triple=i386-pc-win32 -cxx-abi microsoft -fexceptions -fno-rtti | FileCheck -check-prefix WIN32 %s
struct A {
A();
@@ -116,3 +116,42 @@ int HasConditionalDeactivatedCleanups(bool cond) {
// WIN32: br i1 %[[isactive]]
// WIN32: invoke x86_thiscallcc void @"\01??1A@@QAE@XZ"(%struct.A* %[[arg1]])
// WIN32: }
+
+namespace crash_on_partial_destroy {
+struct A {
+ virtual ~A();
+};
+
+struct B : virtual A {
+ // Has an implicit destructor.
+};
+
+struct C : B {
+ C();
+};
+
+void foo();
+// We used to crash when emitting this.
+C::C() { foo(); }
+
+// Verify that we don't bother with a vbtable lookup when adjusting the this
+// pointer to call a base destructor from a constructor while unwinding.
+// WIN32-LABEL: define {{.*}} @"\01??0C@crash_on_partial_destroy@@QAE@XZ"{{.*}} {
+// WIN32: landingpad
+//
+// We shouldn't do any vbptr loads, just constant GEPs.
+// WIN32-NOT: load
+// WIN32: getelementptr inbounds i8* %{{.*}}, i64 4
+// WIN32-NOT: load
+// WIN32: bitcast i8* %{{.*}} to %"struct.crash_on_partial_destroy::B"*
+// WIN32: invoke x86_thiscallcc void @"\01??1B@crash_on_partial_destroy@@UAE@XZ"
+//
+// WIN32-NOT: load
+// WIN32: bitcast %"struct.crash_on_partial_destroy::C"* %{{.*}} to i8*
+// WIN32-NOT: load
+// WIN32: getelementptr inbounds i8* %{{.*}}, i64 4
+// WIN32-NOT: load
+// WIN32: bitcast i8* %{{.*}} to %"struct.crash_on_partial_destroy::A"*
+// WIN32: invoke x86_thiscallcc void @"\01??1A@crash_on_partial_destroy@@UAE@XZ"
+// WIN32: }
+}
OpenPOWER on IntegriCloud