diff options
author | Brad King <brad.king@kitware.com> | 2023-12-06 13:51:53 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2023-12-06 13:52:07 (GMT) |
commit | ca1e00e2bf0e389ebe2f255ffed3f4b46f1bc82c (patch) | |
tree | d72a4b76045b7306ead2b3024cd5c0f689a6dd5f /Tests | |
parent | ffb200be60edc45075859bf19a665065764de900 (diff) | |
parent | e63983956d973e9f3bcc6af03eaf00bf0e3f59b5 (diff) | |
download | CMake-ca1e00e2bf0e389ebe2f255ffed3f4b46f1bc82c.zip CMake-ca1e00e2bf0e389ebe2f255ffed3f4b46f1bc82c.tar.gz CMake-ca1e00e2bf0e389ebe2f255ffed3f4b46f1bc82c.tar.bz2 |
Merge topic 'cxxmodules-msvc-corner-cases'
e63983956d Tests/CXXModules: enhance `internal-partitions` test
8a658fb9ec Tests/CXXModules: import from an internal partition
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9039
Diffstat (limited to 'Tests')
5 files changed, 27 insertions, 3 deletions
diff --git a/Tests/RunCMake/CXXModules/examples/internal-partitions/CMakeLists.txt b/Tests/RunCMake/CXXModules/examples/internal-partitions/CMakeLists.txt index bf99f7c..ecbae34 100644 --- a/Tests/RunCMake/CXXModules/examples/internal-partitions/CMakeLists.txt +++ b/Tests/RunCMake/CXXModules/examples/internal-partitions/CMakeLists.txt @@ -19,7 +19,8 @@ target_sources(internal-partitions "${CMAKE_CURRENT_SOURCE_DIR}" FILES importable.cxx - partition.cxx) + partition.cxx + internal.cxx) target_compile_features(internal-partitions PUBLIC cxx_std_20) add_executable(exe) diff --git a/Tests/RunCMake/CXXModules/examples/internal-partitions/importable.cxx b/Tests/RunCMake/CXXModules/examples/internal-partitions/importable.cxx index 3b3d313..b180cb0 100644 --- a/Tests/RunCMake/CXXModules/examples/internal-partitions/importable.cxx +++ b/Tests/RunCMake/CXXModules/examples/internal-partitions/importable.cxx @@ -3,6 +3,12 @@ import :internal_partition; #include "internal-partitions_export.h" +export struct module_struct +{ +private: + partition_struct p; +}; + export INTERNAL_PARTITIONS_EXPORT int from_import() { return from_partition(); diff --git a/Tests/RunCMake/CXXModules/examples/internal-partitions/internal.cxx b/Tests/RunCMake/CXXModules/examples/internal-partitions/internal.cxx new file mode 100644 index 0000000..9dc1470 --- /dev/null +++ b/Tests/RunCMake/CXXModules/examples/internal-partitions/internal.cxx @@ -0,0 +1,11 @@ +export module internal; + +export struct internal_struct +{ + int x; +}; + +export int from_internal() +{ + return 0; +} diff --git a/Tests/RunCMake/CXXModules/examples/internal-partitions/main.cxx b/Tests/RunCMake/CXXModules/examples/internal-partitions/main.cxx index feb38d2..692a470 100644 --- a/Tests/RunCMake/CXXModules/examples/internal-partitions/main.cxx +++ b/Tests/RunCMake/CXXModules/examples/internal-partitions/main.cxx @@ -2,5 +2,5 @@ import importable; int main(int argc, char* argv[]) { - return from_import(); + return from_import() * sizeof(module_struct); } diff --git a/Tests/RunCMake/CXXModules/examples/internal-partitions/partition.cxx b/Tests/RunCMake/CXXModules/examples/internal-partitions/partition.cxx index c828612..67ab2ff3 100644 --- a/Tests/RunCMake/CXXModules/examples/internal-partitions/partition.cxx +++ b/Tests/RunCMake/CXXModules/examples/internal-partitions/partition.cxx @@ -1,6 +1,12 @@ module importable:internal_partition; +import internal; + +struct partition_struct +{ + internal_struct i; +}; int from_partition() { - return 0; + return from_internal(); } |