summaryrefslogtreecommitdiff
path: root/tests/projects/c++/modules
diff options
context:
space:
mode:
authorruki <[email protected]>2019-09-06 22:58:54 +0800
committerruki <[email protected]>2019-09-06 11:53:27 +0800
commit0f7e7701f27eec0118930eddefba0d0ca3269d38 (patch)
treee13e243dfdf10d0b4e2fe632989420dbc5d37702 /tests/projects/c++/modules
parent7210427c931d41fd52608ee5a502ea54414d6606 (diff)
remove some tests
Diffstat (limited to 'tests/projects/c++/modules')
-rw-r--r--tests/projects/c++/modules/template_instantiation/src/main.cpp6
-rw-r--r--tests/projects/c++/modules/template_instantiation/src/mod.mpp78
-rw-r--r--tests/projects/c++/modules/template_instantiation/xmake.lua6
3 files changed, 0 insertions, 90 deletions
diff --git a/tests/projects/c++/modules/template_instantiation/src/main.cpp b/tests/projects/c++/modules/template_instantiation/src/main.cpp
deleted file mode 100644
index babfe1222..000000000
--- a/tests/projects/c++/modules/template_instantiation/src/main.cpp
+++ /dev/null
@@ -1,6 +0,0 @@
-import mod;
-
-int main() {
- test_performance(foo<1000>{}, foo<1000>{});
- return 0;
-}
diff --git a/tests/projects/c++/modules/template_instantiation/src/mod.mpp b/tests/projects/c++/modules/template_instantiation/src/mod.mpp
deleted file mode 100644
index 019f923d7..000000000
--- a/tests/projects/c++/modules/template_instantiation/src/mod.mpp
+++ /dev/null
@@ -1,78 +0,0 @@
-export module mod;
-
-class thread {
-public:
- thread(...) {}
- void join() {}
-};
-
-class atomic_int {
-public:
- atomic_int(...) {}
- int operator++() { return 0; }
-};
-
-/* gcc would ICE with template */
-
-template <typename T>
-class msg_queue {
-public:
- void put(...) {}
- T take() { return {}; }
-};
-
-export template <int N, int M, int Loops = 1000000>
-void test_prod_cons() {
- thread producers[N];
- thread consumers[M];
-
- struct msg_t {
- int pid_;
- int dat_;
- };
- msg_queue<msg_t> messages;
-
- int cid = 0;
- for (auto& t : consumers) {
- t = thread{[&, cid] {
- while (1) {
- msg_t msg = messages.take();
- if (msg.pid_ < 0) break;
- }
- }};
- ++cid;
- }
-
- int pid = 0;
- for (auto& t : producers) {
- t = thread{[&, pid] {
- for (int i = 0; i < Loops; ++i) {
- messages.put(pid, i); // emplace_back
- }
- }};
- ++pid;
- }
- for (auto& t : producers) t.join();
- // quit
- messages.put(-1, -1);
- for (auto& t : consumers) t.join();
-}
-
-export template <int N>
-struct foo {};
-
-export inline void test_performance(foo<1>, foo<1>) {
- test_prod_cons<1, 1>();
-}
-
-export template <int N>
-void test_performance(foo<N>, foo<1>) {
- test_performance(foo<N - 1>{}, foo<1>{});
- test_prod_cons<N, 1>();
-};
-
-export template <int N, int M>
-void test_performance(foo<N>, foo<M>) {
- test_performance(foo<N>{}, foo<M - 1>{});
- test_prod_cons<N, M>();
-};
diff --git a/tests/projects/c++/modules/template_instantiation/xmake.lua b/tests/projects/c++/modules/template_instantiation/xmake.lua
deleted file mode 100644
index 312703cf7..000000000
--- a/tests/projects/c++/modules/template_instantiation/xmake.lua
+++ /dev/null
@@ -1,6 +0,0 @@
-target("template_instantiation")
- set_kind("binary")
- add_files("src/*.cpp", "src/*.mpp")
- set_languages("c++20")
-
-