[cfe-commits] r137763 - /cfe/trunk/test/CodeGenCXX/weak-external.cpp

Eric Christopher echristo at apple.com
Tue Aug 16 14:41:33 PDT 2011


Author: echristo
Date: Tue Aug 16 16:41:33 2011
New Revision: 137763

URL: http://llvm.org/viewvc/llvm-project?rev=137763&view=rev
Log:
Migrate weak-external.cpp from llvm/test/FrontendC++.

Added:
    cfe/trunk/test/CodeGenCXX/weak-external.cpp

Added: cfe/trunk/test/CodeGenCXX/weak-external.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/weak-external.cpp?rev=137763&view=auto
==============================================================================
--- cfe/trunk/test/CodeGenCXX/weak-external.cpp (added)
+++ cfe/trunk/test/CodeGenCXX/weak-external.cpp Tue Aug 16 16:41:33 2011
@@ -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"));
+}





More information about the cfe-commits mailing list