From dcf5a1dfa3e592563093e862e0bb4ecd2ac3b3ba Mon Sep 17 00:00:00 2001 From: Arthur LAURENT Date: Wed, 3 Aug 2022 02:36:31 +0200 Subject: [C++20 Modules] Add tests for headerunits --- tests/projects/c++/modules/stl_headerunit/src/hello.mpp | 11 +++++++++++ tests/projects/c++/modules/stl_headerunit/src/main.cpp | 6 ++++++ 2 files changed, 17 insertions(+) create mode 100644 tests/projects/c++/modules/stl_headerunit/src/hello.mpp create mode 100644 tests/projects/c++/modules/stl_headerunit/src/main.cpp (limited to 'tests/projects/c++/modules/stl_headerunit/src') 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 ; + +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; +} -- cgit v1.3.1