Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 8 additions & 11 deletions lldb/unittests/Host/posix/HostTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@
#include <cerrno>
#include <sys/resource.h>

#ifdef __linux__
#include <linux/version.h>
#endif // __linux__

using namespace lldb_private;

namespace {
Expand Down Expand Up @@ -120,12 +116,13 @@ TEST_F(HostTest, GetProcessInfoSetsPriority) {
ASSERT_TRUE(Info.IsZombie().has_value());
ASSERT_FALSE(Info.IsZombie().value());

// CoreDumping was added in kernel version 4.15.
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
ASSERT_TRUE(Info.IsCoreDumping().has_value());
ASSERT_FALSE(Info.IsCoreDumping().value());
#else
ASSERT_FALSE(Info.IsCoreDumping().has_value());
#endif
const llvm::VersionTuple host_version = HostInfo::GetOSVersion();
ASSERT_FALSE(host_version.empty());
if (host_version >= llvm::VersionTuple(4, 15, 0)) {
ASSERT_TRUE(Info.IsCoreDumping().has_value());
ASSERT_FALSE(Info.IsCoreDumping().value());
} else {
ASSERT_FALSE(Info.IsCoreDumping().has_value());
}
}
#endif
Loading