From 0f7e7701f27eec0118930eddefba0d0ca3269d38 Mon Sep 17 00:00:00 2001 From: ruki Date: Fri, 6 Sep 2019 22:58:54 +0800 Subject: remove some tests --- .../modules/template_instantiation/src/main.cpp | 6 -- .../c++/modules/template_instantiation/src/mod.mpp | 78 ---------------------- .../c++/modules/template_instantiation/xmake.lua | 6 -- 3 files changed, 90 deletions(-) delete mode 100644 tests/projects/c++/modules/template_instantiation/src/main.cpp delete mode 100644 tests/projects/c++/modules/template_instantiation/src/mod.mpp delete mode 100644 tests/projects/c++/modules/template_instantiation/xmake.lua 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 -class msg_queue { -public: - void put(...) {} - T take() { return {}; } -}; - -export template -void test_prod_cons() { - thread producers[N]; - thread consumers[M]; - - struct msg_t { - int pid_; - int dat_; - }; - msg_queue 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 -struct foo {}; - -export inline void test_performance(foo<1>, foo<1>) { - test_prod_cons<1, 1>(); -} - -export template -void test_performance(foo, foo<1>) { - test_performance(foo{}, foo<1>{}); - test_prod_cons(); -}; - -export template -void test_performance(foo, foo) { - test_performance(foo{}, foo{}); - test_prod_cons(); -}; 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") - - -- cgit v1.3.1