[libcxx-commits] [PATCH] D122718: [libcxx] [test] Avoid spurious test breakage in clang-cl-dll configs with newer CMake

Martin Storsjö via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Mar 30 03:48:11 PDT 2022


mstorsjo created this revision.
mstorsjo added a reviewer: ldionne.
Herald added a project: All.
mstorsjo requested review of this revision.
Herald added a project: libc++.
Herald added a reviewer: libc++.

The pointer.volatile.pass.cpp test was already marked as XFAIL for
mingw-dll (for reasons explained in the comment above it).

The same issue also appears in clang-cl-dll when built with newer
CMake versions. (It didn't appear with older versions of CMake, as
CMake built the library with the clang-cl flag `-std:c++latest` when
we've requested C++ 20 - which practically built it in c++2b mode with
current clang versions. With current versions of CMake, it passes
`-std:c++20` instead.)

As it succeeds/fails dependent on factors we don't
directly control, mark it as UNSUPPORTED instead of XFAIL.

This probably also needs to be backported to the 14.x branch, to
avoid spurious failures there, if the CI runners are upgraded to
a newer version of CMake.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D122718

Files:
  libcxx/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/pointer.volatile.pass.cpp


Index: libcxx/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/pointer.volatile.pass.cpp
===================================================================
--- libcxx/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/pointer.volatile.pass.cpp
+++ libcxx/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/pointer.volatile.pass.cpp
@@ -10,12 +10,20 @@
 
 // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
 
-// This test fails on MinGW DLL configurations, due to
+// This test fails in Windows DLL configurations, due to
 // __exclude_from_explicit_instantiation__ not behaving as it should in
 // combination with dllimport (https://llvm.org/PR41018), in combination
 // with running tests in c++2b mode while building the library in c++20 mode.
-// (If the library was built in c++2b mode, this test would succeed.)
-// XFAIL: target={{.+}}-windows-gnu && windows-dll
+//
+// If the library was built in c++2b mode, this test would succeed.
+//
+// Older CMake passed -std:c++latest to set C++ 20 mode on clang-cl, which
+// hid this issue. With newer CMake versions, it passes -std:c++20 which
+// makes this fail.
+//
+// Marking as UNSUPPORTED instead of XFAIL to avoid spurious failures/successes
+// depending on the version of CMake used.
+// UNSUPPORTED: windows-dll
 
 // template <class charT, class traits = char_traits<charT> >
 //   class basic_ostream;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D122718.419095.patch
Type: text/x-patch
Size: 1518 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20220330/ff360c6f/attachment.bin>


More information about the libcxx-commits mailing list