diff options
author | Bill Wendling <isanbard@gmail.com> | 2009-12-04 23:29:57 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2009-12-04 23:29:57 +0000 |
commit | 7907ddb6d832d6ff740844858c944e56ecea8237 (patch) | |
tree | 2864e00829e875970147a7cd110c00b2bc789233 /test/FrontendC++/weak-external.cpp | |
parent | fcafe44f564f61016dd2f9367d93c91dfda74c96 (diff) |
Add testcase for PR4262.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90623 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/FrontendC++/weak-external.cpp')
-rw-r--r-- | test/FrontendC++/weak-external.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/FrontendC++/weak-external.cpp b/test/FrontendC++/weak-external.cpp new file mode 100644 index 0000000000..94360c2e97 --- /dev/null +++ b/test/FrontendC++/weak-external.cpp @@ -0,0 +1,17 @@ +// RUN: %llvmgxx %s -S -emit-llvm -O2 -o - | not grep {_ZNSs12_S_constructIPKcEEPcT_S3_RKSaIcESt20forward_iterator_tag} +// PR4262 + +// The "basic_string" extern template instantiation declaration is supposed to +// suppress the implicit instantiation of non-inline member functions. Make sure +// that we suppress the implicit instantiation of non-inline member functions +// defined out-of-line. That we aren't instantiating the basic_string +// constructor when we shouldn't be. Such an instantiation forces the implicit +// instantiation of _S_construct<const char*>. Since _S_construct is a member +// template, it's instantiation is *not* suppressed (despite being in +// basic_string<char>), so we would emit it as a weak definition. + +#include <stdexcept> + +void dummysymbol() { + throw(std::runtime_error("string")); +} |