xref: /llvm-project/libc/test/src/time/clock_test.cpp (revision f9c2377fb68e5051b3061186c507f7b87db2a8b2)
122ea0e5dSSiva Chandra Reddy //===-- Unittests for clock -----------------------------------------------===//
222ea0e5dSSiva Chandra Reddy //
322ea0e5dSSiva Chandra Reddy // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
422ea0e5dSSiva Chandra Reddy // See https://llvm.org/LICENSE.txt for license information.
522ea0e5dSSiva Chandra Reddy // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
622ea0e5dSSiva Chandra Reddy //
722ea0e5dSSiva Chandra Reddy //===----------------------------------------------------------------------===//
822ea0e5dSSiva Chandra Reddy 
9*f9c2377fSMichael Jones #include "hdr/types/clock_t.h"
1022ea0e5dSSiva Chandra Reddy #include "src/time/clock.h"
11af1315c2SSiva Chandra Reddy #include "test/UnitTest/Test.h"
1222ea0e5dSSiva Chandra Reddy 
1322ea0e5dSSiva Chandra Reddy TEST(LlvmLibcClockTest, SmokeTest) {
14b6bc9d72SGuillaume Chatelet   clock_t c1 = LIBC_NAMESPACE::clock();
1522ea0e5dSSiva Chandra Reddy   ASSERT_GT(c1, clock_t(0));
1622ea0e5dSSiva Chandra Reddy 
17b6bc9d72SGuillaume Chatelet   clock_t c2 = LIBC_NAMESPACE::clock();
1822ea0e5dSSiva Chandra Reddy   ASSERT_GE(c2, c1);
1922ea0e5dSSiva Chandra Reddy }
20