Skip to content

Commit 598ac33

Browse files
committed
[lldb][test] check if CoreDumping is supported at runtime
1 parent bbc894a commit 598ac33

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

lldb/unittests/Host/posix/HostTest.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,14 @@ TEST_F(HostTest, GetProcessInfoSetsPriority) {
116116
ASSERT_TRUE(Info.IsZombie().has_value());
117117
ASSERT_FALSE(Info.IsZombie().value());
118118

119-
ASSERT_TRUE(Info.IsCoreDumping().has_value());
120-
ASSERT_FALSE(Info.IsCoreDumping().value());
119+
const llvm::VersionTuple host_version = HostInfo::GetOSVersion();
120+
if (!host_version.empty()) {
121+
if (host_version >= llvm::VersionTuple(4, 15, 0)) {
122+
ASSERT_TRUE(Info.IsCoreDumping().has_value());
123+
ASSERT_FALSE(Info.IsCoreDumping().value());
124+
} else {
125+
ASSERT_FALSE(Info.IsCoreDumping().has_value());
126+
}
127+
}
121128
}
122129
#endif

0 commit comments

Comments
 (0)