[llvm-branch-commits] [libcxx] [libc++][modules] Adds module testing. (PR #76246)

Mark de Wever via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed Jan 10 10:07:07 PST 2024


================
@@ -131,13 +138,65 @@ def parseScript(test, preamble):
     script += preamble
     script += scriptInTest
 
+    has_std_module = False
+    has_std_compat_module = False
+    for module in modules:
+        if module == "std":
+            has_std_module = True
+        elif module == "std.compat":
+            has_std_compat_module = True
+        else:
+            script.insert(
+                0,
+                f"echo \"The module '{module}' is not valid, use 'std' or 'std.compat'\"",
+            )
+            script.insert(1, "false")
+            return script
+
+    if modules:
+        # This flag is needed for both modules.
+        moduleCompileFlags.append("-fprebuilt-module-path=%T")
----------------
mordante wrote:

Thanks for the clarification. I'm not too bothered by it. In libc++ we indeed want to build the modules manually to avoid additional dependencies in the test-suite. 

https://github.com/llvm/llvm-project/pull/76246


More information about the llvm-branch-commits mailing list