Revert "[lldb][test] Remove compiler version check and use regex" (#124101)
[llvm-project.git] / libc / test / src / time / time_test.cpp
blob7cdb4e834633e5894f305c1a42b31931520a5f36
1 //===-- Unittests for time ------------------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
9 #include "src/time/time_func.h"
10 #include "test/UnitTest/Test.h"
12 TEST(LlvmLibcTimeTest, SmokeTest) {
13 time_t t1;
14 time_t t2 = LIBC_NAMESPACE::time(&t1);
15 ASSERT_EQ(t1, t2);
16 ASSERT_GT(t1, time_t(0));
18 time_t t3 = LIBC_NAMESPACE::time(nullptr);
19 ASSERT_GE(t3, t1);