[PATCH] D20730: [libcxx] Prefer UNSUPPORTED over conditional compilation for tests

Asiri Rathnayake via cfe-commits cfe-commits at lists.llvm.org
Fri May 27 07:41:55 PDT 2016


rmaprath created this revision.
rmaprath added a reviewer: EricWF.
rmaprath added a subscriber: cfe-commits.

We seem to have quite a few tests where an entire test is conditionalized over some range of `_LIBCPP_STD_VER`. We should consider getting rid of these and using the UNSUPPORTED lit directive instead.

This is mostly cosmetic, but sometimes can create problems if there are also XFAIL conditions on the same test. The test will be reported as an unexpected-pass when run with a `std=` option not compatible with the `_LIBCPP_STD_VER` check (because the test is trivially empty, it will pass rather than XFAIL).

I've attached a sample patch for one of the cases. If this looks OK, I can commit the whole hog.

http://reviews.llvm.org/D20730

Files:
  test/libcxx/experimental/containers/sequences/dynarray/dynarray.overview/at.pass.cpp

Index: test/libcxx/experimental/containers/sequences/dynarray/dynarray.overview/at.pass.cpp
===================================================================
--- test/libcxx/experimental/containers/sequences/dynarray/dynarray.overview/at.pass.cpp
+++ test/libcxx/experimental/containers/sequences/dynarray/dynarray.overview/at.pass.cpp
@@ -7,6 +7,7 @@
 //
 //===----------------------------------------------------------------------===//
 
+// UNSUPPORTED: c++98, c++03, c++11
 // XFAIL: libcpp-no-exceptions
 // dynarray.overview
 
@@ -15,8 +16,6 @@
   
 #include <__config>
 
-#if _LIBCPP_STD_VER > 11
-
 #include <experimental/dynarray>
 #include <cassert>
 
@@ -90,6 +89,3 @@
     test<std::complex<double>> ( {} );
     test<std::string> ( {} );
 }
-#else
-int main() {}
-#endif


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D20730.58781.patch
Type: text/x-patch
Size: 786 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160527/229a337e/attachment.bin>


More information about the cfe-commits mailing list