summaryrefslogtreecommitdiff
path: root/tests/projects
diff options
context:
space:
mode:
Diffstat (limited to 'tests/projects')
-rw-r--r--tests/projects/other/parallel_build/1.cpp3
-rw-r--r--tests/projects/other/parallel_build/2.cpp31
-rw-r--r--tests/projects/other/parallel_build/xmake.lua13
3 files changed, 47 insertions, 0 deletions
diff --git a/tests/projects/other/parallel_build/1.cpp b/tests/projects/other/parallel_build/1.cpp
new file mode 100644
index 000000000..9cd1218ae
--- /dev/null
+++ b/tests/projects/other/parallel_build/1.cpp
@@ -0,0 +1,3 @@
+int main(int argv, char** argv) {
+ return 0;
+}
diff --git a/tests/projects/other/parallel_build/2.cpp b/tests/projects/other/parallel_build/2.cpp
new file mode 100644
index 000000000..dd82f0605
--- /dev/null
+++ b/tests/projects/other/parallel_build/2.cpp
@@ -0,0 +1,31 @@
+// Make this object complex and cost longer compile time...
+#include <algorithm>
+#include <any>
+#include <bitset>
+#include <filesystem>
+#include <fstream>
+#include <iostream>
+#include <list>
+#include <map>
+#include <optional>
+#include <queue>
+#include <string>
+#include <unordered_map>
+#include <variant>
+#include <vector>
+
+int main(int argc, char** argv) {
+ using Type = std::variant<int8_t, uint8_t, int16_t, uint16_t, int32_t,
+ uint32_t, int64_t, uint64_t, double, float>;
+ Type a, b, c;
+ a = 5;
+ b = 3.0;
+ c = 4.0f;
+ double r;
+ std::visit([&](auto a, auto b, auto c) { r = a + b + c; }, a, b, c);
+ std::visit([&](auto a, auto b, auto c) { r = a + b - c; }, a, b, c);
+ std::visit([&](auto a, auto b, auto c) { r = a - b - c; }, a, b, c);
+ std::visit([&](auto a, auto b, auto c) { r = (a + b + c) * 2; }, a, b, c);
+ std::visit([&](auto a, auto b, auto c) { r = (a + b - c) * 3; }, a, b, c);
+ return 0;
+}
diff --git a/tests/projects/other/parallel_build/xmake.lua b/tests/projects/other/parallel_build/xmake.lua
new file mode 100644
index 000000000..e84b8a6e5
--- /dev/null
+++ b/tests/projects/other/parallel_build/xmake.lua
@@ -0,0 +1,13 @@
+-- These targets should compiled and linked concurrently.
+add_rules("mode.release", "mode.debug", "mode.releasedbg")
+set_policy("build.ccache", false)
+
+target("first")
+ set_kind("binary")
+ add_files("1.cpp")
+ set_languages("clatest", "cxx20")
+
+target("second")
+ set_kind("binary")
+ add_files("2.cpp")
+ set_languages("clatest", "cxx20")