aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGenCXX/destructors.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2011-02-13 00:46:43 +0000
committerJohn McCall <rjmccall@apple.com>2011-02-13 00:46:43 +0000
commit0d70d71ccbc4f7f59cadb759f61b7172a149676c (patch)
tree027a6fb58fc309c2111963092aef4742f3cdf731 /test/CodeGenCXX/destructors.cpp
parente3c8c64e7735c3589e1a34e6000c93183a55920c (diff)
Look through array types when deciding whether a field requires non-trivial
destruction in the destructor-aliases logic. Fixes PR 9197. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125447 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/destructors.cpp')
-rw-r--r--test/CodeGenCXX/destructors.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/CodeGenCXX/destructors.cpp b/test/CodeGenCXX/destructors.cpp
index 0fc23116a5..f382413cba 100644
--- a/test/CodeGenCXX/destructors.cpp
+++ b/test/CodeGenCXX/destructors.cpp
@@ -306,6 +306,26 @@ namespace test6 {
// CHECK: invoke void @_ZN5test61BILj0EED2Ev
}
+// PR 9197
+namespace test7 {
+ struct D { ~D(); };
+
+ struct A { ~A(); };
+ A::~A() { }
+
+ struct B : public A {
+ ~B();
+ D arr[1];
+ };
+
+ // Verify that this doesn't get emitted as an alias
+ // CHECK: define void @_ZN5test71BD2Ev(
+ // CHECK: invoke void @_ZN5test71DD1Ev(
+ // CHECK: call void @_ZN5test71AD2Ev(
+ B::~B() {}
+
+}
+
// Checks from test3:
// CHECK: define internal void @_ZN5test312_GLOBAL__N_11DD0Ev(%"struct.test3::<anonymous namespace>::D"* %this) unnamed_addr