[Lldb-commits] [lldb] 6a50aa7 - [lldb] Add linux test for the three-arg version of getProcFile (#146500)

via lldb-commits lldb-commits at lists.llvm.org
Thu Jul 3 02:02:52 PDT 2025


Author: Pavel Labath
Date: 2025-07-03T11:02:49+02:00
New Revision: 6a50aa77821dc6b031947e0d29f909e204d2bc1d

URL: https://github.com/llvm/llvm-project/commit/6a50aa77821dc6b031947e0d29f909e204d2bc1d
DIFF: https://github.com/llvm/llvm-project/commit/6a50aa77821dc6b031947e0d29f909e204d2bc1d.diff

LOG: [lldb] Add linux test for the three-arg version of getProcFile (#146500)

Also conditionalize the header includes. Not strictly necessary, but
it's weird to include an aix header on non-aix builds, it makes
clang-tidy complain, and breaks build systems which require you to
declare all headers belonging to a library (aka bazel).

Added: 
    

Modified: 
    lldb/unittests/Host/posix/SupportTest.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/unittests/Host/posix/SupportTest.cpp b/lldb/unittests/Host/posix/SupportTest.cpp
index e4d7ba89fece6..5393ad83ad8ac 100644
--- a/lldb/unittests/Host/posix/SupportTest.cpp
+++ b/lldb/unittests/Host/posix/SupportTest.cpp
@@ -7,10 +7,15 @@
 //===----------------------------------------------------------------------===//
 
 #include "lldb/Host/posix/Support.h"
-#include "lldb/Host/aix/Support.h"
 #include "llvm/Support/Threading.h"
 #include "gtest/gtest.h"
 
+#if defined(_AIX)
+#include "lldb/Host/aix/Support.h"
+#elif defined(__linux__)
+#include "lldb/Host/linux/Support.h"
+#endif
+
 using namespace lldb_private;
 
 #ifndef __APPLE__
@@ -21,10 +26,16 @@ TEST(Support, getProcFile_Pid) {
 }
 #endif // #ifndef __APPLE__
 
-#if defined(_AIX) && defined(LLVM_ENABLE_THREADING)
+#if defined(_AIX) || defined(__linux__)
 TEST(Support, getProcFile_Tid) {
-  auto BufferOrError = getProcFile(getpid(), llvm::get_threadid(), "lwpstatus");
+  auto BufferOrError = getProcFile(getpid(), llvm::get_threadid(),
+#ifdef _AIX
+                                   "lwpstatus"
+#else
+                                   "status"
+#endif
+  );
   ASSERT_TRUE(BufferOrError);
   ASSERT_TRUE(*BufferOrError);
 }
-#endif // #ifdef _AIX && LLVM_ENABLE_THREADING
+#endif // #if defined(_AIX) || defined(__linux__)


        


More information about the lldb-commits mailing list