summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGen/pch-dllexport.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/CodeGen/pch-dllexport.cpp')
-rw-r--r--clang/test/CodeGen/pch-dllexport.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/test/CodeGen/pch-dllexport.cpp b/clang/test/CodeGen/pch-dllexport.cpp
index 9c6623be436..b8db075046d 100644
--- a/clang/test/CodeGen/pch-dllexport.cpp
+++ b/clang/test/CodeGen/pch-dllexport.cpp
@@ -57,6 +57,13 @@ extern template void explicitInstantiationDefAfterDecl<int>(int);
template <typename T> T __declspec(dllexport) variableTemplate;
extern template int variableTemplate<int>;
+namespace pr38934 {
+template <typename T> struct S {};
+extern template struct S<int>;
+// The use here causes the S<int>::operator= decl to go into the PCH.
+inline void use(S<int> *a, S<int> *b) { *a = *b; };
+}
+
#else
void use() {
@@ -81,4 +88,9 @@ template void __declspec(dllexport) explicitInstantiationDefAfterDecl<int>(int);
template int __declspec(dllexport) variableTemplate<int>;
// PCHWITHOBJVARS: @"??$variableTemplate@H@@3HA" = weak_odr dso_local dllexport global
+// PR38934: Make sure S<int>::operator= gets emitted. While it itself isn't a
+// template specialization, its parent is.
+template struct __declspec(dllexport) pr38934::S<int>;
+// PCHWITHOBJ: define weak_odr dso_local dllexport x86_thiscallcc dereferenceable(1) %"struct.pr38934::S"* @"??4?$S@H@pr38934@@QAEAAU01@ABU01@@Z"
+
#endif
OpenPOWER on IntegriCloud