summaryrefslogtreecommitdiff
path: root/test/CodeGenCXX/windows-itanium-dllexport.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/CodeGenCXX/windows-itanium-dllexport.cpp')
-rw-r--r--test/CodeGenCXX/windows-itanium-dllexport.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/CodeGenCXX/windows-itanium-dllexport.cpp b/test/CodeGenCXX/windows-itanium-dllexport.cpp
index 92cca24442874..ff780c777822d 100644
--- a/test/CodeGenCXX/windows-itanium-dllexport.cpp
+++ b/test/CodeGenCXX/windows-itanium-dllexport.cpp
@@ -1,5 +1,10 @@
// RUN: %clang_cc1 -emit-llvm -triple i686-windows-itanium -fdeclspec %s -o - | FileCheck %s
+#define JOIN2(x, y) x##y
+#define JOIN(x, y) JOIN2(x, y)
+#define UNIQ(name) JOIN(name, __LINE__)
+#define USEMEMFUNC(class, func) void (class::*UNIQ(use)())() { return &class::func; }
+
struct __declspec(dllexport) s {
void f() {}
};
@@ -28,3 +33,23 @@ template class __declspec(dllexport) c<double>;
// CHECK: define {{.*}} dllexport {{.*}} @_ZN1cIdEaSERKS0_
// CHECK: define {{.*}} dllexport {{.*}} @_ZN1cIdE1fEv
+
+template <class T>
+struct outer {
+ void f() {}
+ struct inner {
+ void f() {}
+ };
+};
+
+template class __declspec(dllexport) outer<int>;
+
+// CHECK: define {{.*}} dllexport {{.*}} @_ZN5outerIiE1fEv
+// CHECK-NOT: define {{.*}} dllexport {{.*}} @_ZN5outerIiE5inner1fEv
+
+extern template class __declspec(dllimport) outer<char>;
+USEMEMFUNC(outer<char>, f)
+USEMEMFUNC(outer<char>::inner, f)
+
+// CHECK: declare dllimport {{.*}} @_ZN5outerIcE1fEv
+// CHECK: define {{.*}} @_ZN5outerIcE5inner1fEv