[libcxx-commits] [PATCH] D156550: [libc++][test] Fixes using modules in the test suite.

Mark de Wever via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Jul 31 09:37:19 PDT 2023


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGd7915c8aa950: [libc++][test] Fixes using modules in the test suite. (authored by Mordante).

Changed prior to commit:
  https://reviews.llvm.org/D156550?vs=545351&id=545709#toc

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D156550/new/

https://reviews.llvm.org/D156550

Files:
  libcxx/test/std/modules/std.pass.cpp
  libcxx/utils/libcxx/test/dsl.py


Index: libcxx/utils/libcxx/test/dsl.py
===================================================================
--- libcxx/utils/libcxx/test/dsl.py
+++ libcxx/utils/libcxx/test/dsl.py
@@ -456,8 +456,12 @@
     flags = _getSubstitution('%{flags}', config)
     cmake = _getSubstitution('%{cmake}', config)
 
-    subprocess.check_call([cmake, "-DCMAKE_CXX_STANDARD=" + std, f"-DCMAKE_CXX_FLAGS={flags}", build], env={})
-    subprocess.check_call([cmake, "--build", build], env={})
+    subprocess.check_call([cmake, f"-DCMAKE_CXX_STANDARD={std}", f"-DCMAKE_CXX_FLAGS={flags}", build], env={})
+    subprocess.check_call([cmake, "--build", build, "--", "-v"], env={})
+    config.substitutions = _appendToSubstitution(
+       # TODO MODULES Avoid manually modifying link_flags.
+       config.substitutions, "%{link_flags}",  os.path.join(build, "libc++std.a")
+    )
 
   def pretty(self, config, litParams):
     return "building std module with flags {}".format(_getSubstitution('%{flags}', config))
Index: libcxx/test/std/modules/std.pass.cpp
===================================================================
--- /dev/null
+++ libcxx/test/std/modules/std.pass.cpp
@@ -0,0 +1,22 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTEd: c++03, c++11, c++14, c++17, c++20
+// TODO MODULES fix c++26
+// XFAIL: c++26
+
+// REQUIRES: use_module_std
+
+// A minimal test to validate import works.
+
+import std;
+
+int main(int, char**) {
+  std::println("Hello modular world");
+  return 0;
+}


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D156550.545709.patch
Type: text/x-patch
Size: 1831 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20230731/67875cf0/attachment.bin>


More information about the libcxx-commits mailing list