summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2023-12-05 13:02:51 (GMT)
committerBen Boeckel <ben.boeckel@kitware.com>2023-12-05 13:17:46 (GMT)
commit8a658fb9ecd48492a5cf6beefad8e691649aaf76 (patch)
tree4b876f2551b88675f33daafdf373d63b93b1eed8 /Tests
parentb9970be9bcadc8f7c45f7603ad6eb1c75620608a (diff)
downloadCMake-8a658fb9ecd48492a5cf6beefad8e691649aaf76.zip
CMake-8a658fb9ecd48492a5cf6beefad8e691649aaf76.tar.gz
CMake-8a658fb9ecd48492a5cf6beefad8e691649aaf76.tar.bz2
Tests/CXXModules: import from an internal partition
It is reported that MSVC doesn't support the `modname=` syntax in its `-reference modname=modname.ifc` for internal partitions. Add a test case.
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/CXXModules/examples/internal-partitions/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/CXXModules/examples/internal-partitions/internal.cxx6
-rw-r--r--Tests/RunCMake/CXXModules/examples/internal-partitions/partition.cxx3
3 files changed, 10 insertions, 2 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/internal.cxx b/Tests/RunCMake/CXXModules/examples/internal-partitions/internal.cxx
new file mode 100644
index 0000000..1e9d108
--- /dev/null
+++ b/Tests/RunCMake/CXXModules/examples/internal-partitions/internal.cxx
@@ -0,0 +1,6 @@
+export module internal;
+
+export int from_internal()
+{
+ return 0;
+}
diff --git a/Tests/RunCMake/CXXModules/examples/internal-partitions/partition.cxx b/Tests/RunCMake/CXXModules/examples/internal-partitions/partition.cxx
index c828612..3d3d92c 100644
--- a/Tests/RunCMake/CXXModules/examples/internal-partitions/partition.cxx
+++ b/Tests/RunCMake/CXXModules/examples/internal-partitions/partition.cxx
@@ -1,6 +1,7 @@
module importable:internal_partition;
+import internal;
int from_partition()
{
- return 0;
+ return from_internal();
}