summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-04-28 13:12:12 (GMT)
committerKitware Robot <kwrobot@kitware.com>2017-04-28 13:12:22 (GMT)
commit34a083a1951306aa9d0c0a5f14ac17706f475546 (patch)
tree4c17561db121d8014b85e10925bb7360b0a30b74 /Tests
parent02d11868827417e88cbbee795703421dfdb342f6 (diff)
parentafb21342ead475a12636f29f7cd77cbe38d05ed1 (diff)
downloadCMake-34a083a1951306aa9d0c0a5f14ac17706f475546.zip
CMake-34a083a1951306aa9d0c0a5f14ac17706f475546.tar.gz
CMake-34a083a1951306aa9d0c0a5f14ac17706f475546.tar.bz2
Merge topic 'bindexplib-consts'
afb21342 bindexplib: fix constants symbols export Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !763
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/AutoExportDll/foo.c2
-rw-r--r--Tests/RunCMake/AutoExportDll/say.cxx10
2 files changed, 12 insertions, 0 deletions
diff --git a/Tests/RunCMake/AutoExportDll/foo.c b/Tests/RunCMake/AutoExportDll/foo.c
index 4b1318b..e70fbb5 100644
--- a/Tests/RunCMake/AutoExportDll/foo.c
+++ b/Tests/RunCMake/AutoExportDll/foo.c
@@ -13,3 +13,5 @@ int bar()
{
return 5;
}
+
+const char testconst[] = "testconst";
diff --git a/Tests/RunCMake/AutoExportDll/say.cxx b/Tests/RunCMake/AutoExportDll/say.cxx
index 51060e8..eb9c0ff 100644
--- a/Tests/RunCMake/AutoExportDll/say.cxx
+++ b/Tests/RunCMake/AutoExportDll/say.cxx
@@ -13,6 +13,14 @@ int WINAPI foo();
int bar();
int objlib();
void justnop();
+
+// test const export
+#ifdef _WIN32
+// data symbols must be explicitly imported
+__declspec(dllimport) extern const char testconst[];
+#else
+extern const char testconst[];
+#endif
}
// test c++ functions
@@ -43,6 +51,8 @@ int main()
bar();
objlib();
printf("\n");
+ printf("%s", testconst);
+ printf("\n");
#ifdef HAS_JUSTNOP
justnop();
#endif