[libcxx-dev] How to check for a feature-test macro

Casey Carter via libcxx-dev libcxx-dev at lists.llvm.org
Mon Dec 10 17:14:45 PST 2018


I don't have context for the original issue, but our test selector does inspect some of the LIT control comments. Specifically, it skips tests with any of the comments:

// REQUIRES: c++11
// REQUIRES: c++11 || c++14
// REQUIRES: c++98 || c++03
// REQUIRES: c++98 || c++03 || c++11 || c++14
// UNSUPPORTED: c++14, c++17, c++2a

So if were talking about something that doesn't touch those, it won't affect our typical usage.


________________________________
From: Stephan T. Lavavej
Sent: Monday, December 10, 2018 15:43
To: Jonathan Wakely; ldionne at apple.com
Cc: Richard Smith; Marshall Clow; libcxx-dev at lists.llvm.org; Billy O'Neal (VC LIBS); Casey Carter
Subject: RE: [libcxx-dev] How to check for a feature-test macro

(+Casey who also works on this)

When running libcxx's tests against MSVC's STL, we have an MSVC-internal skipped_tests.txt (full content available if requested) which says:

# *** MISSING STL FEATURES ***
# C++20 P0122R7 "<span>"
upstream\test\std\containers\views\types.pass.cpp
[...]

# C++20 P0355R7 "<chrono> Calendars And Time Zones"
upstream\test\std\utilities\time\days.pass.cpp
[...]

Updating this requires minimal effort. It's more problematic when existing tests are modified to test new features, since we have to skip the entire test even if only a small part is affected.

Guarding tests with feature-test macros in their source code (as opposed to "the LIT level", which I believe is machinery that we don't use) would be ideal, I think.

The annoying thing is when features are added without corresponding feature-test macros. There's a bunch of those right now. We'll probably need the skip-tests approach for those.

STL

-----Original Message-----
From: Jonathan Wakely <cxx at kayari.org>
Sent: Monday, December 10, 2018 12:10 PM
To: ldionne at apple.com
Cc: Richard Smith <richard at metafoo.co.uk>; Marshall Clow <mclow.lists at gmail.com>; libcxx-dev at lists.llvm.org; Stephan T. Lavavej <stl at exchange.microsoft.com>; Billy O'Neal (VC LIBS) <bion at microsoft.com>
Subject: Re: [libcxx-dev] How to check for a feature-test macro

On Mon, 10 Dec 2018 at 19:47, Louis Dionne wrote:
> We should also see how other implementations that use our test suite feel about this (CCing them).

I only use your tests a few times a year, run by hand. If I get a load of FAILs because I've not implemented something yet and you have, that's not a problem. I don't expect to get 100% green when I run your tests.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/libcxx-dev/attachments/20181211/268e3ac6/attachment.html>


More information about the libcxx-dev mailing list