[libc-commits] [libc] [libc] Allow hermetic timing if the `clock` function is built (PR #71092)

Joseph Huber via libc-commits libc-commits at lists.llvm.org
Thu Nov 2 12:47:14 PDT 2023


================
@@ -147,7 +140,7 @@ int Test::runTests(const char *TestFilter) {
       break;
     case RunContext::RunResult::Pass:
       tlog << GREEN << "[       OK ] " << RESET << TestName;
-#if __STDC_HOSTED__ || defined(LIBC_TARGET_ARCH_IS_GPU)
+#ifdef LIBC_TEST_USE_CLOCK
----------------
jhuber6 wrote:

This guards usage of the `clock()` function. We could potentially make it print something if unimplemented, or default to just return zero or something.

https://github.com/llvm/llvm-project/pull/71092


More information about the libc-commits mailing list