summaryrefslogtreecommitdiff
path: root/tests/projects/c++/modules/partitions2
diff options
context:
space:
mode:
authorruki <[email protected]>2022-08-24 22:45:24 +0800
committerruki <[email protected]>2022-08-24 22:45:24 +0800
commitee55b56ef385023a290e495f6626ab7aeea2c5b8 (patch)
tree913bef27565fe91265b32b526b08877588287a42 /tests/projects/c++/modules/partitions2
parente94c67aea65b7b64246a79b7f125c11f3268371d (diff)
improve module deps
Diffstat (limited to 'tests/projects/c++/modules/partitions2')
-rw-r--r--tests/projects/c++/modules/partitions2/src/math.cpp15
-rw-r--r--tests/projects/c++/modules/partitions2/src/math.mpp7
-rw-r--r--tests/projects/c++/modules/partitions2/src/math_helpers.cpp7
-rw-r--r--tests/projects/c++/modules/partitions2/src/test.cpp7
-rw-r--r--tests/projects/c++/modules/partitions2/xmake.lua4
5 files changed, 40 insertions, 0 deletions
diff --git a/tests/projects/c++/modules/partitions2/src/math.cpp b/tests/projects/c++/modules/partitions2/src/math.cpp
new file mode 100644
index 000000000..535d693eb
--- /dev/null
+++ b/tests/projects/c++/modules/partitions2/src/math.cpp
@@ -0,0 +1,15 @@
+module math;
+
+import :details;
+
+double Math::superLog(double z, double b)
+{
+ // Implementation omitted...
+ return someHelperFunction(z);
+}
+
+double Math::lerchZeta(double lambda, double alpha, double s)
+{
+ // Implementation omitted...
+ return someHelperFunction(s);
+}
diff --git a/tests/projects/c++/modules/partitions2/src/math.mpp b/tests/projects/c++/modules/partitions2/src/math.mpp
new file mode 100644
index 000000000..e9308b2af
--- /dev/null
+++ b/tests/projects/c++/modules/partitions2/src/math.mpp
@@ -0,0 +1,7 @@
+export module math; // math module declaration
+
+export namespace Math
+{
+ double superLog(double z, double b);
+ double lerchZeta(double lambda, double alpha, double s);
+}
diff --git a/tests/projects/c++/modules/partitions2/src/math_helpers.cpp b/tests/projects/c++/modules/partitions2/src/math_helpers.cpp
new file mode 100644
index 000000000..9d2eaaa27
--- /dev/null
+++ b/tests/projects/c++/modules/partitions2/src/math_helpers.cpp
@@ -0,0 +1,7 @@
+module math:details; // math:details implementation partition
+
+double someHelperFunction(double a)
+{
+ // Implementation omitted...
+ return 42;
+}
diff --git a/tests/projects/c++/modules/partitions2/src/test.cpp b/tests/projects/c++/modules/partitions2/src/test.cpp
new file mode 100644
index 000000000..a2ff757b1
--- /dev/null
+++ b/tests/projects/c++/modules/partitions2/src/test.cpp
@@ -0,0 +1,7 @@
+import math;
+
+int main()
+{
+ auto a{ Math::lerchZeta(1, 2, 3) };
+ auto b{ Math::superLog(1, 2) };
+}
diff --git a/tests/projects/c++/modules/partitions2/xmake.lua b/tests/projects/c++/modules/partitions2/xmake.lua
new file mode 100644
index 000000000..c9290833b
--- /dev/null
+++ b/tests/projects/c++/modules/partitions2/xmake.lua
@@ -0,0 +1,4 @@
+set_languages("c++20")
+target("hello")
+ set_kind("binary")
+ add_files("src/*.cpp", "src/*.mpp")