diff options
author | Aditya Kumar <hiraditya@msn.com> | 2016-09-29 03:32:04 +0000 |
---|---|---|
committer | Aditya Kumar <hiraditya@msn.com> | 2016-09-29 03:32:04 +0000 |
commit | 13a18fecdd12fc70175d7d3e3a7678b7af9f6bc1 (patch) | |
tree | 21439be7c6c7811429b3f0d285e12f988c9f74a0 /clang/test | |
parent | f75609e015cdb9eb1014b4d2e9cf9fd942bb7b20 (diff) | |
download | bcm5719-llvm-13a18fecdd12fc70175d7d3e3a7678b7af9f6bc1.tar.gz bcm5719-llvm-13a18fecdd12fc70175d7d3e3a7678b7af9f6bc1.zip |
[PR30341] Alias must point to a definition
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: 282679
Diffstat (limited to 'clang/test')
-rw-r--r-- | clang/test/CodeGenCXX/alias-available-externally.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/alias-available-externally.cpp b/clang/test/CodeGenCXX/alias-available-externally.cpp new file mode 100644 index 00000000000..264af558377 --- /dev/null +++ b/clang/test/CodeGenCXX/alias-available-externally.cpp @@ -0,0 +1,19 @@ +// 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. +// CHECK: define linkonce_odr void @_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; |