diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/cpp-compiler/c-compile-shared-library.c | 25 | ||||
| -rw-r--r-- | tests/cpp-compiler/c-compile.c (renamed from tests/cross-compile/c-compile.c) | 2 | ||||
| -rw-r--r-- | tests/cpp-compiler/c-compile.c.expected (renamed from tests/cross-compile/c-compile.c.expected) | 0 | ||||
| -rw-r--r-- | tests/cpp-compiler/cpp-compile-shared-library.cpp | 23 | ||||
| -rw-r--r-- | tests/cpp-compiler/cpp-compile.cpp | 9 | ||||
| -rw-r--r-- | tests/cpp-compiler/cpp-compile.cpp.expected | 6 |
6 files changed, 64 insertions, 1 deletions
diff --git a/tests/cpp-compiler/c-compile-shared-library.c b/tests/cpp-compiler/c-compile-shared-library.c new file mode 100644 index 000000000..8b6be6115 --- /dev/null +++ b/tests/cpp-compiler/c-compile-shared-library.c @@ -0,0 +1,25 @@ +//TEST(smoke):CPP_COMPILER_SHARED_LIBRARY: + +#include <stdlib.h> +#include <stdio.h> +#include <string.h> + +#if defined(_MSC_VER) +# define DLL_EXPORT __declspec(dllexport) +#else +//# define DLL_EXPORT +# define DLL_EXPORT __attribute__ ((dllexport)) __attribute__((__visibility__("default"))) +#endif + +#ifdef __cplusplus +#define EXTERN_C extern "C" +#else +#define EXTERN_C +#endif + +EXTERN_C DLL_EXPORT int test(int intValue, const char* textValue, char* outTextValue) +{ + strcpy(outTextValue, textValue); + return intValue; +} + diff --git a/tests/cross-compile/c-compile.c b/tests/cpp-compiler/c-compile.c index 2151f7474..75fdbdaa4 100644 --- a/tests/cross-compile/c-compile.c +++ b/tests/cpp-compiler/c-compile.c @@ -1,4 +1,4 @@ -//TEST(smoke):EXECUTE_C: +//TEST(smoke):CPP_COMPILER_EXECUTE: #include <stdlib.h> #include <stdio.h> diff --git a/tests/cross-compile/c-compile.c.expected b/tests/cpp-compiler/c-compile.c.expected index 0e042b53b..0e042b53b 100644 --- a/tests/cross-compile/c-compile.c.expected +++ b/tests/cpp-compiler/c-compile.c.expected 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; +} + diff --git a/tests/cpp-compiler/cpp-compile.cpp b/tests/cpp-compiler/cpp-compile.cpp new file mode 100644 index 000000000..c3141a876 --- /dev/null +++ b/tests/cpp-compiler/cpp-compile.cpp @@ -0,0 +1,9 @@ +//TEST(smoke):CPP_COMPILER_EXECUTE: +#include <iostream> +using namespace std; + +int main(int argc, char** argv) +{ + cout << "Hello World!" << endl; + return 0; +} diff --git a/tests/cpp-compiler/cpp-compile.cpp.expected b/tests/cpp-compiler/cpp-compile.cpp.expected new file mode 100644 index 000000000..0e042b53b --- /dev/null +++ b/tests/cpp-compiler/cpp-compile.cpp.expected @@ -0,0 +1,6 @@ +result code = 0 +standard error = { +} +standard output = { +Hello World! +} |
