manorom updated this revision to Diff 287660. manorom edited the summary of this revision. manorom added a comment.
- Move VE specific vars into test run line Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D85934/new/ https://reviews.llvm.org/D85934 Files: clang/lib/Frontend/CompilerInvocation.cpp openmp/libomptarget/CMakeLists.txt openmp/libomptarget/test/api/omp_get_num_devices.c openmp/libomptarget/test/api/omp_get_num_devices_with_empty_target.c openmp/libomptarget/test/env/omp_target_debug.c openmp/libomptarget/test/lit.cfg openmp/libomptarget/test/mapping/alloc_fail.c openmp/libomptarget/test/mapping/target_implicit_partial_map.c openmp/libomptarget/test/offloading/offloading_success.c
Index: openmp/libomptarget/test/offloading/offloading_success.c =================================================================== --- openmp/libomptarget/test/offloading/offloading_success.c +++ openmp/libomptarget/test/offloading/offloading_success.c @@ -3,6 +3,7 @@ // RUN: %libomptarget-compile-run-and-check-powerpc64le-ibm-linux-gnu // RUN: %libomptarget-compile-run-and-check-x86_64-pc-linux-gnu // RUN: %libomptarget-compile-run-and-check-nvptx64-nvidia-cuda +// RUN: %libomptarget-compile-ve-unknown-linux-unknown | env VE_LD_LIBRARY_PATH=%host-rtl-dir %libomptarget-run-ve-unknown-linux-unknown | %fcheck-ve-unknown-linux-unknown #include <stdio.h> #include <omp.h> Index: openmp/libomptarget/test/mapping/target_implicit_partial_map.c =================================================================== --- openmp/libomptarget/test/mapping/target_implicit_partial_map.c +++ openmp/libomptarget/test/mapping/target_implicit_partial_map.c @@ -13,6 +13,10 @@ // RUN: %libomptarget-compile-x86_64-pc-linux-gnu // RUN: %libomptarget-run-x86_64-pc-linux-gnu 2>&1 \ // RUN: | %fcheck-x86_64-pc-linux-gnu + +// RUN: %libomptarget-compile-ve-unknown-linux-unknown +// RUN: env VE_LD_LIBRARY_PATH=%host-rtl-dir %libomptarget-run-ve-unknown-linux-unknown 2>&1 \ +// RUN: | %fcheck-ve-unknown-linux-unknown // // END. Index: openmp/libomptarget/test/mapping/alloc_fail.c =================================================================== --- openmp/libomptarget/test/mapping/alloc_fail.c +++ openmp/libomptarget/test/mapping/alloc_fail.c @@ -18,6 +18,10 @@ // RUN: %libomptarget-run-fail-nvptx64-nvidia-cuda 2>&1 \ // RUN: | %fcheck-nvptx64-nvidia-cuda +// RUN: %libomptarget-compile-ve-unknown-linux-unknown +// RUN: env VE_LD_LIBRARY_PATH=%host-rtl-dir %libomptarget-run-fail-ve-unknown-linux-unknown 2>&1 \ +// RUN: | %fcheck-ve-unknown-linux-unknown + // CHECK: Libomptarget fatal error 1: failure of target construct while offloading is mandatory int main() { Index: openmp/libomptarget/test/lit.cfg =================================================================== --- openmp/libomptarget/test/lit.cfg +++ openmp/libomptarget/test/lit.cfg @@ -75,6 +75,11 @@ append_dynamic_library_path('LIBRARY_PATH', \ config.omp_host_rtl_directory, ":") +# Target specific flags +target_flags = {} +target_flags['ve-unknown-linux-unknown'] = "-Xopenmp-target \"-L " + \ + config.omp_host_rtl_directory + "\"" + # substitutions # - for targets that exist in the system create the actual command. # - for valid targets that do not exist in the system, return false, so that the @@ -116,9 +121,13 @@ libomptarget_target, \ "%not --crash %t-" + libomptarget_target)) config.substitutions.append(("%clangxx-" + libomptarget_target, \ - "%clangxx %openmp_flags %flags -fopenmp-targets=" + libomptarget_target)) + "%clangxx %openmp_flags %flags-" + libomptarget_target + \ + " -fopenmp-targets=" + libomptarget_target)) config.substitutions.append(("%clang-" + libomptarget_target, \ - "%clang %openmp_flags %flags -fopenmp-targets=" + libomptarget_target)) + "%clang %openmp_flags %flags-" + libomptarget_target + \ + " -fopenmp-targets=" + libomptarget_target)) + config.substitutions.append(("%flags-" + libomptarget_target, \ + "%flags " + target_flags.get(libomptarget_target, ""))) config.substitutions.append(("%fcheck-" + libomptarget_target, \ config.libomptarget_filecheck + " %s")) else: @@ -157,4 +166,5 @@ config.substitutions.append(("%clang", config.test_c_compiler)) config.substitutions.append(("%openmp_flags", config.test_openmp_flags)) config.substitutions.append(("%flags", config.test_flags)) +config.substitutions.append(("%host-rtl-dir", config.omp_host_rtl_directory)) config.substitutions.append(("%not", config.libomptarget_not)) Index: openmp/libomptarget/test/env/omp_target_debug.c =================================================================== --- openmp/libomptarget/test/env/omp_target_debug.c +++ openmp/libomptarget/test/env/omp_target_debug.c @@ -8,6 +8,8 @@ // RUN: %libomptarget-compile-x86_64-pc-linux-gnu && env LIBOMPTARGET_DEBUG=0 %libomptarget-run-x86_64-pc-linux-gnu 2>&1 | %fcheck-x86_64-pc-linux-gnu -allow-empty -check-prefix=NDEBUG // RUN: %libomptarget-compile-nvptx64-nvidia-cuda && env LIBOMPTARGET_DEBUG=1 %libomptarget-run-nvptx64-nvidia-cuda 2>&1 | %fcheck-nvptx64-nvidia-cuda -allow-empty -check-prefix=DEBUG // RUN: %libomptarget-compile-nvptx64-nvidia-cuda && env LIBOMPTARGET_DEBUG=0 %libomptarget-run-nvptx64-nvidia-cuda 2>&1 | %fcheck-nvptx64-nvidia-cuda -allow-empty -check-prefix=NDEBUG +// RUN: %libomptarget-compile-ve-unknown-linux-unknown && env VE_LD_LIBRARY_PATH=%host-rtl-dir LIBOMPTARGET_DEBUG=1 %libomptarget-run-ve-unknown-linux-unknown 2>&1 | %fcheck-ve-unknown-linux-unknown -allow-empty -check-prefix=DEBUG +// RUN: %libomptarget-compile-ve-unknown-linux-unknown && env VE_LD_LIBRARY_PATH=%host-rtl-dir LIBOMPTARGET_DEBUG=0 %libomptarget-run-ve-unknown-linux-unknown 2>&1 | %fcheck-ve-unknown-linux-unknown -allow-empty -check-prefix=NDEBUG // REQUIRES: libomptarget-debug int main(void) { Index: openmp/libomptarget/test/api/omp_get_num_devices_with_empty_target.c =================================================================== --- openmp/libomptarget/test/api/omp_get_num_devices_with_empty_target.c +++ openmp/libomptarget/test/api/omp_get_num_devices_with_empty_target.c @@ -2,6 +2,7 @@ // RUN: %libomptarget-compile-run-and-check-powerpc64-ibm-linux-gnu // RUN: %libomptarget-compile-run-and-check-powerpc64le-ibm-linux-gnu // RUN: %libomptarget-compile-run-and-check-x86_64-pc-linux-gnu +// RUN: env VE_LD_LIBRARY_PATH=%host-rtl-dir %libomptarget-compile-run-and-check-ve-unknown-linux-unknown #include <omp.h> #include <stdio.h> Index: openmp/libomptarget/test/api/omp_get_num_devices.c =================================================================== --- openmp/libomptarget/test/api/omp_get_num_devices.c +++ openmp/libomptarget/test/api/omp_get_num_devices.c @@ -2,6 +2,7 @@ // RUN: %libomptarget-compile-run-and-check-powerpc64-ibm-linux-gnu // RUN: %libomptarget-compile-run-and-check-powerpc64le-ibm-linux-gnu // RUN: %libomptarget-compile-run-and-check-x86_64-pc-linux-gnu +// RUN: %libomptarget-compile-ve-unknown-linux-unknown | env VE_LD_LIBRARY_PATH=%host-rtl-dir %libomptarget-run-ve-unknown-linux-unknown | %fcheck-ve-unknown-linux-unknown #include <stdio.h> #include <omp.h> Index: openmp/libomptarget/CMakeLists.txt =================================================================== --- openmp/libomptarget/CMakeLists.txt +++ openmp/libomptarget/CMakeLists.txt @@ -35,6 +35,7 @@ set (LIBOMPTARGET_ALL_TARGETS "${LIBOMPTARGET_ALL_TARGETS} powerpc64-ibm-linux-gnu") set (LIBOMPTARGET_ALL_TARGETS "${LIBOMPTARGET_ALL_TARGETS} x86_64-pc-linux-gnu") set (LIBOMPTARGET_ALL_TARGETS "${LIBOMPTARGET_ALL_TARGETS} nvptx64-nvidia-cuda") +set (LIBOMPTARGET_ALL_TARGETS "${LIBOMPTARGET_ALL_TARGETS} ve-unknown-linux-unknown") # Once the plugins for the different targets are validated, they will be added to # the list of supported targets in the current system. Index: clang/lib/Frontend/CompilerInvocation.cpp =================================================================== --- clang/lib/Frontend/CompilerInvocation.cpp +++ clang/lib/Frontend/CompilerInvocation.cpp @@ -3177,6 +3177,7 @@ TT.getArch() == llvm::Triple::nvptx || TT.getArch() == llvm::Triple::nvptx64 || TT.getArch() == llvm::Triple::amdgcn || + TT.getArch() == llvm::Triple::ve || TT.getArch() == llvm::Triple::x86 || TT.getArch() == llvm::Triple::x86_64)) Diags.Report(diag::err_drv_invalid_omp_target) << A->getValue(i);
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits