[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
Sat Jul 29 02:06:59 PDT 2023


Mordante updated this revision to Diff 545351.
Mordante added a comment.

Rebased to trigger CI.


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,11 @@
     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(
+       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,21 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+// 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.545351.patch
Type: text/x-patch
Size: 1744 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20230729/5e0e1e8b/attachment.bin>


More information about the libcxx-commits mailing list