Skip to content

[libc] Migrate stdio tests to ErrnoCheckingTest. #143802

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 11, 2025

Conversation

vonosmas
Copy link
Contributor

Reduce the direct use of libc_errno in stdio unit tests by adopting ErrnoCheckingTest where appropriate.

Also removes the libc_errno.h inclusions from stdlib.h tests that were accidentally added in d87eea3

Reduce the direct use of libc_errno in stdio unit tests by adopting
ErrnoCheckingTest where appropriate.

Also removes the libc_errno.h inclusions from stdlib.h tests that
were accidentally added in d87eea3
@vonosmas vonosmas requested a review from lntue June 11, 2025 23:04
@llvmbot llvmbot added the libc label Jun 11, 2025
@llvmbot
Copy link
Member

llvmbot commented Jun 11, 2025

@llvm/pr-subscribers-libc

Author: Alexey Samsonov (vonosmas)

Changes

Reduce the direct use of libc_errno in stdio unit tests by adopting ErrnoCheckingTest where appropriate.

Also removes the libc_errno.h inclusions from stdlib.h tests that were accidentally added in d87eea3


Patch is 21.45 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/143802.diff

13 Files Affected:

  • (modified) libc/test/src/stdio/CMakeLists.txt (+10)
  • (modified) libc/test/src/stdio/fdopen_test.cpp (+6-8)
  • (modified) libc/test/src/stdio/fgetc_test.cpp (+2-3)
  • (modified) libc/test/src/stdio/fgetc_unlocked_test.cpp (+2-3)
  • (modified) libc/test/src/stdio/fgets_test.cpp (+3-3)
  • (modified) libc/test/src/stdio/fileop_test.cpp (+5-15)
  • (modified) libc/test/src/stdio/fopencookie_test.cpp (+7-8)
  • (modified) libc/test/src/stdio/remove_test.cpp (+5-5)
  • (modified) libc/test/src/stdio/rename_test.cpp (+5-4)
  • (modified) libc/test/src/stdio/setvbuf_test.cpp (+4-4)
  • (modified) libc/test/src/stdio/unlocked_fileop_test.cpp (+3-4)
  • (modified) libc/test/src/stdlib/StrtolTest.h (-1)
  • (modified) libc/test/src/stdlib/strtold_test.cpp (-1)
diff --git a/libc/test/src/stdio/CMakeLists.txt b/libc/test/src/stdio/CMakeLists.txt
index 01904a30504ed..3627006ec28fd 100644
--- a/libc/test/src/stdio/CMakeLists.txt
+++ b/libc/test/src/stdio/CMakeLists.txt
@@ -20,6 +20,7 @@ add_libc_test(
     libc.src.stdio.fread
     libc.src.stdio.fseek
     libc.src.stdio.fwrite
+    libc.test.UnitTest.ErrnoCheckingTest
 )
 
 add_libc_test(
@@ -68,6 +69,7 @@ add_libc_test(
     libc.src.stdio.fread
     libc.src.stdio.fwrite
     libc.src.stdio.setvbuf
+    libc.test.UnitTest.ErrnoCheckingTest
 )
 
 add_libc_test(
@@ -88,6 +90,7 @@ add_libc_test(
     libc.src.stdio.fread_unlocked
     libc.src.stdio.funlockfile
     libc.src.stdio.fwrite_unlocked
+    libc.test.UnitTest.ErrnoCheckingTest
 )
 
 add_libc_test(
@@ -109,6 +112,7 @@ add_libc_test(
     libc.src.stdio.fread
     libc.src.stdio.fseek
     libc.src.stdio.fwrite
+    libc.test.UnitTest.ErrnoCheckingTest
   LINK_LIBRARIES
     LibcMemoryHelpers
 )
@@ -426,6 +430,7 @@ if(${LIBC_TARGET_OS} STREQUAL "linux")
       libc.src.sys.stat.mkdirat
       libc.src.unistd.access
       libc.src.unistd.close
+      libc.test.UnitTest.ErrnoCheckingTest
   )
 
   add_libc_test(
@@ -440,6 +445,7 @@ if(${LIBC_TARGET_OS} STREQUAL "linux")
       libc.src.stdio.rename
       libc.src.unistd.access
       libc.src.unistd.close
+      libc.test.UnitTest.ErrnoCheckingTest
       libc.test.UnitTest.ErrnoSetterMatcher
   )
 
@@ -456,6 +462,7 @@ if(${LIBC_TARGET_OS} STREQUAL "linux")
       libc.src.stdio.fgets
       libc.src.stdio.fputs
       libc.src.unistd.close
+      libc.test.UnitTest.ErrnoCheckingTest
       libc.test.UnitTest.ErrnoSetterMatcher
   )
 endif()
@@ -476,6 +483,7 @@ add_libc_test(
     libc.src.stdio.fopen
     libc.src.stdio.fwrite
     libc.src.stdio.getc
+    libc.test.UnitTest.ErrnoCheckingTest
 )
 
 add_libc_test(
@@ -498,6 +506,7 @@ add_libc_test(
     libc.src.stdio.funlockfile
     libc.src.stdio.fwrite
     libc.src.stdio.getc_unlocked
+    libc.test.UnitTest.ErrnoCheckingTest
 )
 
 add_libc_test(
@@ -515,6 +524,7 @@ add_libc_test(
     libc.src.stdio.fgets
     libc.src.stdio.fopen
     libc.src.stdio.fwrite
+    libc.test.UnitTest.ErrnoCheckingTest
 )
 
 add_libc_test(
diff --git a/libc/test/src/stdio/fdopen_test.cpp b/libc/test/src/stdio/fdopen_test.cpp
index 104fc478b100e..b53184c30be36 100644
--- a/libc/test/src/stdio/fdopen_test.cpp
+++ b/libc/test/src/stdio/fdopen_test.cpp
@@ -9,20 +9,21 @@
 #include "src/stdio/fdopen.h"
 
 #include "hdr/fcntl_macros.h"
-#include "src/__support/libc_errno.h"
 #include "src/fcntl/open.h"
 #include "src/stdio/fclose.h"
 #include "src/stdio/fgets.h"
 #include "src/stdio/fputs.h"
 #include "src/unistd/close.h"
+#include "test/UnitTest/ErrnoCheckingTest.h"
 #include "test/UnitTest/ErrnoSetterMatcher.h"
 #include "test/UnitTest/Test.h"
 
 #include <sys/stat.h> // For S_IRWXU
 
-TEST(LlvmLibcStdioFdopenTest, WriteAppendRead) {
+using LlvmLibcStdioFdopenTest = LIBC_NAMESPACE::testing::ErrnoCheckingTest;
+
+TEST_F(LlvmLibcStdioFdopenTest, WriteAppendRead) {
   using LIBC_NAMESPACE::testing::ErrnoSetterMatcher::Succeeds;
-  libc_errno = 0;
   constexpr const char *TEST_FILE_NAME = "testdata/write_read_append.test";
   auto TEST_FILE = libc_make_test_file_path(TEST_FILE_NAME);
   int fd = LIBC_NAMESPACE::open(TEST_FILE, O_CREAT | O_TRUNC | O_RDWR, S_IRWXU);
@@ -52,8 +53,7 @@ TEST(LlvmLibcStdioFdopenTest, WriteAppendRead) {
   ASSERT_ERRNO_SUCCESS();
 }
 
-TEST(LlvmLibcStdioFdopenTest, InvalidFd) {
-  libc_errno = 0;
+TEST_F(LlvmLibcStdioFdopenTest, InvalidFd) {
   constexpr const char *TEST_FILE_NAME = "testdata/invalid_fd.test";
   auto TEST_FILE = libc_make_test_file_path(TEST_FILE_NAME);
   int fd = LIBC_NAMESPACE::open(TEST_FILE, O_CREAT | O_TRUNC);
@@ -64,8 +64,7 @@ TEST(LlvmLibcStdioFdopenTest, InvalidFd) {
   ASSERT_TRUE(nullptr == fp);
 }
 
-TEST(LlvmLibcStdioFdopenTest, InvalidMode) {
-  libc_errno = 0;
+TEST_F(LlvmLibcStdioFdopenTest, InvalidMode) {
   constexpr const char *TEST_FILE_NAME = "testdata/invalid_mode.test";
   auto TEST_FILE = libc_make_test_file_path(TEST_FILE_NAME);
   int fd = LIBC_NAMESPACE::open(TEST_FILE, O_CREAT | O_RDONLY, S_IRWXU);
@@ -83,7 +82,6 @@ TEST(LlvmLibcStdioFdopenTest, InvalidMode) {
   auto *fp2 = LIBC_NAMESPACE::fdopen(fd, "w");
   ASSERT_ERRNO_EQ(EINVAL);
   ASSERT_TRUE(nullptr == fp2);
-  libc_errno = 0;
   LIBC_NAMESPACE::close(fd);
   ASSERT_ERRNO_SUCCESS();
 }
diff --git a/libc/test/src/stdio/fgetc_test.cpp b/libc/test/src/stdio/fgetc_test.cpp
index 56bde5f0099a8..7c652f666a8f3 100644
--- a/libc/test/src/stdio/fgetc_test.cpp
+++ b/libc/test/src/stdio/fgetc_test.cpp
@@ -14,12 +14,12 @@
 #include "src/stdio/fopen.h"
 #include "src/stdio/fwrite.h"
 #include "src/stdio/getc.h"
+#include "test/UnitTest/ErrnoCheckingTest.h"
 #include "test/UnitTest/Test.h"
 
 #include "hdr/stdio_macros.h"
-#include "src/__support/libc_errno.h"
 
-class LlvmLibcGetcTest : public LIBC_NAMESPACE::testing::Test {
+class LlvmLibcGetcTest : public LIBC_NAMESPACE::testing::ErrnoCheckingTest {
 public:
   using GetcFunc = int(FILE *);
   void test_with_func(GetcFunc *func, const char *filename) {
@@ -33,7 +33,6 @@ class LlvmLibcGetcTest : public LIBC_NAMESPACE::testing::Test {
     // This is an error and not a real EOF.
     ASSERT_EQ(LIBC_NAMESPACE::feof(file), 0);
     ASSERT_NE(LIBC_NAMESPACE::ferror(file), 0);
-    libc_errno = 0;
 
     ASSERT_EQ(0, LIBC_NAMESPACE::fclose(file));
 
diff --git a/libc/test/src/stdio/fgetc_unlocked_test.cpp b/libc/test/src/stdio/fgetc_unlocked_test.cpp
index 90429ecf4e82b..f4471dd82df15 100644
--- a/libc/test/src/stdio/fgetc_unlocked_test.cpp
+++ b/libc/test/src/stdio/fgetc_unlocked_test.cpp
@@ -17,12 +17,12 @@
 #include "src/stdio/funlockfile.h"
 #include "src/stdio/fwrite.h"
 #include "src/stdio/getc_unlocked.h"
+#include "test/UnitTest/ErrnoCheckingTest.h"
 #include "test/UnitTest/Test.h"
 
 #include "hdr/stdio_macros.h"
-#include "src/__support/libc_errno.h"
 
-class LlvmLibcGetcTest : public LIBC_NAMESPACE::testing::Test {
+class LlvmLibcGetcTest : public LIBC_NAMESPACE::testing::ErrnoCheckingTest {
 public:
   using GetcFunc = int(FILE *);
   void test_with_func(GetcFunc *func, const char *filename) {
@@ -36,7 +36,6 @@ class LlvmLibcGetcTest : public LIBC_NAMESPACE::testing::Test {
     // This is an error and not a real EOF.
     ASSERT_EQ(LIBC_NAMESPACE::feof(file), 0);
     ASSERT_NE(LIBC_NAMESPACE::ferror(file), 0);
-    libc_errno = 0;
 
     ASSERT_EQ(0, LIBC_NAMESPACE::fclose(file));
 
diff --git a/libc/test/src/stdio/fgets_test.cpp b/libc/test/src/stdio/fgets_test.cpp
index abed3d4052939..c00a9256af52d 100644
--- a/libc/test/src/stdio/fgets_test.cpp
+++ b/libc/test/src/stdio/fgets_test.cpp
@@ -12,11 +12,12 @@
 #include "src/stdio/fgets.h"
 #include "src/stdio/fopen.h"
 #include "src/stdio/fwrite.h"
+#include "test/UnitTest/ErrnoCheckingTest.h"
 #include "test/UnitTest/Test.h"
 
-#include "src/__support/libc_errno.h"
+using LlvmLibcFgetsTest = LIBC_NAMESPACE::testing::ErrnoCheckingTest;
 
-TEST(LlvmLibcFgetsTest, WriteAndReadCharacters) {
+TEST_F(LlvmLibcFgetsTest, WriteAndReadCharacters) {
   constexpr char FILENAME[] = "testdata/fgets.test";
   ::FILE *file = LIBC_NAMESPACE::fopen(FILENAME, "w");
   ASSERT_FALSE(file == nullptr);
@@ -35,7 +36,6 @@ TEST(LlvmLibcFgetsTest, WriteAndReadCharacters) {
   // This is an error and not a real EOF.
   ASSERT_EQ(LIBC_NAMESPACE::feof(file), 0);
   ASSERT_NE(LIBC_NAMESPACE::ferror(file), 0);
-  libc_errno = 0;
 
   ASSERT_EQ(0, LIBC_NAMESPACE::fclose(file));
 
diff --git a/libc/test/src/stdio/fileop_test.cpp b/libc/test/src/stdio/fileop_test.cpp
index e624181c795b8..e097785832d56 100644
--- a/libc/test/src/stdio/fileop_test.cpp
+++ b/libc/test/src/stdio/fileop_test.cpp
@@ -17,17 +17,18 @@
 #include "src/stdio/fread.h"
 #include "src/stdio/fseek.h"
 #include "src/stdio/fwrite.h"
+#include "test/UnitTest/ErrnoCheckingTest.h"
 #include "test/UnitTest/ErrnoSetterMatcher.h"
 #include "test/UnitTest/Test.h"
 
 #include "hdr/stdio_macros.h"
-#include "src/__support/libc_errno.h"
 
+using LlvmLibcFILETest = LIBC_NAMESPACE::testing::ErrnoCheckingTest;
 using LIBC_NAMESPACE::testing::ErrnoSetterMatcher::EQ;
 using LIBC_NAMESPACE::testing::ErrnoSetterMatcher::NE;
 using LIBC_NAMESPACE::testing::ErrnoSetterMatcher::returns;
 
-TEST(LlvmLibcFILETest, SimpleFileOperations) {
+TEST_F(LlvmLibcFILETest, SimpleFileOperations) {
   constexpr char FILENAME[] = "testdata/simple_operations.test";
   ::FILE *file = LIBC_NAMESPACE::fopen(FILENAME, "w");
   ASSERT_FALSE(file == nullptr);
@@ -41,7 +42,6 @@ TEST(LlvmLibcFILETest, SimpleFileOperations) {
   ASSERT_THAT(LIBC_NAMESPACE::fread(read_data, 1, sizeof(CONTENT), file),
               returns(EQ(size_t(0))).with_errno(NE(0)));
   ASSERT_NE(LIBC_NAMESPACE::ferror(file), 0);
-  libc_errno = 0;
 
   LIBC_NAMESPACE::clearerr(file);
   ASSERT_EQ(LIBC_NAMESPACE::ferror(file), 0);
@@ -72,7 +72,6 @@ TEST(LlvmLibcFILETest, SimpleFileOperations) {
   ASSERT_THAT(LIBC_NAMESPACE::fwrite(CONTENT, 1, sizeof(CONTENT), file),
               returns(EQ(size_t(0))).with_errno(NE(0)));
   ASSERT_NE(LIBC_NAMESPACE::ferror(file), 0);
-  libc_errno = 0;
 
   LIBC_NAMESPACE::clearerr(file);
 
@@ -80,15 +79,12 @@ TEST(LlvmLibcFILETest, SimpleFileOperations) {
   ASSERT_THAT(LIBC_NAMESPACE::fputs(CONTENT, file),
               returns(EQ(EOF)).with_errno(NE(0)));
   ASSERT_NE(LIBC_NAMESPACE::ferror(file), 0);
-  libc_errno = 0;
 
   LIBC_NAMESPACE::clearerr(file);
   ASSERT_EQ(LIBC_NAMESPACE::ferror(file), 0);
 
-  libc_errno = 0;
   ASSERT_THAT(LIBC_NAMESPACE::fwrite("nothing", 1, 1, file),
               returns(EQ(size_t(0))).with_errno(NE(0)));
-  libc_errno = 0;
 
   ASSERT_EQ(LIBC_NAMESPACE::fclose(file), 0);
 
@@ -103,10 +99,8 @@ TEST(LlvmLibcFILETest, SimpleFileOperations) {
   ASSERT_EQ(LIBC_NAMESPACE::ferror(file), 0);
 
   // This is not a readable file.
-  libc_errno = 0;
   ASSERT_THAT(LIBC_NAMESPACE::fread(data, 1, 1, file),
               returns(EQ(0)).with_errno(NE(0)));
-  libc_errno = 0;
 
   ASSERT_EQ(0, LIBC_NAMESPACE::fclose(file));
 
@@ -121,21 +115,18 @@ TEST(LlvmLibcFILETest, SimpleFileOperations) {
 
   // Check that the other functions correctly set libc_errno.
 
-  // libc_errno = 0;
   // ASSERT_NE(LIBC_NAMESPACE::fseek(file, 0, SEEK_SET), 0);
   // ASSERT_ERRNO_FAILURE();
 
-  // libc_errno = 0;
   // ASSERT_NE(LIBC_NAMESPACE::fclose(file), 0);
   // ASSERT_ERRNO_FAILURE();
 
-  // libc_errno = 0;
   // ASSERT_EQ(LIBC_NAMESPACE::fopen("INVALID FILE NAME", "r"),
   //           static_cast<FILE *>(nullptr));
   // ASSERT_ERRNO_FAILURE();
 }
 
-TEST(LlvmLibcFILETest, FFlush) {
+TEST_F(LlvmLibcFILETest, FFlush) {
   constexpr char FILENAME[] = "testdata/fflush.test";
   ::FILE *file = LIBC_NAMESPACE::fopen(FILENAME, "w+");
   ASSERT_FALSE(file == nullptr);
@@ -156,7 +147,7 @@ TEST(LlvmLibcFILETest, FFlush) {
   ASSERT_EQ(LIBC_NAMESPACE::fclose(file), 0);
 }
 
-TEST(LlvmLibcFILETest, FOpenFWriteSizeGreaterThanOne) {
+TEST_F(LlvmLibcFILETest, FOpenFWriteSizeGreaterThanOne) {
   using MyStruct = struct {
     char c;
     unsigned long long i;
@@ -165,7 +156,6 @@ TEST(LlvmLibcFILETest, FOpenFWriteSizeGreaterThanOne) {
   constexpr size_t WRITE_NMEMB = sizeof(WRITE_DATA) / sizeof(MyStruct);
   constexpr char FILENAME[] = "testdata/fread_fwrite.test";
 
-  libc_errno = 0;
   FILE *file = LIBC_NAMESPACE::fopen(FILENAME, "w");
   ASSERT_FALSE(file == nullptr);
   ASSERT_EQ(size_t(0), LIBC_NAMESPACE::fwrite(WRITE_DATA, 0, 1, file));
diff --git a/libc/test/src/stdio/fopencookie_test.cpp b/libc/test/src/stdio/fopencookie_test.cpp
index 03e1ac286b646..bcf5e674141a7 100644
--- a/libc/test/src/stdio/fopencookie_test.cpp
+++ b/libc/test/src/stdio/fopencookie_test.cpp
@@ -15,6 +15,7 @@
 #include "src/stdio/fread.h"
 #include "src/stdio/fseek.h"
 #include "src/stdio/fwrite.h"
+#include "test/UnitTest/ErrnoCheckingTest.h"
 #include "test/UnitTest/MemoryMatcher.h"
 #include "test/UnitTest/Test.h"
 
@@ -22,6 +23,7 @@
 #include "hdr/types/size_t.h"
 #include "src/__support/libc_errno.h"
 
+using LlvmLibcFOpenCookieTest = LIBC_NAMESPACE::testing::ErrnoCheckingTest;
 using MemoryView = LIBC_NAMESPACE::testing::MemoryView;
 
 struct StringStream {
@@ -88,7 +90,7 @@ int close_ss(void *cookie) {
 constexpr cookie_io_functions_t STRING_STREAM_FUNCS = {&read_ss, &write_ss,
                                                        &seek_ss, &close_ss};
 
-TEST(LlvmLibcFOpenCookie, ReadOnlyCookieTest) {
+TEST_F(LlvmLibcFOpenCookieTest, ReadOnlyCookieTest) {
   constexpr char CONTENT[] = "Hello,readonly!";
   auto *ss = reinterpret_cast<StringStream *>(malloc(sizeof(StringStream)));
   ss->buf = reinterpret_cast<char *>(malloc(sizeof(CONTENT)));
@@ -115,7 +117,6 @@ TEST(LlvmLibcFOpenCookie, ReadOnlyCookieTest) {
   ASSERT_EQ(size_t(0), LIBC_NAMESPACE::fwrite(CONTENT, 1, sizeof(CONTENT), f));
   ASSERT_NE(LIBC_NAMESPACE::ferror(f), 0);
   ASSERT_ERRNO_FAILURE();
-  libc_errno = 0;
 
   LIBC_NAMESPACE::clearerr(f);
   ASSERT_EQ(LIBC_NAMESPACE::ferror(f), 0);
@@ -124,7 +125,7 @@ TEST(LlvmLibcFOpenCookie, ReadOnlyCookieTest) {
   free(ss);
 }
 
-TEST(LlvmLibcFOpenCookie, WriteOnlyCookieTest) {
+TEST_F(LlvmLibcFOpenCookieTest, WriteOnlyCookieTest) {
   size_t INIT_BUFSIZE = 32;
   auto *ss = reinterpret_cast<StringStream *>(malloc(sizeof(StringStream)));
   ss->buf = reinterpret_cast<char *>(malloc(INIT_BUFSIZE));
@@ -149,7 +150,6 @@ TEST(LlvmLibcFOpenCookie, WriteOnlyCookieTest) {
             LIBC_NAMESPACE::fread(read_data, 1, sizeof(WRITE_DATA), f));
   ASSERT_NE(LIBC_NAMESPACE::ferror(f), 0);
   ASSERT_ERRNO_EQ(EBADF);
-  libc_errno = 0;
 
   LIBC_NAMESPACE::clearerr(f);
   ASSERT_EQ(LIBC_NAMESPACE::ferror(f), 0);
@@ -158,7 +158,7 @@ TEST(LlvmLibcFOpenCookie, WriteOnlyCookieTest) {
   free(ss);
 }
 
-TEST(LlvmLibcFOpenCookie, AppendOnlyCookieTest) {
+TEST_F(LlvmLibcFOpenCookieTest, AppendOnlyCookieTest) {
   constexpr char INITIAL_CONTENT[] = "1234567890987654321";
   constexpr char WRITE_DATA[] = "append";
   auto *ss = reinterpret_cast<StringStream *>(malloc(sizeof(StringStream)));
@@ -178,7 +178,6 @@ TEST(LlvmLibcFOpenCookie, AppendOnlyCookieTest) {
   ASSERT_EQ(LIBC_NAMESPACE::fread(read_data, 1, READ_SIZE, f), size_t(0));
   ASSERT_NE(LIBC_NAMESPACE::ferror(f), 0);
   ASSERT_ERRNO_FAILURE();
-  libc_errno = 0;
 
   LIBC_NAMESPACE::clearerr(f);
   ASSERT_EQ(LIBC_NAMESPACE::ferror(f), 0);
@@ -192,7 +191,7 @@ TEST(LlvmLibcFOpenCookie, AppendOnlyCookieTest) {
   free(ss);
 }
 
-TEST(LlvmLibcFOpenCookie, ReadUpdateCookieTest) {
+TEST_F(LlvmLibcFOpenCookieTest, ReadUpdateCookieTest) {
   const char INITIAL_CONTENT[] = "1234567890987654321";
   auto *ss = reinterpret_cast<StringStream *>(malloc(sizeof(StringStream)));
   ss->buf = reinterpret_cast<char *>(malloc(sizeof(INITIAL_CONTENT)));
@@ -223,7 +222,7 @@ TEST(LlvmLibcFOpenCookie, ReadUpdateCookieTest) {
   free(ss);
 }
 
-TEST(LlvmLibcFOpenCookie, WriteUpdateCookieTest) {
+TEST_F(LlvmLibcFOpenCookieTest, WriteUpdateCookieTest) {
   constexpr char WRITE_DATA[] = "hello, file";
   auto *ss = reinterpret_cast<StringStream *>(malloc(sizeof(StringStream)));
   ss->buf = reinterpret_cast<char *>(malloc(sizeof(WRITE_DATA)));
diff --git a/libc/test/src/stdio/remove_test.cpp b/libc/test/src/stdio/remove_test.cpp
index 84984e26398c0..296bff1f5dc15 100644
--- a/libc/test/src/stdio/remove_test.cpp
+++ b/libc/test/src/stdio/remove_test.cpp
@@ -11,16 +11,17 @@
 #include "src/sys/stat/mkdirat.h"
 #include "src/unistd/access.h"
 #include "src/unistd/close.h"
+#include "test/UnitTest/ErrnoCheckingTest.h"
 #include "test/UnitTest/ErrnoSetterMatcher.h"
 #include "test/UnitTest/Test.h"
 
-#include "src/__support/libc_errno.h"
 #include <unistd.h>
 
-TEST(LlvmLibcRemoveTest, CreateAndRemoveFile) {
+using LlvmLibcRemoveTest = LIBC_NAMESPACE::testing::ErrnoCheckingTest;
+
+TEST_F(LlvmLibcRemoveTest, CreateAndRemoveFile) {
   // The test strategy is to create a file and remove it, and also verify that
   // it was removed.
-  libc_errno = 0;
   using LIBC_NAMESPACE::testing::ErrnoSetterMatcher::Fails;
   using LIBC_NAMESPACE::testing::ErrnoSetterMatcher::Succeeds;
 
@@ -36,10 +37,9 @@ TEST(LlvmLibcRemoveTest, CreateAndRemoveFile) {
   ASSERT_THAT(LIBC_NAMESPACE::access(TEST_FILE, F_OK), Fails(ENOENT));
 }
 
-TEST(LlvmLibcRemoveTest, CreateAndRemoveDir) {
+TEST_F(LlvmLibcRemoveTest, CreateAndRemoveDir) {
   // The test strategy is to create a dir and remove it, and also verify that
   // it was removed.
-  libc_errno = 0;
   using LIBC_NAMESPACE::testing::ErrnoSetterMatcher::Fails;
   using LIBC_NAMESPACE::testing::ErrnoSetterMatcher::Succeeds;
   constexpr const char *FILENAME = "remove.test.dir";
diff --git a/libc/test/src/stdio/rename_test.cpp b/libc/test/src/stdio/rename_test.cpp
index ac494a4ecaf8e..135fb98c07fbb 100644
--- a/libc/test/src/stdio/rename_test.cpp
+++ b/libc/test/src/stdio/rename_test.cpp
@@ -8,18 +8,19 @@
 
 #include "include/llvm-libc-macros/linux/sys-stat-macros.h"
 #include "include/llvm-libc-macros/linux/unistd-macros.h"
-#include "src/__support/libc_errno.h"
 #include "src/fcntl/open.h"
 #include "src/stdio/rename.h"
 #include "src/unistd/access.h"
 #include "src/unistd/close.h"
+#include "test/UnitTest/ErrnoCheckingTest.h"
 #include "test/UnitTest/ErrnoSetterMatcher.h"
 #include "test/UnitTest/Test.h"
 
-TEST(LlvmLibcRenameTest, CreateAndRenameFile) {
+using LlvmLibcRenameTest = LIBC_NAMESPACE::testing::ErrnoCheckingTest;
+
+TEST_F(LlvmLibcRenameTest, CreateAndRenameFile) {
   // The test strategy is to create a file and rename it, and also verify that
   // it was renamed.
-  libc_errno = 0;
   using LIBC_NAMESPACE::testing::ErrnoSetterMatcher::Fails;
   using LIBC_NAMESPACE::testing::ErrnoSetterMatcher::Succeeds;
 
@@ -40,7 +41,7 @@ TEST(LlvmLibcRenameTest, CreateAndRenameFile) {
   ASSERT_THAT(LIBC_NAMESPACE::access(TEST_FILEPATH0, F_OK), Fails(ENOENT));
 }
 
-TEST(LlvmLibcRenameTest, RenameNonExistent) {
+TEST_F(LlvmLibcRenameTest, RenameNonExistent) {
   using LIBC_NAMESPACE::testing::ErrnoSetterMatcher::Fails;
 
   constexpr const char *FILENAME1 = "rename.test.file1";
diff --git a/libc/test/src/stdio/setvbuf_test.cpp b/libc/test/src/stdio/setvbuf_test.cpp
index 5872943c1bb41..4144bc1bef447 100644
--- a/libc/test/src/stdio/setvbuf_test.cpp
+++ b/libc/test/src/stdio/setvbuf_test.cpp
@@ -14,9 +14,10 @@
 #include "test/UnitTest/Test.h"
 
 #include "hdr/stdio_macros.h"
-#include "src/__support/libc_errno.h"
 
-TEST(LlvmLibcSetvbufTest, SetNBFBuffer) {
+using LlvmLibcSetvbufTest = LIBC_NAMESPACE::testing::ErrnoCheckingTest;
+
+TEST_F(LlvmLibcSetvbufTest, SetNBFBuffer) {
   // The idea in this test is that we open a file for writing and reading, and
   // then set a NBF buffer to the write handle. Since it is NBF, the data
   // written using the write handle should be immediately readable by the read
@@ -52,7 +53,7 @@ TEST(LlvmLibcSetvbufTest, SetNBFBuffer) {
   ASSERT_EQ(0, LIBC_NAMESPACE::fclose(fr));
 }
 
-TEST(LlvmLibcSetvbufTest, SetLBFBuffer) {
+TEST_F(LlvmLibcSetvbufTest, SetLBFBuffer) {
   // The idea in this test is that we open a file for writing and reading, and
   // then set a LBF buffer to the write handle. Since it is LBF, the data
   // written using the write handle should be available right after a '\n' is
@@ -102,6 +103,5 @@ TEST(LlvmLibcSetbufTest, InvalidBufferMode) {
             0);
   ASSERT_ERRNO_EQ(EINVAL);
 
-  libc_errno = 0;
   ASSERT_EQ(0, LIBC_NAMESPACE::fclose(f));
 }
diff --git a/libc/test/src/stdio/unlocked_fileop_test.cpp b/libc/test/src/stdio/unlocked_fileop_test.cpp
index 5d482b70064bd..e99b382d12112 100644
--- a/libc/test/src/stdio/unlocked_fileop_test.cpp
+++ b/libc/test/src/stdio/unlocked_fileop_test.cpp
@@ -15,11 +15,12 @@
 #include "src/stdio/fread_unlocked.h"
 #include "src/stdio/funlockfile.h"
 #include "src/stdio/fwrite_unlocked.h"
+#include "test/UnitTest/ErrnoCheckingTest.h"
 #include "test/UnitTest/Test.h"
 
-#include "src/__support/libc_errno.h"
+using LlvmLibcFILETest = LIBC_NAMESPACE::testing::ErrnoCheckingTest;
 
-TEST(LlvmLibcFILETest, UnlockedReadAndWrite) {
+TEST_F(LlvmLibcFILETest, UnlockedReadAndWrite) {
   constexpr char fNAME[] = "testdata/unlocked_read_and_write.test";
   ::FILE *f = LIBC_NAMESPACE::fopen(fNAME, "w");
   ASSERT_FALSE(f == nullptr);
@@ -36,7 +37,6 @@ TEST(LlvmLibcFILETest, UnlockedReadAndWrite) {
             LIBC_NAMESPACE::fread_unlocked(data, 1, sizeof(READ_SIZE), f));
   ASSERT_NE(LIBC_NAMESPACE::ferror_unlocke...
[truncated]

Copy link
Contributor

@michaelrj-google michaelrj-google left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@vonosmas vonosmas merged commit 1ecd108 into llvm:main Jun 11, 2025
15 checks passed
@vonosmas vonosmas deleted the errno-checking-test-3 branch June 11, 2025 23:22
@llvm-ci
Copy link
Collaborator

llvm-ci commented Jun 11, 2025

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

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

Here is the relevant piece of the build log for the reference
Step 4 (annotate) failure: 'python ../llvm-zorg/zorg/buildbot/builders/annotated/libc-linux.py ...' (failure)
...
[==========] Running 1 test from 1 test suite.
[ RUN      ] LlvmLibcSqrtTest.SpecialNumbers
[       OK ] LlvmLibcSqrtTest.SpecialNumbers (11 us)
Ran 1 tests.  PASS: 1  FAIL: 0
[396/950] Running unit test libc.test.src.math.smoke.exp10_test.__unit__
[==========] Running 1 test from 1 test suite.
[ RUN      ] LlvmLibcExp10Test.SpecialNumbers
[       OK ] LlvmLibcExp10Test.SpecialNumbers (13 us)
Ran 1 tests.  PASS: 1  FAIL: 0
[397/950] Building CXX object libc/test/src/stdio/CMakeFiles/libc.test.src.stdio.setvbuf_test.__unit__.__build__.dir/setvbuf_test.cpp.o
FAILED: libc/test/src/stdio/CMakeFiles/libc.test.src.stdio.setvbuf_test.__unit__.__build__.dir/setvbuf_test.cpp.o 
/usr/bin/clang++ -DLIBC_NAMESPACE=__llvm_libc_20_0_0_git -D_DEBUG -I/home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc -isystem 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.setvbuf_test.__unit__.__build__.dir/setvbuf_test.cpp.o -MF libc/test/src/stdio/CMakeFiles/libc.test.src.stdio.setvbuf_test.__unit__.__build__.dir/setvbuf_test.cpp.o.d -o libc/test/src/stdio/CMakeFiles/libc.test.src.stdio.setvbuf_test.__unit__.__build__.dir/setvbuf_test.cpp.o -c /home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/test/src/stdio/setvbuf_test.cpp
/home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/test/src/stdio/setvbuf_test.cpp:18:54: error: no type named 'ErrnoCheckingTest' in namespace '__llvm_libc_20_0_0_git::testing'
using LlvmLibcSetvbufTest = LIBC_NAMESPACE::testing::ErrnoCheckingTest;
                            ~~~~~~~~~~~~~~~~~~~~~~~~~^
/home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/test/src/stdio/setvbuf_test.cpp:20:8: error: expected class name
TEST_F(LlvmLibcSetvbufTest, SetNBFBuffer) {
       ^
/home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/test/src/stdio/setvbuf_test.cpp:20:1: error: only virtual member functions can be marked 'override'
TEST_F(LlvmLibcSetvbufTest, SetNBFBuffer) {
^
/home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/test/UnitTest/LibcTest.h:397:16: note: expanded from macro 'TEST_F'
    void Run() override;                                                       \
               ^
/home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/test/src/stdio/setvbuf_test.cpp:20:1: error: only virtual member functions can be marked 'override'
/home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/test/UnitTest/LibcTest.h:398:33: note: expanded from macro 'TEST_F'
    const char *getName() const override { return #SuiteClass "." #TestName; } \
                                ^
/home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/test/src/stdio/setvbuf_test.cpp:20:1: error: use of undeclared identifier 'addTest'
/home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/test/UnitTest/LibcTest.h:396:33: note: expanded from macro 'TEST_F'
    SuiteClass##_##TestName() { addTest(this); }                               \
                                ^
/home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/test/src/stdio/setvbuf_test.cpp:28:3: error: no matching function for call to 'test'
  ASSERT_FALSE(fw == nullptr);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/test/UnitTest/LibcTest.h:462:27: note: expanded from macro 'ASSERT_FALSE'
#define ASSERT_FALSE(VAL) ASSERT_EQ(VAL, false)
                          ^~~~~~~~~~~~~~~~~~~~~
/home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/test/UnitTest/LibcTest.h:438:29: note: expanded from macro 'ASSERT_EQ'
#define ASSERT_EQ(LHS, RHS) LIBC_TEST_BINOP_(EQ, LHS, RHS, return)
                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/test/UnitTest/LibcTest.h:430:26: note: expanded from macro 'LIBC_TEST_BINOP_'
  LIBC_TEST_SCAFFOLDING_(test(LIBC_NAMESPACE::testing::TestCond::COND, LHS,    \
                         ^~~~
/home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/test/UnitTest/LibcTest.h:423:7: note: expanded from macro 'LIBC_TEST_SCAFFOLDING_'
  if (TEST)                                                                    \
      ^~~~
/home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/test/UnitTest/LibcTest.h:99:6: note: candidate function template not viable: requires 7 arguments, but 6 were provided
bool test(RunContext *Ctx, TestCond Cond, ValType LHS, ValType RHS,

@llvm-ci
Copy link
Collaborator

llvm-ci commented Jun 11, 2025

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

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

Here is the relevant piece of the build log for the reference
Step 4 (annotate) failure: 'python ../llvm-zorg/zorg/buildbot/builders/annotated/libc-linux.py ...' (failure)
...
[==========] Running 1 test from 1 test suite.
[ RUN      ] LlvmLibcMemcpyTest.SizeSweep
[       OK ] LlvmLibcMemcpyTest.SizeSweep (2 ms)
Ran 1 tests.  PASS: 1  FAIL: 0
[928/1221] Running unit test libc.test.src.string.memcpy_x86_64_opt_sw_prefetch_avx_test.__unit__
[==========] Running 1 test from 1 test suite.
[ RUN      ] LlvmLibcMemcpyTest.SizeSweep
[       OK ] LlvmLibcMemcpyTest.SizeSweep (3 ms)
Ran 1 tests.  PASS: 1  FAIL: 0
[929/1221] Building CXX object libc/test/src/stdio/CMakeFiles/libc.test.src.stdio.setvbuf_test.__unit__.__build__.dir/setvbuf_test.cpp.o
FAILED: libc/test/src/stdio/CMakeFiles/libc.test.src.stdio.setvbuf_test.__unit__.__build__.dir/setvbuf_test.cpp.o 
/usr/bin/clang++ -DLIBC_NAMESPACE=__llvm_libc_20_0_0_git -D_DEBUG -I/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc -isystem /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/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 -Wmisleading-indentation -Wctad-maybe-unsupported -fno-omit-frame-pointer -fsanitize=address -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.setvbuf_test.__unit__.__build__.dir/setvbuf_test.cpp.o -MF libc/test/src/stdio/CMakeFiles/libc.test.src.stdio.setvbuf_test.__unit__.__build__.dir/setvbuf_test.cpp.o.d -o libc/test/src/stdio/CMakeFiles/libc.test.src.stdio.setvbuf_test.__unit__.__build__.dir/setvbuf_test.cpp.o -c /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/test/src/stdio/setvbuf_test.cpp
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/test/src/stdio/setvbuf_test.cpp:18:54: error: no type named 'ErrnoCheckingTest' in namespace '__llvm_libc_20_0_0_git::testing'
using LlvmLibcSetvbufTest = LIBC_NAMESPACE::testing::ErrnoCheckingTest;
                            ~~~~~~~~~~~~~~~~~~~~~~~~~^
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/test/src/stdio/setvbuf_test.cpp:20:8: error: expected class name
TEST_F(LlvmLibcSetvbufTest, SetNBFBuffer) {
       ^
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/test/src/stdio/setvbuf_test.cpp:20:1: error: only virtual member functions can be marked 'override'
TEST_F(LlvmLibcSetvbufTest, SetNBFBuffer) {
^
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/test/UnitTest/LibcTest.h:397:16: note: expanded from macro 'TEST_F'
    void Run() override;                                                       \
               ^
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/test/src/stdio/setvbuf_test.cpp:20:1: error: only virtual member functions can be marked 'override'
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/test/UnitTest/LibcTest.h:398:33: note: expanded from macro 'TEST_F'
    const char *getName() const override { return #SuiteClass "." #TestName; } \
                                ^
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/test/src/stdio/setvbuf_test.cpp:20:1: error: use of undeclared identifier 'addTest'
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/test/UnitTest/LibcTest.h:396:33: note: expanded from macro 'TEST_F'
    SuiteClass##_##TestName() { addTest(this); }                               \
                                ^
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/test/src/stdio/setvbuf_test.cpp:28:3: error: no matching function for call to 'test'
  ASSERT_FALSE(fw == nullptr);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/test/UnitTest/LibcTest.h:462:27: note: expanded from macro 'ASSERT_FALSE'
#define ASSERT_FALSE(VAL) ASSERT_EQ(VAL, false)
                          ^~~~~~~~~~~~~~~~~~~~~
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/test/UnitTest/LibcTest.h:438:29: note: expanded from macro 'ASSERT_EQ'
#define ASSERT_EQ(LHS, RHS) LIBC_TEST_BINOP_(EQ, LHS, RHS, return)
                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/test/UnitTest/LibcTest.h:430:26: note: expanded from macro 'LIBC_TEST_BINOP_'
  LIBC_TEST_SCAFFOLDING_(test(LIBC_NAMESPACE::testing::TestCond::COND, LHS,    \
                         ^~~~
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/test/UnitTest/LibcTest.h:423:7: note: expanded from macro 'LIBC_TEST_SCAFFOLDING_'
  if (TEST)                                                                    \
      ^~~~
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/test/UnitTest/LibcTest.h:99:6: note: candidate function template not viable: requires 7 arguments, but 6 were provided
bool test(RunContext *Ctx, TestCond Cond, ValType LHS, ValType RHS,
Step 8 (libc-unit-tests) failure: libc-unit-tests (failure)
...
[==========] Running 1 test from 1 test suite.
[ RUN      ] LlvmLibcMemcpyTest.SizeSweep
[       OK ] LlvmLibcMemcpyTest.SizeSweep (2 ms)
Ran 1 tests.  PASS: 1  FAIL: 0
[928/1221] Running unit test libc.test.src.string.memcpy_x86_64_opt_sw_prefetch_avx_test.__unit__
[==========] Running 1 test from 1 test suite.
[ RUN      ] LlvmLibcMemcpyTest.SizeSweep
[       OK ] LlvmLibcMemcpyTest.SizeSweep (3 ms)
Ran 1 tests.  PASS: 1  FAIL: 0
[929/1221] Building CXX object libc/test/src/stdio/CMakeFiles/libc.test.src.stdio.setvbuf_test.__unit__.__build__.dir/setvbuf_test.cpp.o
FAILED: libc/test/src/stdio/CMakeFiles/libc.test.src.stdio.setvbuf_test.__unit__.__build__.dir/setvbuf_test.cpp.o 
/usr/bin/clang++ -DLIBC_NAMESPACE=__llvm_libc_20_0_0_git -D_DEBUG -I/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc -isystem /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/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 -Wmisleading-indentation -Wctad-maybe-unsupported -fno-omit-frame-pointer -fsanitize=address -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.setvbuf_test.__unit__.__build__.dir/setvbuf_test.cpp.o -MF libc/test/src/stdio/CMakeFiles/libc.test.src.stdio.setvbuf_test.__unit__.__build__.dir/setvbuf_test.cpp.o.d -o libc/test/src/stdio/CMakeFiles/libc.test.src.stdio.setvbuf_test.__unit__.__build__.dir/setvbuf_test.cpp.o -c /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/test/src/stdio/setvbuf_test.cpp
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/test/src/stdio/setvbuf_test.cpp:18:54: error: no type named 'ErrnoCheckingTest' in namespace '__llvm_libc_20_0_0_git::testing'
using LlvmLibcSetvbufTest = LIBC_NAMESPACE::testing::ErrnoCheckingTest;
                            ~~~~~~~~~~~~~~~~~~~~~~~~~^
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/test/src/stdio/setvbuf_test.cpp:20:8: error: expected class name
TEST_F(LlvmLibcSetvbufTest, SetNBFBuffer) {
       ^
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/test/src/stdio/setvbuf_test.cpp:20:1: error: only virtual member functions can be marked 'override'
TEST_F(LlvmLibcSetvbufTest, SetNBFBuffer) {
^
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/test/UnitTest/LibcTest.h:397:16: note: expanded from macro 'TEST_F'
    void Run() override;                                                       \
               ^
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/test/src/stdio/setvbuf_test.cpp:20:1: error: only virtual member functions can be marked 'override'
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/test/UnitTest/LibcTest.h:398:33: note: expanded from macro 'TEST_F'
    const char *getName() const override { return #SuiteClass "." #TestName; } \
                                ^
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/test/src/stdio/setvbuf_test.cpp:20:1: error: use of undeclared identifier 'addTest'
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/test/UnitTest/LibcTest.h:396:33: note: expanded from macro 'TEST_F'
    SuiteClass##_##TestName() { addTest(this); }                               \
                                ^
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/test/src/stdio/setvbuf_test.cpp:28:3: error: no matching function for call to 'test'
  ASSERT_FALSE(fw == nullptr);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/test/UnitTest/LibcTest.h:462:27: note: expanded from macro 'ASSERT_FALSE'
#define ASSERT_FALSE(VAL) ASSERT_EQ(VAL, false)
                          ^~~~~~~~~~~~~~~~~~~~~
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/test/UnitTest/LibcTest.h:438:29: note: expanded from macro 'ASSERT_EQ'
#define ASSERT_EQ(LHS, RHS) LIBC_TEST_BINOP_(EQ, LHS, RHS, return)
                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/test/UnitTest/LibcTest.h:430:26: note: expanded from macro 'LIBC_TEST_BINOP_'
  LIBC_TEST_SCAFFOLDING_(test(LIBC_NAMESPACE::testing::TestCond::COND, LHS,    \
                         ^~~~
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/test/UnitTest/LibcTest.h:423:7: note: expanded from macro 'LIBC_TEST_SCAFFOLDING_'
  if (TEST)                                                                    \
      ^~~~
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/test/UnitTest/LibcTest.h:99:6: note: candidate function template not viable: requires 7 arguments, but 6 were provided
bool test(RunContext *Ctx, TestCond Cond, ValType LHS, ValType RHS,

@llvm-ci
Copy link
Collaborator

llvm-ci commented Jun 11, 2025

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

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

Here is the relevant piece of the build log for the reference
Step 4 (annotate) failure: 'python ../llvm-zorg/zorg/buildbot/builders/annotated/libc-linux.py ...' (failure)
...
[ RUN      ] LlvmLibcRoundToIntegerTest.RoundNumbers
[       OK ] LlvmLibcRoundToIntegerTest.RoundNumbers (18 us)
[ RUN      ] LlvmLibcRoundToIntegerTest.SubnormalRange
[       OK ] LlvmLibcRoundToIntegerTest.SubnormalRange (2050 ms)
Ran 3 tests.  PASS: 3  FAIL: 0
[1162/1222] Building CXX object libc/test/src/stdio/CMakeFiles/libc.test.src.stdio.remove_test.__unit__.__build__.dir/remove_test.cpp.o
[1163/1222] Building CXX object libc/test/src/stdlib/CMakeFiles/libc.test.src.stdlib.strtold_test.__unit__.__build__.dir/strtold_test.cpp.o
[1164/1222] Building CXX object libc/test/src/stdio/CMakeFiles/libc.test.src.stdio.unlocked_fileop_test.__unit__.__build__.dir/unlocked_fileop_test.cpp.o
[1165/1222] Linking CXX executable libc/test/src/stdio/libc.test.src.stdio.fgetc_unlocked_test.__unit__.__build__
[1166/1222] Running unit test libc.test.src.stdio.fgetc_unlocked_test.__unit__
FAILED: libc/test/src/stdio/CMakeFiles/libc.test.src.stdio.fgetc_unlocked_test.__unit__ /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/build/libc/test/src/stdio/CMakeFiles/libc.test.src.stdio.fgetc_unlocked_test.__unit__ 
cd /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/build/libc/test/src/stdio && /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/build/libc/test/src/stdio/libc.test.src.stdio.fgetc_unlocked_test.__unit__.__build__
[==========] Running 2 tests from 1 test suite.
[ RUN      ] LlvmLibcGetcTest.WriteAndReadCharactersWithFgetcUnlocked
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/test/UnitTest/ErrnoCheckingTest.h:32: FAILURE
      Expected: 0
      Which is: 0
To be equal to: static_cast<int>(libc_errno)
      Which is: 9
[  FAILED  ] LlvmLibcGetcTest.WriteAndReadCharactersWithFgetcUnlocked
[ RUN      ] LlvmLibcGetcTest.WriteAndReadCharactersWithGetcUnlocked
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/test/UnitTest/ErrnoCheckingTest.h:32: FAILURE
      Expected: 0
      Which is: 0
To be equal to: static_cast<int>(libc_errno)
      Which is: 9
[  FAILED  ] LlvmLibcGetcTest.WriteAndReadCharactersWithGetcUnlocked
Ran 2 tests.  PASS: 0  FAIL: 2
[1167/1222] Building CXX object libc/test/src/stdio/CMakeFiles/libc.test.src.stdio.fgetc_test.__unit__.__build__.dir/fgetc_test.cpp.o
[1168/1222] Building CXX object libc/test/src/stdio/CMakeFiles/libc.test.src.stdio.fgets_test.__unit__.__build__.dir/fgets_test.cpp.o
[1169/1222] Running unit test libc.test.src.math.smoke.lrintf128_test.__unit__
[==========] Running 3 tests from 1 test suite.
[ RUN      ] LlvmLibcRoundToIntegerTest.InfinityAndNaN
[       OK ] LlvmLibcRoundToIntegerTest.InfinityAndNaN (10 us)
[ RUN      ] LlvmLibcRoundToIntegerTest.RoundNumbers
[       OK ] LlvmLibcRoundToIntegerTest.RoundNumbers (20 us)
[ RUN      ] LlvmLibcRoundToIntegerTest.SubnormalRange
[       OK ] LlvmLibcRoundToIntegerTest.SubnormalRange (2266 ms)
Ran 3 tests.  PASS: 3  FAIL: 0
[1170/1222] Building CXX object libc/test/src/stdio/CMakeFiles/libc.test.src.stdio.fopencookie_test.__unit__.__build__.dir/fopencookie_test.cpp.o
[1171/1222] Building CXX object libc/test/src/stdio/CMakeFiles/libc.test.src.stdio.fdopen_test.__unit__.__build__.dir/fdopen_test.cpp.o
[1172/1222] Building CXX object libc/test/src/stdio/CMakeFiles/libc.test.src.stdio.rename_test.__unit__.__build__.dir/rename_test.cpp.o
[1173/1222] Running unit test libc.test.src.math.smoke.llrintf128_test.__unit__
[==========] Running 3 tests from 1 test suite.
[ RUN      ] LlvmLibcRoundToIntegerTest.InfinityAndNaN
[       OK ] LlvmLibcRoundToIntegerTest.InfinityAndNaN (13 us)
[ RUN      ] LlvmLibcRoundToIntegerTest.RoundNumbers
[       OK ] LlvmLibcRoundToIntegerTest.RoundNumbers (24 us)
[ RUN      ] LlvmLibcRoundToIntegerTest.SubnormalRange
Step 8 (libc-unit-tests) failure: libc-unit-tests (failure)
...
[ RUN      ] LlvmLibcRoundToIntegerTest.RoundNumbers
[       OK ] LlvmLibcRoundToIntegerTest.RoundNumbers (18 us)
[ RUN      ] LlvmLibcRoundToIntegerTest.SubnormalRange
[       OK ] LlvmLibcRoundToIntegerTest.SubnormalRange (2050 ms)
Ran 3 tests.  PASS: 3  FAIL: 0
[1162/1222] Building CXX object libc/test/src/stdio/CMakeFiles/libc.test.src.stdio.remove_test.__unit__.__build__.dir/remove_test.cpp.o
[1163/1222] Building CXX object libc/test/src/stdlib/CMakeFiles/libc.test.src.stdlib.strtold_test.__unit__.__build__.dir/strtold_test.cpp.o
[1164/1222] Building CXX object libc/test/src/stdio/CMakeFiles/libc.test.src.stdio.unlocked_fileop_test.__unit__.__build__.dir/unlocked_fileop_test.cpp.o
[1165/1222] Linking CXX executable libc/test/src/stdio/libc.test.src.stdio.fgetc_unlocked_test.__unit__.__build__
[1166/1222] Running unit test libc.test.src.stdio.fgetc_unlocked_test.__unit__
FAILED: libc/test/src/stdio/CMakeFiles/libc.test.src.stdio.fgetc_unlocked_test.__unit__ /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/build/libc/test/src/stdio/CMakeFiles/libc.test.src.stdio.fgetc_unlocked_test.__unit__ 
cd /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/build/libc/test/src/stdio && /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/build/libc/test/src/stdio/libc.test.src.stdio.fgetc_unlocked_test.__unit__.__build__
[==========] Running 2 tests from 1 test suite.
[ RUN      ] LlvmLibcGetcTest.WriteAndReadCharactersWithFgetcUnlocked
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/test/UnitTest/ErrnoCheckingTest.h:32: FAILURE
      Expected: 0
      Which is: 0
To be equal to: static_cast<int>(libc_errno)
      Which is: 9
[  FAILED  ] LlvmLibcGetcTest.WriteAndReadCharactersWithFgetcUnlocked
[ RUN      ] LlvmLibcGetcTest.WriteAndReadCharactersWithGetcUnlocked
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/test/UnitTest/ErrnoCheckingTest.h:32: FAILURE
      Expected: 0
      Which is: 0
To be equal to: static_cast<int>(libc_errno)
      Which is: 9
[  FAILED  ] LlvmLibcGetcTest.WriteAndReadCharactersWithGetcUnlocked
Ran 2 tests.  PASS: 0  FAIL: 2
[1167/1222] Building CXX object libc/test/src/stdio/CMakeFiles/libc.test.src.stdio.fgetc_test.__unit__.__build__.dir/fgetc_test.cpp.o
[1168/1222] Building CXX object libc/test/src/stdio/CMakeFiles/libc.test.src.stdio.fgets_test.__unit__.__build__.dir/fgets_test.cpp.o
[1169/1222] Running unit test libc.test.src.math.smoke.lrintf128_test.__unit__
[==========] Running 3 tests from 1 test suite.
[ RUN      ] LlvmLibcRoundToIntegerTest.InfinityAndNaN
[       OK ] LlvmLibcRoundToIntegerTest.InfinityAndNaN (10 us)
[ RUN      ] LlvmLibcRoundToIntegerTest.RoundNumbers
[       OK ] LlvmLibcRoundToIntegerTest.RoundNumbers (20 us)
[ RUN      ] LlvmLibcRoundToIntegerTest.SubnormalRange
[       OK ] LlvmLibcRoundToIntegerTest.SubnormalRange (2266 ms)
Ran 3 tests.  PASS: 3  FAIL: 0
[1170/1222] Building CXX object libc/test/src/stdio/CMakeFiles/libc.test.src.stdio.fopencookie_test.__unit__.__build__.dir/fopencookie_test.cpp.o
[1171/1222] Building CXX object libc/test/src/stdio/CMakeFiles/libc.test.src.stdio.fdopen_test.__unit__.__build__.dir/fdopen_test.cpp.o
[1172/1222] Building CXX object libc/test/src/stdio/CMakeFiles/libc.test.src.stdio.rename_test.__unit__.__build__.dir/rename_test.cpp.o
[1173/1222] Running unit test libc.test.src.math.smoke.llrintf128_test.__unit__
[==========] Running 3 tests from 1 test suite.
[ RUN      ] LlvmLibcRoundToIntegerTest.InfinityAndNaN
[       OK ] LlvmLibcRoundToIntegerTest.InfinityAndNaN (13 us)
[ RUN      ] LlvmLibcRoundToIntegerTest.RoundNumbers
[       OK ] LlvmLibcRoundToIntegerTest.RoundNumbers (24 us)
[ RUN      ] LlvmLibcRoundToIntegerTest.SubnormalRange

@llvm-ci
Copy link
Collaborator

llvm-ci commented Jun 11, 2025

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

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

Here is the relevant piece of the build log for the reference
Step 4 (annotate) failure: 'python ../llvm-zorg/zorg/buildbot/builders/annotated/libc-linux.py ...' (failure)
...
  ^
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-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/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-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,          \
                         ^
1 warning generated.
[1164/1226] Building CXX object libc/test/src/stdio/CMakeFiles/libc.test.src.stdio.rename_test.__unit__.__build__.dir/rename_test.cpp.o
[1165/1226] Building CXX object libc/test/src/stdio/CMakeFiles/libc.test.src.stdio.setvbuf_test.__unit__.__build__.dir/setvbuf_test.cpp.o
FAILED: libc/test/src/stdio/CMakeFiles/libc.test.src.stdio.setvbuf_test.__unit__.__build__.dir/setvbuf_test.cpp.o 
/usr/bin/clang++ -DLIBC_NAMESPACE=__llvm_libc_20_0_0_git -D_DEBUG -I/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc -isystem /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-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 -Wmisleading-indentation -Wctad-maybe-unsupported -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.setvbuf_test.__unit__.__build__.dir/setvbuf_test.cpp.o -MF libc/test/src/stdio/CMakeFiles/libc.test.src.stdio.setvbuf_test.__unit__.__build__.dir/setvbuf_test.cpp.o.d -o libc/test/src/stdio/CMakeFiles/libc.test.src.stdio.setvbuf_test.__unit__.__build__.dir/setvbuf_test.cpp.o -c /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc/test/src/stdio/setvbuf_test.cpp
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc/test/src/stdio/setvbuf_test.cpp:18:54: error: no type named 'ErrnoCheckingTest' in namespace '__llvm_libc_20_0_0_git::testing'
using LlvmLibcSetvbufTest = LIBC_NAMESPACE::testing::ErrnoCheckingTest;
                            ~~~~~~~~~~~~~~~~~~~~~~~~~^
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc/test/src/stdio/setvbuf_test.cpp:20:8: error: expected class name
TEST_F(LlvmLibcSetvbufTest, SetNBFBuffer) {
       ^
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc/test/src/stdio/setvbuf_test.cpp:20:1: error: only virtual member functions can be marked 'override'
TEST_F(LlvmLibcSetvbufTest, SetNBFBuffer) {
^
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc/test/UnitTest/LibcTest.h:397:16: note: expanded from macro 'TEST_F'
    void Run() override;                                                       \
               ^
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc/test/src/stdio/setvbuf_test.cpp:20:1: error: only virtual member functions can be marked 'override'
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc/test/UnitTest/LibcTest.h:398:33: note: expanded from macro 'TEST_F'
    const char *getName() const override { return #SuiteClass "." #TestName; } \
                                ^
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc/test/src/stdio/setvbuf_test.cpp:20:1: error: use of undeclared identifier 'addTest'
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc/test/UnitTest/LibcTest.h:396:33: note: expanded from macro 'TEST_F'
    SuiteClass##_##TestName() { addTest(this); }                               \
                                ^
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc/test/src/stdio/setvbuf_test.cpp:28:3: error: no matching function for call to 'test'
  ASSERT_FALSE(fw == nullptr);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc/test/UnitTest/LibcTest.h:462:27: note: expanded from macro 'ASSERT_FALSE'
#define ASSERT_FALSE(VAL) ASSERT_EQ(VAL, false)
                          ^~~~~~~~~~~~~~~~~~~~~
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc/test/UnitTest/LibcTest.h:438:29: note: expanded from macro 'ASSERT_EQ'
#define ASSERT_EQ(LHS, RHS) LIBC_TEST_BINOP_(EQ, LHS, RHS, return)
                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc/test/UnitTest/LibcTest.h:430:26: note: expanded from macro 'LIBC_TEST_BINOP_'
  LIBC_TEST_SCAFFOLDING_(test(LIBC_NAMESPACE::testing::TestCond::COND, LHS,    \
                         ^~~~
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc/test/UnitTest/LibcTest.h:423:7: note: expanded from macro 'LIBC_TEST_SCAFFOLDING_'
  if (TEST)                                                                    \
      ^~~~
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc/test/UnitTest/LibcTest.h:99:6: note: candidate function template not viable: requires 7 arguments, but 6 were provided
bool test(RunContext *Ctx, TestCond Cond, ValType LHS, ValType RHS,
Step 8 (libc-unit-tests) failure: libc-unit-tests (failure)
...
  ^
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-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/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-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,          \
                         ^
1 warning generated.
[1164/1226] Building CXX object libc/test/src/stdio/CMakeFiles/libc.test.src.stdio.rename_test.__unit__.__build__.dir/rename_test.cpp.o
[1165/1226] Building CXX object libc/test/src/stdio/CMakeFiles/libc.test.src.stdio.setvbuf_test.__unit__.__build__.dir/setvbuf_test.cpp.o
FAILED: libc/test/src/stdio/CMakeFiles/libc.test.src.stdio.setvbuf_test.__unit__.__build__.dir/setvbuf_test.cpp.o 
/usr/bin/clang++ -DLIBC_NAMESPACE=__llvm_libc_20_0_0_git -D_DEBUG -I/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc -isystem /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-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 -Wmisleading-indentation -Wctad-maybe-unsupported -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.setvbuf_test.__unit__.__build__.dir/setvbuf_test.cpp.o -MF libc/test/src/stdio/CMakeFiles/libc.test.src.stdio.setvbuf_test.__unit__.__build__.dir/setvbuf_test.cpp.o.d -o libc/test/src/stdio/CMakeFiles/libc.test.src.stdio.setvbuf_test.__unit__.__build__.dir/setvbuf_test.cpp.o -c /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc/test/src/stdio/setvbuf_test.cpp
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc/test/src/stdio/setvbuf_test.cpp:18:54: error: no type named 'ErrnoCheckingTest' in namespace '__llvm_libc_20_0_0_git::testing'
using LlvmLibcSetvbufTest = LIBC_NAMESPACE::testing::ErrnoCheckingTest;
                            ~~~~~~~~~~~~~~~~~~~~~~~~~^
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc/test/src/stdio/setvbuf_test.cpp:20:8: error: expected class name
TEST_F(LlvmLibcSetvbufTest, SetNBFBuffer) {
       ^
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc/test/src/stdio/setvbuf_test.cpp:20:1: error: only virtual member functions can be marked 'override'
TEST_F(LlvmLibcSetvbufTest, SetNBFBuffer) {
^
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc/test/UnitTest/LibcTest.h:397:16: note: expanded from macro 'TEST_F'
    void Run() override;                                                       \
               ^
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc/test/src/stdio/setvbuf_test.cpp:20:1: error: only virtual member functions can be marked 'override'
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc/test/UnitTest/LibcTest.h:398:33: note: expanded from macro 'TEST_F'
    const char *getName() const override { return #SuiteClass "." #TestName; } \
                                ^
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc/test/src/stdio/setvbuf_test.cpp:20:1: error: use of undeclared identifier 'addTest'
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc/test/UnitTest/LibcTest.h:396:33: note: expanded from macro 'TEST_F'
    SuiteClass##_##TestName() { addTest(this); }                               \
                                ^
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc/test/src/stdio/setvbuf_test.cpp:28:3: error: no matching function for call to 'test'
  ASSERT_FALSE(fw == nullptr);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc/test/UnitTest/LibcTest.h:462:27: note: expanded from macro 'ASSERT_FALSE'
#define ASSERT_FALSE(VAL) ASSERT_EQ(VAL, false)
                          ^~~~~~~~~~~~~~~~~~~~~
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc/test/UnitTest/LibcTest.h:438:29: note: expanded from macro 'ASSERT_EQ'
#define ASSERT_EQ(LHS, RHS) LIBC_TEST_BINOP_(EQ, LHS, RHS, return)
                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc/test/UnitTest/LibcTest.h:430:26: note: expanded from macro 'LIBC_TEST_BINOP_'
  LIBC_TEST_SCAFFOLDING_(test(LIBC_NAMESPACE::testing::TestCond::COND, LHS,    \
                         ^~~~
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc/test/UnitTest/LibcTest.h:423:7: note: expanded from macro 'LIBC_TEST_SCAFFOLDING_'
  if (TEST)                                                                    \
      ^~~~
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc/test/UnitTest/LibcTest.h:99:6: note: candidate function template not viable: requires 7 arguments, but 6 were provided
bool test(RunContext *Ctx, TestCond Cond, ValType LHS, ValType RHS,

@llvm-ci
Copy link
Collaborator

llvm-ci commented Jun 11, 2025

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/14573

Here is the relevant piece of the build log for the reference
Step 4 (annotate) failure: 'python ../llvm-zorg/zorg/buildbot/builders/annotated/libc-linux.py ...' (failure)
...
[ RUN      ] LlvmLibcStdcBitceilUlTest.Zero
[       OK ] LlvmLibcStdcBitceilUlTest.Zero (4 us)
[ RUN      ] LlvmLibcStdcBitceilUlTest.Ones
[       OK ] LlvmLibcStdcBitceilUlTest.Ones (20 us)
[ RUN      ] LlvmLibcStdcBitceilUlTest.OneLessThanPowsTwo
[       OK ] LlvmLibcStdcBitceilUlTest.OneLessThanPowsTwo (19 us)
[ RUN      ] LlvmLibcStdcBitceilUlTest.OneMoreThanPowsTwo
[       OK ] LlvmLibcStdcBitceilUlTest.OneMoreThanPowsTwo (19 us)
Ran 4 tests.  PASS: 4  FAIL: 0
[763/1106] Building CXX object libc/test/src/stdio/CMakeFiles/libc.test.src.stdio.setvbuf_test.__unit__.__build__.dir/setvbuf_test.cpp.o
FAILED: libc/test/src/stdio/CMakeFiles/libc.test.src.stdio.setvbuf_test.__unit__.__build__.dir/setvbuf_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.setvbuf_test.__unit__.__build__.dir/setvbuf_test.cpp.o -MF libc/test/src/stdio/CMakeFiles/libc.test.src.stdio.setvbuf_test.__unit__.__build__.dir/setvbuf_test.cpp.o.d -o libc/test/src/stdio/CMakeFiles/libc.test.src.stdio.setvbuf_test.__unit__.__build__.dir/setvbuf_test.cpp.o -c /home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/test/src/stdio/setvbuf_test.cpp
/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/test/src/stdio/setvbuf_test.cpp:18:54: error: no type named 'ErrnoCheckingTest' in namespace '__llvm_libc_20_0_0_git::testing'
using LlvmLibcSetvbufTest = LIBC_NAMESPACE::testing::ErrnoCheckingTest;
                            ~~~~~~~~~~~~~~~~~~~~~~~~~^
/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/test/src/stdio/setvbuf_test.cpp:20:8: error: expected class name
TEST_F(LlvmLibcSetvbufTest, SetNBFBuffer) {
       ^
/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/test/src/stdio/setvbuf_test.cpp:20:1: error: only virtual member functions can be marked 'override'
TEST_F(LlvmLibcSetvbufTest, SetNBFBuffer) {
^
/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/test/UnitTest/LibcTest.h:397:16: note: expanded from macro 'TEST_F'
    void Run() override;                                                       \
               ^
/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/test/src/stdio/setvbuf_test.cpp:20:1: error: only virtual member functions can be marked 'override'
/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/test/UnitTest/LibcTest.h:398:33: note: expanded from macro 'TEST_F'
    const char *getName() const override { return #SuiteClass "." #TestName; } \
                                ^
/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/test/src/stdio/setvbuf_test.cpp:20:1: error: use of undeclared identifier 'addTest'
/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/test/UnitTest/LibcTest.h:396:33: note: expanded from macro 'TEST_F'
    SuiteClass##_##TestName() { addTest(this); }                               \
                                ^
/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/test/src/stdio/setvbuf_test.cpp:28:3: error: no matching function for call to 'test'
  ASSERT_FALSE(fw == nullptr);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/test/UnitTest/LibcTest.h:462:27: note: expanded from macro 'ASSERT_FALSE'
#define ASSERT_FALSE(VAL) ASSERT_EQ(VAL, false)
                          ^~~~~~~~~~~~~~~~~~~~~
/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/test/UnitTest/LibcTest.h:438:29: note: expanded from macro 'ASSERT_EQ'
#define ASSERT_EQ(LHS, RHS) LIBC_TEST_BINOP_(EQ, LHS, RHS, return)
                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/test/UnitTest/LibcTest.h:430:26: note: expanded from macro 'LIBC_TEST_BINOP_'
  LIBC_TEST_SCAFFOLDING_(test(LIBC_NAMESPACE::testing::TestCond::COND, LHS,    \
                         ^~~~
/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/test/UnitTest/LibcTest.h:423:7: note: expanded from macro 'LIBC_TEST_SCAFFOLDING_'
  if (TEST)                                                                    \
      ^~~~
/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/test/UnitTest/LibcTest.h:99:6: note: candidate function template not viable: requires 7 arguments, but 6 were provided
bool test(RunContext *Ctx, TestCond Cond, ValType LHS, ValType RHS,
Step 8 (libc-unit-tests) failure: libc-unit-tests (failure)
...
[ RUN      ] LlvmLibcStdcBitceilUlTest.Zero
[       OK ] LlvmLibcStdcBitceilUlTest.Zero (4 us)
[ RUN      ] LlvmLibcStdcBitceilUlTest.Ones
[       OK ] LlvmLibcStdcBitceilUlTest.Ones (20 us)
[ RUN      ] LlvmLibcStdcBitceilUlTest.OneLessThanPowsTwo
[       OK ] LlvmLibcStdcBitceilUlTest.OneLessThanPowsTwo (19 us)
[ RUN      ] LlvmLibcStdcBitceilUlTest.OneMoreThanPowsTwo
[       OK ] LlvmLibcStdcBitceilUlTest.OneMoreThanPowsTwo (19 us)
Ran 4 tests.  PASS: 4  FAIL: 0
[763/1106] Building CXX object libc/test/src/stdio/CMakeFiles/libc.test.src.stdio.setvbuf_test.__unit__.__build__.dir/setvbuf_test.cpp.o
FAILED: libc/test/src/stdio/CMakeFiles/libc.test.src.stdio.setvbuf_test.__unit__.__build__.dir/setvbuf_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.setvbuf_test.__unit__.__build__.dir/setvbuf_test.cpp.o -MF libc/test/src/stdio/CMakeFiles/libc.test.src.stdio.setvbuf_test.__unit__.__build__.dir/setvbuf_test.cpp.o.d -o libc/test/src/stdio/CMakeFiles/libc.test.src.stdio.setvbuf_test.__unit__.__build__.dir/setvbuf_test.cpp.o -c /home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/test/src/stdio/setvbuf_test.cpp
/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/test/src/stdio/setvbuf_test.cpp:18:54: error: no type named 'ErrnoCheckingTest' in namespace '__llvm_libc_20_0_0_git::testing'
using LlvmLibcSetvbufTest = LIBC_NAMESPACE::testing::ErrnoCheckingTest;
                            ~~~~~~~~~~~~~~~~~~~~~~~~~^
/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/test/src/stdio/setvbuf_test.cpp:20:8: error: expected class name
TEST_F(LlvmLibcSetvbufTest, SetNBFBuffer) {
       ^
/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/test/src/stdio/setvbuf_test.cpp:20:1: error: only virtual member functions can be marked 'override'
TEST_F(LlvmLibcSetvbufTest, SetNBFBuffer) {
^
/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/test/UnitTest/LibcTest.h:397:16: note: expanded from macro 'TEST_F'
    void Run() override;                                                       \
               ^
/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/test/src/stdio/setvbuf_test.cpp:20:1: error: only virtual member functions can be marked 'override'
/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/test/UnitTest/LibcTest.h:398:33: note: expanded from macro 'TEST_F'
    const char *getName() const override { return #SuiteClass "." #TestName; } \
                                ^
/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/test/src/stdio/setvbuf_test.cpp:20:1: error: use of undeclared identifier 'addTest'
/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/test/UnitTest/LibcTest.h:396:33: note: expanded from macro 'TEST_F'
    SuiteClass##_##TestName() { addTest(this); }                               \
                                ^
/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/test/src/stdio/setvbuf_test.cpp:28:3: error: no matching function for call to 'test'
  ASSERT_FALSE(fw == nullptr);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/test/UnitTest/LibcTest.h:462:27: note: expanded from macro 'ASSERT_FALSE'
#define ASSERT_FALSE(VAL) ASSERT_EQ(VAL, false)
                          ^~~~~~~~~~~~~~~~~~~~~
/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/test/UnitTest/LibcTest.h:438:29: note: expanded from macro 'ASSERT_EQ'
#define ASSERT_EQ(LHS, RHS) LIBC_TEST_BINOP_(EQ, LHS, RHS, return)
                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/test/UnitTest/LibcTest.h:430:26: note: expanded from macro 'LIBC_TEST_BINOP_'
  LIBC_TEST_SCAFFOLDING_(test(LIBC_NAMESPACE::testing::TestCond::COND, LHS,    \
                         ^~~~
/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/test/UnitTest/LibcTest.h:423:7: note: expanded from macro 'LIBC_TEST_SCAFFOLDING_'
  if (TEST)                                                                    \
      ^~~~
/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/test/UnitTest/LibcTest.h:99:6: note: candidate function template not viable: requires 7 arguments, but 6 were provided
bool test(RunContext *Ctx, TestCond Cond, ValType LHS, ValType RHS,

michaelrj-google added a commit to michaelrj-google/llvm-project that referenced this pull request Jun 11, 2025
In llvm#143802 the stdio test cleanup missed a few places where errno was
being set to a failing value, and one where the framework needed to
included.
michaelrj-google added a commit that referenced this pull request Jun 11, 2025
In #143802 the stdio test cleanup missed a few places where errno was
being set to a failing value, and one where the framework needed to
included.
@llvm-ci
Copy link
Collaborator

llvm-ci commented Jun 12, 2025

LLVM Buildbot has detected a new failure on builder libc-riscv32-qemu-yocto-fullbuild-dbg running on rv32gc-qemu-system while building libc at step 4 "annotate".

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

Here is the relevant piece of the build log for the reference
Step 4 (annotate) failure: 'python ../llvm-zorg/zorg/buildbot/builders/annotated/libc-linux.py ...' (failure)
...
-- Build files have been written to: /home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/build
@@@BUILD_STEP build libc@@@
Running: ninja libc
ninja: no work to do.
@@@BUILD_STEP build libc-startup@@@
Running: ninja libc-startup
ninja: no work to do.
@@@BUILD_STEP libc-unit-tests@@@
Running: ninja libc-unit-tests
[1/1052] Building CXX object libc/test/src/stdio/CMakeFiles/libc.test.src.stdio.setvbuf_test.__unit__.__build__.dir/setvbuf_test.cpp.o
FAILED: libc/test/src/stdio/CMakeFiles/libc.test.src.stdio.setvbuf_test.__unit__.__build__.dir/setvbuf_test.cpp.o 
/usr/local/bin/clang++ -DLIBC_NAMESPACE=__llvm_libc_21_0_0_git -D_DEBUG -I/home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc -isystem /home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/build/libc/include -mabi=ilp32d -march=rv32imafdc --target=riscv32-unknown-linux-gnu --sysroot=/opt/riscv/sysroot --gcc-toolchain=/opt/riscv -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 -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -g -std=gnu++17 --target=riscv32-unknown-linux-gnu -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 -ffixed-point -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 -MD -MT libc/test/src/stdio/CMakeFiles/libc.test.src.stdio.setvbuf_test.__unit__.__build__.dir/setvbuf_test.cpp.o -MF libc/test/src/stdio/CMakeFiles/libc.test.src.stdio.setvbuf_test.__unit__.__build__.dir/setvbuf_test.cpp.o.d -o libc/test/src/stdio/CMakeFiles/libc.test.src.stdio.setvbuf_test.__unit__.__build__.dir/setvbuf_test.cpp.o -c /home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/test/src/stdio/setvbuf_test.cpp
/home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/test/src/stdio/setvbuf_test.cpp:18:54: error: no type named 'ErrnoCheckingTest' in namespace '__llvm_libc_21_0_0_git::testing'
   18 | using LlvmLibcSetvbufTest = LIBC_NAMESPACE::testing::ErrnoCheckingTest;
      |                             ~~~~~~~~~~~~~~~~~~~~~~~~~^
/home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/test/src/stdio/setvbuf_test.cpp:20:8: error: expected class name
   20 | TEST_F(LlvmLibcSetvbufTest, SetNBFBuffer) {
      |        ^
/home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/test/src/stdio/setvbuf_test.cpp:20:1: error: only virtual member functions can be marked 'override'
   20 | TEST_F(LlvmLibcSetvbufTest, SetNBFBuffer) {
      | ^
/home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/test/UnitTest/LibcTest.h:397:16: note: expanded from macro 'TEST_F'
  397 |     void Run() override;                                                       \
      |                ^
/home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/test/src/stdio/setvbuf_test.cpp:20:1: error: only virtual member functions can be marked 'override'
/home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/test/UnitTest/LibcTest.h:398:33: note: expanded from macro 'TEST_F'
  398 |     const char *getName() const override { return #SuiteClass "." #TestName; } \
      |                                 ^
/home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/test/src/stdio/setvbuf_test.cpp:20:1: error: use of undeclared identifier 'addTest'
/home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/test/UnitTest/LibcTest.h:396:33: note: expanded from macro 'TEST_F'
  396 |     SuiteClass##_##TestName() { addTest(this); }                               \
      |                                 ^
/home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/test/src/stdio/setvbuf_test.cpp:28:3: error: no matching function for call to 'test'
   28 |   ASSERT_FALSE(fw == nullptr);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/test/UnitTest/LibcTest.h:462:27: note: expanded from macro 'ASSERT_FALSE'
  462 | #define ASSERT_FALSE(VAL) ASSERT_EQ(VAL, false)
      |                           ^~~~~~~~~~~~~~~~~~~~~
/home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/test/UnitTest/LibcTest.h:438:29: note: expanded from macro 'ASSERT_EQ'
  438 | #define ASSERT_EQ(LHS, RHS) LIBC_TEST_BINOP_(EQ, LHS, RHS, return)
      |                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/test/UnitTest/LibcTest.h:430:26: note: expanded from macro 'LIBC_TEST_BINOP_'
  430 |   LIBC_TEST_SCAFFOLDING_(test(LIBC_NAMESPACE::testing::TestCond::COND, LHS,    \
      |                          ^~~~
/home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/test/UnitTest/LibcTest.h:423:7: note: expanded from macro 'LIBC_TEST_SCAFFOLDING_'
  423 |   if (TEST)                                                                    \
      |       ^~~~
/home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/test/UnitTest/LibcTest.h:99:6: note: candidate function template not viable: requires 7 arguments, but 6 were provided
   99 | bool test(RunContext *Ctx, TestCond Cond, ValType LHS, ValType RHS,

Kewen12 added a commit to Kewen12/llvm-project that referenced this pull request Jun 12, 2025
ronlieb pushed a commit that referenced this pull request Jun 12, 2025
vonosmas added a commit that referenced this pull request Jun 12, 2025
vonosmas added a commit that referenced this pull request Jun 12, 2025
Reverts #143802. Follow-up fix
3c7af17 wasn't robust enough and itself
got reverted.
llvm-sync bot pushed a commit to arm/arm-toolchain that referenced this pull request Jun 12, 2025
…(#143829)

Reverts llvm/llvm-project#143802. Follow-up fix
3c7af17 wasn't robust enough and itself
got reverted.
tomtor pushed a commit to tomtor/llvm-project that referenced this pull request Jun 14, 2025
Reduce the direct use of libc_errno in stdio unit tests by adopting
ErrnoCheckingTest where appropriate.

Also removes the libc_errno.h inclusions from stdlib.h tests that were
accidentally added in d87eea3
tomtor pushed a commit to tomtor/llvm-project that referenced this pull request Jun 14, 2025
In llvm#143802 the stdio test cleanup missed a few places where errno was
being set to a failing value, and one where the framework needed to
included.
tomtor pushed a commit to tomtor/llvm-project that referenced this pull request Jun 14, 2025
tomtor pushed a commit to tomtor/llvm-project that referenced this pull request Jun 14, 2025
Reverts llvm#143802. Follow-up fix
3c7af17 wasn't robust enough and itself
got reverted.
akuhlens pushed a commit to akuhlens/llvm-project that referenced this pull request Jun 24, 2025
Reduce the direct use of libc_errno in stdio unit tests by adopting
ErrnoCheckingTest where appropriate.

Also removes the libc_errno.h inclusions from stdlib.h tests that were
accidentally added in d87eea3
akuhlens pushed a commit to akuhlens/llvm-project that referenced this pull request Jun 24, 2025
In llvm#143802 the stdio test cleanup missed a few places where errno was
being set to a failing value, and one where the framework needed to
included.
akuhlens pushed a commit to akuhlens/llvm-project that referenced this pull request Jun 24, 2025
akuhlens pushed a commit to akuhlens/llvm-project that referenced this pull request Jun 24, 2025
Reverts llvm#143802. Follow-up fix
3c7af17 wasn't robust enough and itself
got reverted.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants