[libc] Fix call to clock_gettime (#65166)

The calls were missing the __llvm_libc:: namespace, which can allow the
test case to be linked to glibc's clock_gettime.
This commit is contained in:
Mikhail R. Gadelha 2023-09-06 15:26:20 -03:00 committed by GitHub
parent a8138c3d2f
commit ce3bade0cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -14,7 +14,7 @@
TEST(LlvmLibcClockGetTime, RealTime) {
struct timespec tp;
int result;
result = clock_gettime(CLOCK_REALTIME, &tp);
result = __llvm_libc::clock_gettime(CLOCK_REALTIME, &tp);
ASSERT_EQ(result, 0);
ASSERT_GT(tp.tv_sec, time_t(0));
}
@ -23,10 +23,10 @@ TEST(LlvmLibcClockGetTime, RealTime) {
TEST(LlvmLibcClockGetTime, MonotonicTime) {
struct timespec tp1, tp2;
int result;
result = clock_gettime(CLOCK_MONOTONIC, &tp1);
result = __llvm_libc::clock_gettime(CLOCK_MONOTONIC, &tp1);
ASSERT_EQ(result, 0);
ASSERT_GT(tp1.tv_sec, time_t(0));
result = clock_gettime(CLOCK_MONOTONIC, &tp2);
result = __llvm_libc::clock_gettime(CLOCK_MONOTONIC, &tp2);
ASSERT_EQ(result, 0);
ASSERT_GE(tp2.tv_sec, tp1.tv_sec); // The monotonic clock should increase.
if (tp2.tv_sec == tp1.tv_sec) {