[test-suite] r340323 - cmake/litsupport: Always use timeit-target in lit; NFC

Simon Atanasyan via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 29 06:29:56 PST 2019


Hi Matthias,

I'm sorry for a bit delayed reaction on the commit.

Before this change I could cross-compile the test suite for MIPS
architecture and run tests under QEMU using TEST_SUITE_RUN_UNDER
argument passed to cmake. In that case "host" timeit runs QEMU with
the test executable file and the test results compared by the "host"
fpcmp. After this change timeit-target and fpcmp are always used for
running test and comparing test results. But they are MIPS executables
and obviously failed on X86 hosts.

Are there any workaround for this case?


On Tue, Aug 21, 2018 at 10:25 PM Matthias Braun via llvm-commits
<llvm-commits at lists.llvm.org> wrote:
>
> Author: matze
> Date: Tue Aug 21 12:24:53 2018
> New Revision: 340323
>
> URL: http://llvm.org/viewvc/llvm-project?rev=340323&view=rev
> Log:
> cmake/litsupport: Always use timeit-target in lit; NFC
>
> Simplify things by always using timeit-target instead of switching
> between timeit/timeit-target depending on the configuration.
>
> Modified:
>     test-suite/trunk/cmake/modules/TestSuite.cmake
>     test-suite/trunk/litsupport/modules/timeit.py
>     test-suite/trunk/tools/CMakeLists.txt
>
> Modified: test-suite/trunk/cmake/modules/TestSuite.cmake
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/cmake/modules/TestSuite.cmake?rev=340323&r1=340322&r2=340323&view=diff
> ==============================================================================
> --- test-suite/trunk/cmake/modules/TestSuite.cmake (original)
> +++ test-suite/trunk/cmake/modules/TestSuite.cmake Tue Aug 21 12:24:53 2018
> @@ -52,10 +52,7 @@ endfunction()
>  # usually do not need to call this directly when using `llvm_test_executable`
>  # or `llvm_test_library`.
>  function(test_suite_add_build_dependencies target)
> -  if(NOT TEST_SUITE_USE_PERF)
> -    add_dependencies(${target} timeit-target)
> -  endif()
> -  add_dependencies(${target} timeit-host fpcmp-host)
> +  add_dependencies(${target} build-timeit build-timeit-target build-fpcmp)
>  endfunction()
>
>  # Internal function that transforms a list of flags to a string and appends
>
> Modified: test-suite/trunk/litsupport/modules/timeit.py
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/litsupport/modules/timeit.py?rev=340323&r1=340322&r2=340323&view=diff
> ==============================================================================
> --- test-suite/trunk/litsupport/modules/timeit.py (original)
> +++ test-suite/trunk/litsupport/modules/timeit.py Tue Aug 21 12:24:53 2018
> @@ -10,9 +10,7 @@ def _mutateCommandLine(context, commandl
>      config = context.config
>      cmd = shellcommand.parse(commandline)
>
> -    timeit = "%s/tools/timeit" % config.test_source_root
> -    if config.remote_host:
> -        timeit = "%s/tools/timeit-target" % config.test_source_root
> +    timeit = "%s/tools/timeit-target" % config.test_source_root
>      args = ["--limit-core", "0"]
>      args += ["--limit-cpu", "7200"]
>      args += ["--timeout", "7200"]
>
> Modified: test-suite/trunk/tools/CMakeLists.txt
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/tools/CMakeLists.txt?rev=340323&r1=340322&r2=340323&view=diff
> ==============================================================================
> --- test-suite/trunk/tools/CMakeLists.txt (original)
> +++ test-suite/trunk/tools/CMakeLists.txt Tue Aug 21 12:24:53 2018
> @@ -5,16 +5,23 @@
>
>  include(Host)
>
> -llvm_add_host_executable(fpcmp-host fpcmp fpcmp.c)
> +llvm_add_host_executable(build-fpcmp fpcmp fpcmp.c)
>
>  option(TEST_SUITE_USE_PERF "Use perf (timeit.sh) instead of timeit.c" Off)
>  if(TEST_SUITE_USE_PERF)
>    add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/timeit
> -    COMMAND cp ${CMAKE_CURRENT_SOURCE_DIR}/timeit.sh ${CMAKE_CURRENT_BINARY_DIR}/timeit
> +    COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/timeit.sh ${CMAKE_CURRENT_BINARY_DIR}/timeit
>      COMMAND chmod +x ${CMAKE_CURRENT_BINARY_DIR}/timeit
>      DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/timeit.sh)
> -  add_custom_target(timeit-host DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/timeit)
> +  add_custom_target(build-timeit DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/timeit)
> +
> +  add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/timeit-target
> +    COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/timeit.sh ${CMAKE_CURRENT_BINARY_DIR}/timeit-target
> +    COMMAND chmod +x ${CMAKE_CURRENT_BINARY_DIR}/timeit-target
> +    DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/timeit.sh)
> +  add_custom_target(build-timeit-target DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/timeit-target)
>  else()
>    add_executable(timeit-target ${CMAKE_CURRENT_SOURCE_DIR}/timeit.c)
> -  llvm_add_host_executable(timeit-host timeit timeit.c)
> +  add_executable(build-timeit-target ALIAS timeit-target)
> +  llvm_add_host_executable(build-timeit timeit timeit.c)
>  endif()
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits



--
Simon Atanasyan


More information about the llvm-commits mailing list