From 7442d6faa2719e4e7d33a7021c406c5a4facd74d Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sun, 16 Apr 2017 16:02:28 +0000 Subject: Vendor import of clang trunk r300422: https://llvm.org/svn/llvm-project/cfe/trunk@300422 --- test/CodeGenCXX/explicit-instantiation.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'test/CodeGenCXX/explicit-instantiation.cpp') diff --git a/test/CodeGenCXX/explicit-instantiation.cpp b/test/CodeGenCXX/explicit-instantiation.cpp index fb5711878764c..85857fb6fb8cc 100644 --- a/test/CodeGenCXX/explicit-instantiation.cpp +++ b/test/CodeGenCXX/explicit-instantiation.cpp @@ -5,6 +5,9 @@ // This check logically is attached to 'template int S::i;' below. // CHECK: @_ZN1SIiE1iE = weak_odr global i32 +// This check is logically attached to 'template int ExportedStaticLocal::f()' below. +// CHECK-OPT: @_ZZN19ExportedStaticLocal1fIiEEvvE1i = linkonce_odr global + template struct plus { Result operator()(const T& t, const U& u) const; @@ -153,3 +156,17 @@ template void S::f() {} template void S::g() {} template int S::i; template void S::S2::h() {} + +namespace ExportedStaticLocal { +void sink(int&); +template +inline void f() { + static int i; + sink(i); +} +// See the check line at the top of the file. +extern template void f(); +void use() { + f(); +} +} -- cgit v1.2.3