From f85dc3f0f1c9bbc467ef822616734e9e0e4c6bbd Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Fri, 4 Dec 2009 23:29:57 +0000 Subject: [PATCH] Add testcase for PR4262. llvm-svn: 90623 --- llvm/test/FrontendC++/weak-external.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 llvm/test/FrontendC++/weak-external.cpp diff --git a/llvm/test/FrontendC++/weak-external.cpp b/llvm/test/FrontendC++/weak-external.cpp new file mode 100644 index 000000000000..94360c2e97ee --- /dev/null +++ b/llvm/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. Since _S_construct is a member +// template, it's instantiation is *not* suppressed (despite being in +// basic_string), so we would emit it as a weak definition. + +#include + +void dummysymbol() { + throw(std::runtime_error("string")); +}