[libcxx-commits] [libcxx] c27de23 - [libc++] tests with picolibc: Fix expected error message (#74452)
via libcxx-commits
libcxx-commits at lists.llvm.org
Tue Dec 5 06:13:06 PST 2023
Author: Dominik Wójt
Date: 2023-12-05T09:13:01-05:00
New Revision: c27de23b27dae50c5f49ad9fd69ddac9410a3e6e
URL: https://github.com/llvm/llvm-project/commit/c27de23b27dae50c5f49ad9fd69ddac9410a3e6e
DIFF: https://github.com/llvm/llvm-project/commit/c27de23b27dae50c5f49ad9fd69ddac9410a3e6e.diff
LOG: [libc++] tests with picolibc: Fix expected error message (#74452)
Newlib's strerror function returns an empty string for unknown errnum
values as described in [1].
[1]: https://sourceware.org/git/?p=newlib-cygwin.git;a=blob;f=newlib/libc/string/strerror.c;hb=HEAD
Added:
Modified:
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
Removed:
################################################################################
diff --git a/libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.objects/generic_category.pass.cpp b/libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.objects/generic_category.pass.cpp
index 3f49c36f8ba2e..068202c6e4150 100644
--- a/libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.objects/generic_category.pass.cpp
+++ b/libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.objects/generic_category.pass.cpp
@@ -7,7 +7,6 @@
//===----------------------------------------------------------------------===//
// XFAIL: stdlib=apple-libc++ && target={{.+}}-apple-macosx10.{{9|10|11|12}}
-// XFAIL: LIBCXX-PICOLIBC-FIXME
// <system_error>
@@ -48,6 +47,8 @@ int main(int, char**)
// Exact message format varies by platform.
#if defined(_AIX)
LIBCPP_ASSERT(msg.rfind("Error -1 occurred", 0) == 0);
+#elif defined(_NEWLIB_VERSION)
+ LIBCPP_ASSERT(msg.empty());
#else
LIBCPP_ASSERT(msg.rfind("Unknown error", 0) == 0);
#endif
diff --git a/libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.objects/system_category.pass.cpp b/libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.objects/system_category.pass.cpp
index 4a29e1baa808a..7c98a42b52010 100644
--- a/libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.objects/system_category.pass.cpp
+++ b/libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.objects/system_category.pass.cpp
@@ -13,7 +13,6 @@
// const error_category& system_category();
// XFAIL: stdlib=apple-libc++ && target={{.+}}-apple-macosx10.{{9|10|11|12}}
-// XFAIL: LIBCXX-PICOLIBC-FIXME
#include <system_error>
#include <cassert>
@@ -52,6 +51,8 @@ int main(int, char**)
// Exact message format varies by platform.
#if defined(_AIX)
LIBCPP_ASSERT(msg.rfind("Error -1 occurred", 0) == 0);
+#elif defined(_NEWLIB_VERSION)
+ LIBCPP_ASSERT(msg.empty());
#else
LIBCPP_ASSERT(msg.rfind("Unknown error", 0) == 0);
#endif
More information about the libcxx-commits
mailing list