We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9b8ec4d commit 31c582aCopy full SHA for 31c582a
lldb/unittests/Host/linux/HostTest.cpp
@@ -61,4 +61,14 @@ TEST_F(HostTest, GetProcessInfo) {
61
EXPECT_TRUE(Info.GetArchitecture().IsValid());
62
EXPECT_EQ(HostInfo::GetArchitecture(HostInfo::eArchKindDefault),
63
Info.GetArchitecture());
64
+ // Test timings
65
+ ASSERT_TRUE(Host::GetProcessInfo(getpid(), Info));
66
+ ProcessInstanceInfo::timespec user_time = Info.GetUserTime();
67
+ for (unsigned i = 0; i < 10'000'000; i++) {
68
+ __asm__ __volatile__("" : "+g"(i) : :);
69
+ }
70
71
+ ProcessInstanceInfo::timespec next_user_time = Info.GetUserTime();
72
+ ASSERT_TRUE(user_time.tv_sec < next_user_time.tv_sec ||
73
+ user_time.tv_usec < next_user_time.tv_usec);
74
}
0 commit comments