diff options
Diffstat (limited to 'testsuite/tests/ghci/linking/dyn/A.c')
-rw-r--r-- | testsuite/tests/ghci/linking/dyn/A.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/testsuite/tests/ghci/linking/dyn/A.c b/testsuite/tests/ghci/linking/dyn/A.c new file mode 100644 index 0000000000..fec94f2829 --- /dev/null +++ b/testsuite/tests/ghci/linking/dyn/A.c @@ -0,0 +1,17 @@ +#if defined(_MSC_VER) + // Microsoft + #define EXPORT __declspec(dllexport) +#elif defined(_GCC) + // GCC + #define EXPORT __attribute__((visibility("default"))) +#else + // do nothing and hope for the best? + #define EXPORT +#endif + +extern EXPORT int foo(); + +EXPORT int foo() +{ + return 2; +} |