[libcxx-commits] [PATCH] D119982: [libc++][AIX] Add AIX error message as expected output

Zarko Todorovski via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Feb 16 15:02:39 PST 2022


ZarkoCA created this revision.
ZarkoCA added reviewers: ldionne, daltenty, hubert.reinterpretcast, PowerPC, libc++.
ZarkoCA requested review of this revision.
Herald added a project: libc++.
Herald added a subscriber: libcxx-commits.
Herald added 1 blocking reviewer(s): libc++.

AIX's libc generates "Error -1 occurred" instead of the "Unknown Error"
expected by these test cases. Add this as expected output for AIX only.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D119982

Files:
  libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.objects/generic_category.pass.cpp
  libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.objects/system_category.pass.cpp


Index: libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.objects/system_category.pass.cpp
===================================================================
--- libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.objects/system_category.pass.cpp
+++ libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.objects/system_category.pass.cpp
@@ -14,7 +14,6 @@
 
 // XFAIL: suse-linux-enterprise-server-11
 // XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
-// XFAIL: LIBCXX-AIX-FIXME
 
 #include <system_error>
 #include <cassert>
@@ -28,7 +27,11 @@
     const std::error_category& e_cat1 = std::system_category();
     const std::string msg = e_cat1.message(-1);
     // Exact message format varies by platform.
+    #if defined(_AIX)
+    LIBCPP_ASSERT(msg.rfind("Error -1 occurred", 0) == 0);
+    #else
     LIBCPP_ASSERT(msg.rfind("Unknown error", 0) == 0);
+    #endif
     assert(errno == E2BIG);
 }
 
Index: libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.objects/generic_category.pass.cpp
===================================================================
--- libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.objects/generic_category.pass.cpp
+++ libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.objects/generic_category.pass.cpp
@@ -8,7 +8,6 @@
 
 // XFAIL: suse-linux-enterprise-server-11
 // XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
-// XFAIL: LIBCXX-AIX-FIXME
 
 // <system_error>
 
@@ -28,7 +27,11 @@
     const std::error_category& e_cat1 = std::generic_category();
     const std::string msg = e_cat1.message(-1);
     // Exact message format varies by platform.
+    #if defined(_AIX)
+    LIBCPP_ASSERT(msg.rfind("Error -1 occurred", 0) == 0);
+    #else
     LIBCPP_ASSERT(msg.rfind("Unknown error", 0) == 0);
+    #endif
     assert(errno == E2BIG);
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D119982.409425.patch
Type: text/x-patch
Size: 1906 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20220216/2253a4dc/attachment-0001.bin>


More information about the libcxx-commits mailing list