Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reapplying the patch after modifying the test case. Inlining the destructor caused the compiler to generate bad IR which failed the Verifier in the backend. https://llvm.org/bugs/show_bug.cgi?id=30341 This patch disables alias to available_externally definitions. Reviewers: eugenis, rsmith Differential Revision: https://reviews.llvm.org/D24682 llvm-svn: 283063
- Loading branch information
Showing
2 changed files
with
26 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// RUN: %clang_cc1 -O1 -std=c++11 -emit-llvm -disable-llvm-passes -o - %s | FileCheck %s | ||
// Clang should not generate alias to available_externally definitions. | ||
// Check that the destructor of Foo is defined. | ||
// The destructors have different return type for different targets. | ||
// CHECK: define linkonce_odr {{.*}} @_ZN3FooD2Ev | ||
template <class CharT> | ||
struct String { | ||
String() {} | ||
~String(); | ||
}; | ||
|
||
template <class CharT> | ||
inline __attribute__((visibility("hidden"), always_inline)) | ||
String<CharT>::~String() {} | ||
|
||
extern template struct String<char>; | ||
|
||
struct Foo : public String<char> { Foo() { String<char> s; } }; | ||
|
||
Foo f; |