summaryrefslogtreecommitdiff
path: root/tests/projects/c++/modules/stl_headerunit
diff options
context:
space:
mode:
authorArthur LAURENT <[email protected]>2022-08-03 02:36:31 +0200
committerArthur LAURENT <[email protected]>2022-08-03 02:36:31 +0200
commitdcf5a1dfa3e592563093e862e0bb4ecd2ac3b3ba (patch)
tree542dc30f36b8c3f1647ce6ec78cfe353f28716ec /tests/projects/c++/modules/stl_headerunit
parent92b8b6629b6c3b4b59d78835b7e4719313c04ae1 (diff)
[C++20 Modules] Add tests for headerunits
Diffstat (limited to 'tests/projects/c++/modules/stl_headerunit')
-rw-r--r--tests/projects/c++/modules/stl_headerunit/src/hello.mpp11
-rw-r--r--tests/projects/c++/modules/stl_headerunit/src/main.cpp6
-rw-r--r--tests/projects/c++/modules/stl_headerunit/xmake.lua4
3 files changed, 21 insertions, 0 deletions
diff --git a/tests/projects/c++/modules/stl_headerunit/src/hello.mpp b/tests/projects/c++/modules/stl_headerunit/src/hello.mpp
new file mode 100644
index 000000000..d45c5759e
--- /dev/null
+++ b/tests/projects/c++/modules/stl_headerunit/src/hello.mpp
@@ -0,0 +1,11 @@
+module;
+
+export module hello;
+
+import <iostream>;
+
+export namespace hello {
+ void say(const char* str) {
+ std::cout << str << std::endl;
+ }
+}
diff --git a/tests/projects/c++/modules/stl_headerunit/src/main.cpp b/tests/projects/c++/modules/stl_headerunit/src/main.cpp
new file mode 100644
index 000000000..1e5cc698f
--- /dev/null
+++ b/tests/projects/c++/modules/stl_headerunit/src/main.cpp
@@ -0,0 +1,6 @@
+import hello;
+
+int main() {
+ hello::say("hello module!");
+ return 0;
+}
diff --git a/tests/projects/c++/modules/stl_headerunit/xmake.lua b/tests/projects/c++/modules/stl_headerunit/xmake.lua
new file mode 100644
index 000000000..e85378c46
--- /dev/null
+++ b/tests/projects/c++/modules/stl_headerunit/xmake.lua
@@ -0,0 +1,4 @@
+set_languages("c++20")
+target("stl_headerunit")
+ set_kind("binary")
+ add_files("src/*.cpp", "src/*.mpp")