Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / libc / test / src / time / clock_test.cpp
bloba3dffc6bae3913dc32774138a9c0a66c629d3070
1 //===-- Unittests for clock -----------------------------------------------===//
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/clock.h"
10 #include "test/UnitTest/Test.h"
12 #include <limits.h>
13 #include <time.h>
15 TEST(LlvmLibcClockTest, SmokeTest) {
16 clock_t c1 = LIBC_NAMESPACE::clock();
17 ASSERT_GT(c1, clock_t(0));
19 clock_t c2 = LIBC_NAMESPACE::clock();
20 ASSERT_GE(c2, c1);