diff options
author | John McCall <rjmccall@apple.com> | 2011-02-13 00:46:43 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2011-02-13 00:46:43 +0000 |
commit | 2b3c5538fa26f5301d4498b8d6c8949d68aa20c2 (patch) | |
tree | d4cb41556fb0188c5b05c0da837ff3024fee394f /clang/test/CodeGenCXX/destructors.cpp | |
parent | 2406b7d179a38907023ffecce0ed2ddb28f8c2b6 (diff) | |
download | bcm5719-llvm-2b3c5538fa26f5301d4498b8d6c8949d68aa20c2.tar.gz bcm5719-llvm-2b3c5538fa26f5301d4498b8d6c8949d68aa20c2.zip |
Look through array types when deciding whether a field requires non-trivial
destruction in the destructor-aliases logic. Fixes PR 9197.
llvm-svn: 125447
Diffstat (limited to 'clang/test/CodeGenCXX/destructors.cpp')
-rw-r--r-- | clang/test/CodeGenCXX/destructors.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/destructors.cpp b/clang/test/CodeGenCXX/destructors.cpp index 0fc23116a57..f382413cba4 100644 --- a/clang/test/CodeGenCXX/destructors.cpp +++ b/clang/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 |