[all-commits] [llvm/llvm-project] 158d7b: [libc] Allow hermetic timing if the `clock` functi...

Joseph Huber via All-commits all-commits at lists.llvm.org
Thu Nov 2 13:03:32 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 158d7b8c23990771f8f8688ae43b037440ae9528
      https://github.com/llvm/llvm-project/commit/158d7b8c23990771f8f8688ae43b037440ae9528
  Author: Joseph Huber <jhuber6 at vols.utk.edu>
  Date:   2023-11-02 (Thu, 02 Nov 2023)

  Changed paths:
    M libc/cmake/modules/LLVMLibCTestRules.cmake
    M libc/test/UnitTest/CMakeLists.txt
    M libc/test/UnitTest/LibcTest.cpp

  Log Message:
  -----------
  [libc] Allow hermetic timing if the `clock` function is built (#71092)

Summary:
This patch fixes some code duplication on the GPU. The GPU build wanted
to enable timing for hermetic tests so it built some special case
handling into the test suite. Now that `clock` is supported on the
target we can simply link against the external interface. Because we
include `clock.h` for the CLOCKS_PER_SEC macro we remap the C entrypoint
to the internal one if it ends up called. This should allow hermetic
tests to run with timing if it is supported.




More information about the All-commits mailing list