diff options
| author | ruki <[email protected]> | 2019-09-07 00:49:30 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2019-09-06 22:57:05 +0800 |
| commit | 1d6857de2bc044f45f76270256fad011a591abfc (patch) | |
| tree | 2a028539f470eaee636744990e15c3c42b39edbd /tests/projects/swift/modulemap/src | |
| parent | 0f7e7701f27eec0118930eddefba0d0ca3269d38 (diff) | |
add modulemap tests
Diffstat (limited to 'tests/projects/swift/modulemap/src')
| -rw-r--r-- | tests/projects/swift/modulemap/src/hello.cpp | 8 | ||||
| -rw-r--r-- | tests/projects/swift/modulemap/src/hello.h | 14 | ||||
| -rw-r--r-- | tests/projects/swift/modulemap/src/main.swift | 5 | ||||
| -rw-r--r-- | tests/projects/swift/modulemap/src/module.modulemap | 4 |
4 files changed, 31 insertions, 0 deletions
diff --git a/tests/projects/swift/modulemap/src/hello.cpp b/tests/projects/swift/modulemap/src/hello.cpp new file mode 100644 index 000000000..42b01afac --- /dev/null +++ b/tests/projects/swift/modulemap/src/hello.cpp @@ -0,0 +1,8 @@ +#include <stdio.h> +#include "hello.h" + +void say1(char const* s) { + printf("%s\n", s); +} + + diff --git a/tests/projects/swift/modulemap/src/hello.h b/tests/projects/swift/modulemap/src/hello.h new file mode 100644 index 000000000..80849f5df --- /dev/null +++ b/tests/projects/swift/modulemap/src/hello.h @@ -0,0 +1,14 @@ +#include <stdio.h> + +#ifdef __cplusplus +extern "C" { +#endif + void say1(char const* s); +#ifdef __cplusplus +} +#endif +static inline void say2(char const* s) { + printf("%s\n", s); +} + + diff --git a/tests/projects/swift/modulemap/src/main.swift b/tests/projects/swift/modulemap/src/main.swift new file mode 100644 index 000000000..0cc015090 --- /dev/null +++ b/tests/projects/swift/modulemap/src/main.swift @@ -0,0 +1,5 @@ +import Foundation +import hello + +hello.say1("hello1") +hello.say2("hello2") diff --git a/tests/projects/swift/modulemap/src/module.modulemap b/tests/projects/swift/modulemap/src/module.modulemap new file mode 100644 index 000000000..69c787ee2 --- /dev/null +++ b/tests/projects/swift/modulemap/src/module.modulemap @@ -0,0 +1,4 @@ +module hello { + header "hello.h" + export * +} |
