llvm-project/flang/unittests/Runtime
Diana Picus 0104cc85b1 [flang] Add default implementation for SYSTEM_CLOCK
Add an implementation for the runtime functions related to SYSTEM_CLOCK.
As with CPU_TIME, this is based on std::clock(), which should be
available everywhere, but it is highly recommended to add
platform-specific implementations for systems where std::clock() behaves
poorly (e.g. POSIX).

The documentation for std::clock() doesn't specify a maximum value and
in fact wrap around behaviour is non-conforming.  Therefore, this
implementation of SYSTEM_CLOCK is not guaranteed to wrap around either,
and after std::clock reaches its maximum value we will likely just
return failure rather than wrap around. If this happens often on your
system, please add a new platform-specific implementation.

We define COUNT_MAX as either the maximum value that can be stored in
a std::clock_t or in a 64-bit integer (whichever is smaller), and
COUNT_RATE as CLOCKS_PER_SEC. For POSIX systems, the value of
CLOCKS_PER_SEC is hardcoded to 10^6 and irrelevant for the values
returned by std::clock.

Differential Revision: https://reviews.llvm.org/D105969
2021-08-18 07:39:13 +00:00
..
BufferTest.cpp [flang] Move External IO tests to use GTest 2021-07-30 10:22:01 -06:00
CMakeLists.txt [flang] Move External IO tests to use GTest 2021-07-30 10:22:01 -06:00
CharacterTest.cpp [flang] Move External IO tests to use GTest 2021-07-30 10:22:01 -06:00
CrashHandlerFixture.cpp [flang] Move External IO tests to use GTest 2021-07-30 10:22:01 -06:00
CrashHandlerFixture.h [flang] Move External IO tests to use GTest 2021-07-30 10:22:01 -06:00
ExternalIOTest.cpp [flang] Move External IO tests to use GTest 2021-07-30 10:22:01 -06:00
Format.cpp [flang] Move External IO tests to use GTest 2021-07-30 10:22:01 -06:00
ListInputTest.cpp [flang] Fix list-directed plural repeated null values at end of record 2021-08-11 13:14:07 -07:00
Matmul.cpp [flang] Move External IO tests to use GTest 2021-07-30 10:22:01 -06:00
MiscIntrinsic.cpp [flang] Move External IO tests to use GTest 2021-07-30 10:22:01 -06:00
Namelist.cpp [flang] Move External IO tests to use GTest 2021-07-30 10:22:01 -06:00
Numeric.cpp [flang] Correct off-by-one error in SET_EXPONENT 2021-08-12 12:50:16 -07:00
NumericalFormatTest.cpp [flang] runtime: For Fw.d formatting, don't oscillate forever 2021-08-04 12:19:23 -07:00
Random.cpp [flang] Move External IO tests to use GTest 2021-07-30 10:22:01 -06:00
Reduction.cpp [flang] Move External IO tests to use GTest 2021-07-30 10:22:01 -06:00
RuntimeCrashTest.cpp [flang] Move External IO tests to use GTest 2021-07-30 10:22:01 -06:00
Time.cpp [flang] Add default implementation for SYSTEM_CLOCK 2021-08-18 07:39:13 +00:00
Transformational.cpp [flang] Fix the vector version of EOSHIFT with a BOUNDARY argument 2021-08-17 15:20:15 -07:00
tools.h [flang] Move External IO tests to use GTest 2021-07-30 10:22:01 -06:00