diff options
author | Joseph Huber <jhuber6@vols.utk.edu> | 2023-04-28 04:33:44 -0500 |
---|---|---|
committer | Joseph Huber <jhuber6@vols.utk.edu> | 2023-05-04 08:36:29 -0500 |
commit | f4002c1415a70701d6603c293afbed4f094da4a4 (patch) | |
tree | 358ab675a34cc852271d57201cf97e03c3e56edb /libc/cmake | |
parent | 8167727b4a08799787a9596df369ee98a90f7725 (diff) | |
download | llvm-f4002c1415a70701d6603c293afbed4f094da4a4.tar.gz |
[libc] Enable running libc unit tests on NVPTX
The previous patches added the necessary support for global constructors
used to register tests. This patch enables the NVPTX target to build
and run the unit tests on the GPU. Currently this only tests the ctype
tests, but adding more should be straightforward from here on.
This ran all the ctest unit tests when run on an sm_70.
Depends on D149517 D149527
Reviewed By: sivachandra
Differential Revision: https://reviews.llvm.org/D149532
Diffstat (limited to 'libc/cmake')
-rw-r--r-- | libc/cmake/modules/LLVMLibCTestRules.cmake | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libc/cmake/modules/LLVMLibCTestRules.cmake b/libc/cmake/modules/LLVMLibCTestRules.cmake index a3a34136604d..4c1b143b6618 100644 --- a/libc/cmake/modules/LLVMLibCTestRules.cmake +++ b/libc/cmake/modules/LLVMLibCTestRules.cmake @@ -551,7 +551,8 @@ if(LIBC_GPU_TARGET_ARCHITECTURE_IS_AMDGPU) -mcpu=${LIBC_GPU_TARGET_ARCHITECTURE} -flto --target=${LIBC_GPU_TARGET_TRIPLE}) elseif(LIBC_GPU_TARGET_ARCHITECTURE_IS_NVPTX) get_nvptx_compile_options(nvptx_options ${LIBC_GPU_TARGET_ARCHITECTURE}) - list(APPEND ${nvptx_options} --target=${LIBC_GPU_TARGET_TRIPLE}) + list(APPEND LIBC_HERMETIC_TEST_COMPILE_OPTIONS + ${nvptx_options} -fno-use-cxa-atexit --target=${LIBC_GPU_TARGET_TRIPLE}) endif() # Rule to add a hermetic test. A hermetic test is one whose executable is fully |