Skip to content

Commit ce3bade

Browse files
[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.
1 parent a8138c3 commit ce3bade

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

libc/test/src/time/clock_gettime_test.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
TEST(LlvmLibcClockGetTime, RealTime) {
1515
struct timespec tp;
1616
int result;
17-
result = clock_gettime(CLOCK_REALTIME, &tp);
17+
result = __llvm_libc::clock_gettime(CLOCK_REALTIME, &tp);
1818
ASSERT_EQ(result, 0);
1919
ASSERT_GT(tp.tv_sec, time_t(0));
2020
}
@@ -23,10 +23,10 @@ TEST(LlvmLibcClockGetTime, RealTime) {
2323
TEST(LlvmLibcClockGetTime, MonotonicTime) {
2424
struct timespec tp1, tp2;
2525
int result;
26-
result = clock_gettime(CLOCK_MONOTONIC, &tp1);
26+
result = __llvm_libc::clock_gettime(CLOCK_MONOTONIC, &tp1);
2727
ASSERT_EQ(result, 0);
2828
ASSERT_GT(tp1.tv_sec, time_t(0));
29-
result = clock_gettime(CLOCK_MONOTONIC, &tp2);
29+
result = __llvm_libc::clock_gettime(CLOCK_MONOTONIC, &tp2);
3030
ASSERT_EQ(result, 0);
3131
ASSERT_GE(tp2.tv_sec, tp1.tv_sec); // The monotonic clock should increase.
3232
if (tp2.tv_sec == tp1.tv_sec) {

0 commit comments

Comments
 (0)