[libcxx] r208840 - Work around ABI differences due to LWG 2056 in tests

Justin Bogner mail at justinbogner.com
Wed May 14 18:57:42 PDT 2014


Author: bogner
Date: Wed May 14 20:57:42 2014
New Revision: 208840

URL: http://llvm.org/viewvc/llvm-project?rev=208840&view=rev
Log:
Work around ABI differences due to LWG 2056 in tests

When testing against the system library, there is a relatively minor
ABI breakage that the std::future_errc values have been changed to
avoid using zero. Update the tests that rely on the values being
consistent.

Modified:
    libcxx/trunk/test/thread/futures/futures.future_error/what.pass.cpp
    libcxx/trunk/test/thread/futures/futures.promise/dtor.pass.cpp

Modified: libcxx/trunk/test/thread/futures/futures.future_error/what.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/thread/futures/futures.future_error/what.pass.cpp?rev=208840&r1=208839&r2=208840&view=diff
==============================================================================
--- libcxx/trunk/test/thread/futures/futures.future_error/what.pass.cpp (original)
+++ libcxx/trunk/test/thread/futures/futures.future_error/what.pass.cpp Wed May 14 20:57:42 2014
@@ -7,6 +7,13 @@
 //
 //===----------------------------------------------------------------------===//
 
+// LWG 2056 changed the values of future_errc, so if we're using new headers
+// with an old library we'll get incorrect messages.
+//
+// XFAIL: x86_64-apple-darwin11
+// XFAIL: x86_64-apple-darwin12
+// XFAIL: x86_64-apple-darwin13
+
 // <future>
 
 // class future_error

Modified: libcxx/trunk/test/thread/futures/futures.promise/dtor.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/thread/futures/futures.promise/dtor.pass.cpp?rev=208840&r1=208839&r2=208840&view=diff
==============================================================================
--- libcxx/trunk/test/thread/futures/futures.promise/dtor.pass.cpp (original)
+++ libcxx/trunk/test/thread/futures/futures.promise/dtor.pass.cpp Wed May 14 20:57:42 2014
@@ -100,7 +100,15 @@ int main()
         }
         catch (const std::future_error& e)
         {
-            assert(e.code() == make_error_code(std::future_errc::broken_promise));
+            // LWG 2056 changed the values of future_errc, so if we're using new
+            // headers with an old library the error codes won't line up.
+            //
+            // Note that this particular check only applies to promise<void>
+            // since the other specializations happen to be implemented in the
+            // header rather than the library.
+            assert(
+                e.code() == make_error_code(std::future_errc::broken_promise) ||
+                e.code() == std::error_code(0, std::future_category()));
         }
     }
 }





More information about the cfe-commits mailing list