summaryrefslogtreecommitdiffstats
path: root/tests/cpp-compiler/cpp-compile-shared-library.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/cpp-compiler/cpp-compile-shared-library.cpp')
-rw-r--r--tests/cpp-compiler/cpp-compile-shared-library.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/cpp-compiler/cpp-compile-shared-library.cpp b/tests/cpp-compiler/cpp-compile-shared-library.cpp
new file mode 100644
index 000000000..8b70f258d
--- /dev/null
+++ b/tests/cpp-compiler/cpp-compile-shared-library.cpp
@@ -0,0 +1,23 @@
+//TEST(smoke):CPP_COMPILER_SHARED_LIBRARY:
+
+//#include <slang.h>
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+#include <iostream>
+using namespace std;
+
+#if defined(_MSC_VER)
+# define DLL_EXPORT __declspec(dllexport)
+#else
+# define DLL_EXPORT __attribute__((__visibility__("default")))
+#endif
+
+extern "C" DLL_EXPORT int test(int intValue, const char* textValue, char* outTextValue)
+{
+ strcpy(outTextValue, textValue);
+ return intValue;
+}
+