Sfoglia il codice sorgente

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.
Ben Boeckel 2 anni fa
parent
commit
8a658fb9ec

+ 2 - 1
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)

+ 6 - 0
Tests/RunCMake/CXXModules/examples/internal-partitions/internal.cxx

@@ -0,0 +1,6 @@
+export module internal;
+
+export int from_internal()
+{
+  return 0;
+}

+ 2 - 1
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();
 }