[libc-commits] [libc] Fix/reapply "[libc] Migrate stdio tests to ErrnoCheckingTest." (PR #143972)

LLVM Continuous Integration via libc-commits libc-commits at lists.llvm.org
Fri Jun 13 10:48:17 PDT 2025


llvm-ci wrote:

LLVM Buildbot has detected a new failure on builder `libc-riscv64-debian-fullbuild-dbg` running on `libc-riscv64-debian` while building `libc` at step 4 "annotate".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/183/builds/14670

<details>
<summary>Here is the relevant piece of the build log for the reference</summary>

```
Step 4 (annotate) failure: 'python ../llvm-zorg/zorg/buildbot/builders/annotated/libc-linux.py ...' (failure)
...
[ RUN      ] LlvmLibcFOpenCookieTest.WriteOnlyCookieTest
[       OK ] LlvmLibcFOpenCookieTest.WriteOnlyCookieTest (15 us)
[ RUN      ] LlvmLibcFOpenCookieTest.AppendOnlyCookieTest
[       OK ] LlvmLibcFOpenCookieTest.AppendOnlyCookieTest (20 us)
[ RUN      ] LlvmLibcFOpenCookieTest.ReadUpdateCookieTest
[       OK ] LlvmLibcFOpenCookieTest.ReadUpdateCookieTest (15 us)
[ RUN      ] LlvmLibcFOpenCookieTest.WriteUpdateCookieTest
[       OK ] LlvmLibcFOpenCookieTest.WriteUpdateCookieTest (12 us)
Ran 5 tests.  PASS: 5  FAIL: 0
[781/1107] Building CXX object libc/test/src/stdio/CMakeFiles/libc.test.src.stdio.fgets_test.__unit__.__build__.dir/fgets_test.cpp.o
FAILED: libc/test/src/stdio/CMakeFiles/libc.test.src.stdio.fgets_test.__unit__.__build__.dir/fgets_test.cpp.o 
/usr/bin/clang++ -DLIBC_NAMESPACE=__llvm_libc_20_0_0_git -D_DEBUG -I/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc -isystem /home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/build/libc/include -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wstring-conversion -fdiagnostics-color -g -DLIBC_QSORT_IMPL=LIBC_QSORT_QUICK_SORT -DLIBC_ADD_NULL_CHECKS -fpie -DLIBC_FULL_BUILD -ffreestanding -fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables -fno-rtti -Wconversion -Wno-sign-conversion -Wimplicit-fallthrough -Wwrite-strings -Wno-c99-extensions -Wno-gnu-imaginary-constant -Wno-pedantic -Wstrict-prototypes -Wextra-semi -Wnewline-eof -Wnonportable-system-include-path -Wthread-safety -std=gnu++17 -MD -MT libc/test/src/stdio/CMakeFiles/libc.test.src.stdio.fgets_test.__unit__.__build__.dir/fgets_test.cpp.o -MF libc/test/src/stdio/CMakeFiles/libc.test.src.stdio.fgets_test.__unit__.__build__.dir/fgets_test.cpp.o.d -o libc/test/src/stdio/CMakeFiles/libc.test.src.stdio.fgets_test.__unit__.__build__.dir/fgets_test.cpp.o -c /home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/test/src/stdio/fgets_test.cpp
In file included from /home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/test/src/stdio/fgets_test.cpp:15:
In file included from /home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/test/UnitTest/ErrnoCheckingTest.h:14:
In file included from /home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/test/UnitTest/Test.h:37:
/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/test/UnitTest/LibcTest.h:203:36: error: cannot initialize a parameter of type 'nullptr_t' with an lvalue of type 'char *'
    return testMatch(Matcher.match(Value), Matcher, ValueStr, MatcherStr, Loc);
                                   ^~~~~
/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/test/src/stdio/fgets_test.cpp:38:3: note: in instantiation of function template specialization '__llvm_libc_20_0_0_git::testing::Test::matchAndExplain<__llvm_libc_20_0_0_git::testing::internal::ErrnoSetterMatcher<nullptr_t>, char *>' requested here
  ASSERT_THAT(LIBC_NAMESPACE::fgets(buff, 8, file), Fails(EBADF, nullptr));
  ^
/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/test/UnitTest/LibcTest.h:511:3: note: expanded from macro 'ASSERT_THAT'
  LIBC_TEST_MATCH_(MATCHER, MATCH, #MATCHER, #MATCH, return)
  ^
/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/test/UnitTest/LibcTest.h:504:26: note: expanded from macro 'LIBC_TEST_MATCH_'
  LIBC_TEST_SCAFFOLDING_(matchAndExplain(MATCHER, MATCH, MATCHER_STR,          \
                         ^
/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/test/UnitTest/ErrnoSetterMatcher.h:115:16: note: passing argument to parameter 'got' here
  bool match(T got) {
               ^
/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/test/UnitTest/ErrnoSetterMatcher.h:42:21: error: invalid operands to binary expression ('nullptr_t' and 'nullptr_t')
      return actual >= expected;
             ~~~~~~ ^  ~~~~~~~~
/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/test/UnitTest/ErrnoSetterMatcher.h:122:25: note: in instantiation of member function '__llvm_libc_20_0_0_git::testing::internal::Comparator<nullptr_t>::compare' requested here
      return return_cmp.compare(actual_return) &&
                        ^
/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/test/UnitTest/LibcTest.h:203:30: note: in instantiation of member function '__llvm_libc_20_0_0_git::testing::internal::ErrnoSetterMatcher<nullptr_t>::match' requested here
    return testMatch(Matcher.match(Value), Matcher, ValueStr, MatcherStr, Loc);
                             ^
/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/test/src/stdio/fgets_test.cpp:38:3: note: in instantiation of function template specialization '__llvm_libc_20_0_0_git::testing::Test::matchAndExplain<__llvm_libc_20_0_0_git::testing::internal::ErrnoSetterMatcher<nullptr_t>, char *>' requested here
  ASSERT_THAT(LIBC_NAMESPACE::fgets(buff, 8, file), Fails(EBADF, nullptr));
  ^
/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/test/UnitTest/LibcTest.h:511:3: note: expanded from macro 'ASSERT_THAT'
  LIBC_TEST_MATCH_(MATCHER, MATCH, #MATCHER, #MATCH, return)
  ^
/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/test/UnitTest/LibcTest.h:504:26: note: expanded from macro 'LIBC_TEST_MATCH_'
  LIBC_TEST_SCAFFOLDING_(matchAndExplain(MATCHER, MATCH, MATCHER_STR,          \
                         ^
In file included from /home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/test/src/stdio/fgets_test.cpp:16:
Step 8 (libc-unit-tests) failure: libc-unit-tests (failure)
...
[ RUN      ] LlvmLibcFOpenCookieTest.WriteOnlyCookieTest
[       OK ] LlvmLibcFOpenCookieTest.WriteOnlyCookieTest (15 us)
[ RUN      ] LlvmLibcFOpenCookieTest.AppendOnlyCookieTest
[       OK ] LlvmLibcFOpenCookieTest.AppendOnlyCookieTest (20 us)
[ RUN      ] LlvmLibcFOpenCookieTest.ReadUpdateCookieTest
[       OK ] LlvmLibcFOpenCookieTest.ReadUpdateCookieTest (15 us)
[ RUN      ] LlvmLibcFOpenCookieTest.WriteUpdateCookieTest
[       OK ] LlvmLibcFOpenCookieTest.WriteUpdateCookieTest (12 us)
Ran 5 tests.  PASS: 5  FAIL: 0
[781/1107] Building CXX object libc/test/src/stdio/CMakeFiles/libc.test.src.stdio.fgets_test.__unit__.__build__.dir/fgets_test.cpp.o
FAILED: libc/test/src/stdio/CMakeFiles/libc.test.src.stdio.fgets_test.__unit__.__build__.dir/fgets_test.cpp.o 
/usr/bin/clang++ -DLIBC_NAMESPACE=__llvm_libc_20_0_0_git -D_DEBUG -I/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc -isystem /home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/build/libc/include -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wstring-conversion -fdiagnostics-color -g -DLIBC_QSORT_IMPL=LIBC_QSORT_QUICK_SORT -DLIBC_ADD_NULL_CHECKS -fpie -DLIBC_FULL_BUILD -ffreestanding -fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables -fno-rtti -Wconversion -Wno-sign-conversion -Wimplicit-fallthrough -Wwrite-strings -Wno-c99-extensions -Wno-gnu-imaginary-constant -Wno-pedantic -Wstrict-prototypes -Wextra-semi -Wnewline-eof -Wnonportable-system-include-path -Wthread-safety -std=gnu++17 -MD -MT libc/test/src/stdio/CMakeFiles/libc.test.src.stdio.fgets_test.__unit__.__build__.dir/fgets_test.cpp.o -MF libc/test/src/stdio/CMakeFiles/libc.test.src.stdio.fgets_test.__unit__.__build__.dir/fgets_test.cpp.o.d -o libc/test/src/stdio/CMakeFiles/libc.test.src.stdio.fgets_test.__unit__.__build__.dir/fgets_test.cpp.o -c /home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/test/src/stdio/fgets_test.cpp
In file included from /home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/test/src/stdio/fgets_test.cpp:15:
In file included from /home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/test/UnitTest/ErrnoCheckingTest.h:14:
In file included from /home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/test/UnitTest/Test.h:37:
/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/test/UnitTest/LibcTest.h:203:36: error: cannot initialize a parameter of type 'nullptr_t' with an lvalue of type 'char *'
    return testMatch(Matcher.match(Value), Matcher, ValueStr, MatcherStr, Loc);
                                   ^~~~~
/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/test/src/stdio/fgets_test.cpp:38:3: note: in instantiation of function template specialization '__llvm_libc_20_0_0_git::testing::Test::matchAndExplain<__llvm_libc_20_0_0_git::testing::internal::ErrnoSetterMatcher<nullptr_t>, char *>' requested here
  ASSERT_THAT(LIBC_NAMESPACE::fgets(buff, 8, file), Fails(EBADF, nullptr));
  ^
/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/test/UnitTest/LibcTest.h:511:3: note: expanded from macro 'ASSERT_THAT'
  LIBC_TEST_MATCH_(MATCHER, MATCH, #MATCHER, #MATCH, return)
  ^
/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/test/UnitTest/LibcTest.h:504:26: note: expanded from macro 'LIBC_TEST_MATCH_'
  LIBC_TEST_SCAFFOLDING_(matchAndExplain(MATCHER, MATCH, MATCHER_STR,          \
                         ^
/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/test/UnitTest/ErrnoSetterMatcher.h:115:16: note: passing argument to parameter 'got' here
  bool match(T got) {
               ^
/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/test/UnitTest/ErrnoSetterMatcher.h:42:21: error: invalid operands to binary expression ('nullptr_t' and 'nullptr_t')
      return actual >= expected;
             ~~~~~~ ^  ~~~~~~~~
/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/test/UnitTest/ErrnoSetterMatcher.h:122:25: note: in instantiation of member function '__llvm_libc_20_0_0_git::testing::internal::Comparator<nullptr_t>::compare' requested here
      return return_cmp.compare(actual_return) &&
                        ^
/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/test/UnitTest/LibcTest.h:203:30: note: in instantiation of member function '__llvm_libc_20_0_0_git::testing::internal::ErrnoSetterMatcher<nullptr_t>::match' requested here
    return testMatch(Matcher.match(Value), Matcher, ValueStr, MatcherStr, Loc);
                             ^
/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/test/src/stdio/fgets_test.cpp:38:3: note: in instantiation of function template specialization '__llvm_libc_20_0_0_git::testing::Test::matchAndExplain<__llvm_libc_20_0_0_git::testing::internal::ErrnoSetterMatcher<nullptr_t>, char *>' requested here
  ASSERT_THAT(LIBC_NAMESPACE::fgets(buff, 8, file), Fails(EBADF, nullptr));
  ^
/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/test/UnitTest/LibcTest.h:511:3: note: expanded from macro 'ASSERT_THAT'
  LIBC_TEST_MATCH_(MATCHER, MATCH, #MATCHER, #MATCH, return)
  ^
/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/test/UnitTest/LibcTest.h:504:26: note: expanded from macro 'LIBC_TEST_MATCH_'
  LIBC_TEST_SCAFFOLDING_(matchAndExplain(MATCHER, MATCH, MATCHER_STR,          \
                         ^
In file included from /home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/test/src/stdio/fgets_test.cpp:16:

```

</details>

https://github.com/llvm/llvm-project/pull/143972


More information about the libc-commits mailing list