diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/cpp-compiler/c-compile-error.c | 12 | ||||
| -rw-r--r-- | tests/cpp-compiler/c-compile-error.c.expected | 1 | ||||
| -rw-r--r-- | tests/cpp-compiler/c-compile-link-error.c | 12 | ||||
| -rw-r--r-- | tests/cpp-compiler/c-compile-link-error.c.expected | 1 | ||||
| -rw-r--r-- | tests/cpp-compiler/c-compile-shared-library-link-error.c | 27 | ||||
| -rw-r--r-- | tests/cpp-compiler/c-compile-shared-library-link-error.c.expected | 1 |
6 files changed, 54 insertions, 0 deletions
diff --git a/tests/cpp-compiler/c-compile-error.c b/tests/cpp-compiler/c-compile-error.c new file mode 100644 index 000000000..ae36dd9c5 --- /dev/null +++ b/tests/cpp-compiler/c-compile-error.c @@ -0,0 +1,12 @@ +//TEST(smoke):CPP_COMPILER_EXECUTE: + +#include <stdlib.h> +#include <stdio.h> + +int main(int argc, char** argv) +{ + int a = b + c; + + printf("Hello World!\n"); + return 0; +} diff --git a/tests/cpp-compiler/c-compile-error.c.expected b/tests/cpp-compiler/c-compile-error.c.expected new file mode 100644 index 000000000..09646b013 --- /dev/null +++ b/tests/cpp-compiler/c-compile-error.c.expected @@ -0,0 +1 @@ +Compile: Error diff --git a/tests/cpp-compiler/c-compile-link-error.c b/tests/cpp-compiler/c-compile-link-error.c new file mode 100644 index 000000000..08b93a38b --- /dev/null +++ b/tests/cpp-compiler/c-compile-link-error.c @@ -0,0 +1,12 @@ +//TEST(smoke):CPP_COMPILER_EXECUTE: + +#include <stdlib.h> +#include <stdio.h> + +extern int thing; + +int main(int argc, char** argv) +{ + printf("Hello World %d!\n", thing); + return 0; +} diff --git a/tests/cpp-compiler/c-compile-link-error.c.expected b/tests/cpp-compiler/c-compile-link-error.c.expected new file mode 100644 index 000000000..593b17b75 --- /dev/null +++ b/tests/cpp-compiler/c-compile-link-error.c.expected @@ -0,0 +1 @@ +Link: Error diff --git a/tests/cpp-compiler/c-compile-shared-library-link-error.c b/tests/cpp-compiler/c-compile-shared-library-link-error.c new file mode 100644 index 000000000..1339a3b52 --- /dev/null +++ b/tests/cpp-compiler/c-compile-shared-library-link-error.c @@ -0,0 +1,27 @@ +//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 int symbolNotFound; + +EXTERN_C DLL_EXPORT int test(int intValue, const char* textValue, char* outTextValue) +{ + strcpy(outTextValue, textValue); + return intValue + symbolNotFound; +} + diff --git a/tests/cpp-compiler/c-compile-shared-library-link-error.c.expected b/tests/cpp-compiler/c-compile-shared-library-link-error.c.expected new file mode 100644 index 000000000..593b17b75 --- /dev/null +++ b/tests/cpp-compiler/c-compile-shared-library-link-error.c.expected @@ -0,0 +1 @@ +Link: Error |
