diff options
author | Eric Christopher <echristo@apple.com> | 2011-08-16 21:41:33 +0000 |
---|---|---|
committer | Eric Christopher <echristo@apple.com> | 2011-08-16 21:41:33 +0000 |
commit | 9eeae42a6e08597a492875cc33596e001ac7b37a (patch) | |
tree | 0310acda4f9a478ab6e640be5b4b3c0430eb0ef9 /clang/test/CodeGenCXX/weak-external.cpp | |
parent | 148bdfa58acd62652bb45bfbf354f270341f4d76 (diff) | |
download | bcm5719-llvm-9eeae42a6e08597a492875cc33596e001ac7b37a.tar.gz bcm5719-llvm-9eeae42a6e08597a492875cc33596e001ac7b37a.zip |
Migrate weak-external.cpp from llvm/test/FrontendC++.
llvm-svn: 137763
Diffstat (limited to 'clang/test/CodeGenCXX/weak-external.cpp')
-rw-r--r-- | clang/test/CodeGenCXX/weak-external.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/weak-external.cpp b/clang/test/CodeGenCXX/weak-external.cpp new file mode 100644 index 00000000000..f1ecc890abe --- /dev/null +++ b/clang/test/CodeGenCXX/weak-external.cpp @@ -0,0 +1,19 @@ +// RUN: %clang -fexceptions %s -S -emit-llvm -o - | FileCheck %s +// PR4262 + +// CHECK-NOT: _ZNSs12_S_constructIPKcEEPcT_S3_RKSaIcESt20forward_iterator_tag + +// 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")); +} |