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 @@ -6,6 +6,8 @@ // RUN: %libomptarget-compile-powerpc64le-ibm-linux-gnu && env LIBOMPTARGET_DEBUG=0 %libomptarget-run-powerpc64le-ibm-linux-gnu 2>&1 | %fcheck-powerpc64le-ibm-linux-gnu -allow-empty -check-prefix=NDEBUG // RUN: %libomptarget-compile-x86_64-pc-linux-gnu && env LIBOMPTARGET_DEBUG=1 %libomptarget-run-x86_64-pc-linux-gnu 2>&1 | %fcheck-x86_64-pc-linux-gnu -allow-empty -check-prefix=DEBUG // 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 // REQUIRES: libomptarget-debug int main(void) { Index: openmp/libomptarget/test/lit.cfg =================================================================== --- openmp/libomptarget/test/lit.cfg +++ openmp/libomptarget/test/lit.cfg @@ -71,6 +71,9 @@ append_dynamic_library_path('LD_LIBRARY_PATH', config.library_dir, ":") append_dynamic_library_path('LD_LIBRARY_PATH', \ config.omp_host_rtl_directory, ":") + append_dynamic_library_path('LIBRARY_PATH', config.library_dir, ":") + append_dynamic_library_path('LIBRARY_PATH', \ + config.omp_host_rtl_directory, ":") # substitutions # - for targets that exist in the system create the actual command. Index: openmp/libomptarget/test/mapping/alloc_fail.c =================================================================== --- openmp/libomptarget/test/mapping/alloc_fail.c +++ openmp/libomptarget/test/mapping/alloc_fail.c @@ -14,6 +14,10 @@ // RUN: %libomptarget-run-fail-x86_64-pc-linux-gnu 2>&1 \ // RUN: | %fcheck-x86_64-pc-linux-gnu +// RUN: %libomptarget-compile-nvptx64-nvidia-cuda +// RUN: %libomptarget-run-fail-nvptx64-nvidia-cuda 2>&1 \ +// RUN: | %fcheck-nvptx64-nvidia-cuda + // CHECK: Libomptarget fatal error 1: failure of target construct while offloading is mandatory int main() { Index: openmp/libomptarget/test/mapping/declare_mapper_api.cpp =================================================================== --- openmp/libomptarget/test/mapping/declare_mapper_api.cpp +++ openmp/libomptarget/test/mapping/declare_mapper_api.cpp @@ -2,6 +2,7 @@ // RUN: %libomptarget-compilexx-run-and-check-powerpc64-ibm-linux-gnu // RUN: %libomptarget-compilexx-run-and-check-powerpc64le-ibm-linux-gnu // RUN: %libomptarget-compilexx-run-and-check-x86_64-pc-linux-gnu +// RUN: %libomptarget-compilexx-run-and-check-nvptx64-nvidia-cuda #include #include Index: openmp/libomptarget/test/mapping/declare_mapper_target.cpp =================================================================== --- openmp/libomptarget/test/mapping/declare_mapper_target.cpp +++ openmp/libomptarget/test/mapping/declare_mapper_target.cpp @@ -1,8 +1,8 @@ // RUN: %libomptarget-compile-run-and-check-aarch64-unknown-linux-gnu -// RUN: %libomptarget-compile-run-and-check-nvptx64-nvidia-cuda // 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-run-and-check-nvptx64-nvidia-cuda #include #include Index: openmp/libomptarget/test/mapping/declare_mapper_target_data.cpp =================================================================== --- openmp/libomptarget/test/mapping/declare_mapper_target_data.cpp +++ openmp/libomptarget/test/mapping/declare_mapper_target_data.cpp @@ -1,8 +1,8 @@ // RUN: %libomptarget-compile-run-and-check-aarch64-unknown-linux-gnu -// RUN: %libomptarget-compile-run-and-check-nvptx64-nvidia-cuda // 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-run-and-check-nvptx64-nvidia-cuda #include #include Index: openmp/libomptarget/test/mapping/declare_mapper_target_data_enter_exit.cpp =================================================================== --- openmp/libomptarget/test/mapping/declare_mapper_target_data_enter_exit.cpp +++ openmp/libomptarget/test/mapping/declare_mapper_target_data_enter_exit.cpp @@ -1,8 +1,8 @@ // RUN: %libomptarget-compile-run-and-check-aarch64-unknown-linux-gnu -// RUN: %libomptarget-compile-run-and-check-nvptx64-nvidia-cuda // 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-run-and-check-nvptx64-nvidia-cuda #include #include Index: openmp/libomptarget/test/mapping/declare_mapper_target_update.cpp =================================================================== --- openmp/libomptarget/test/mapping/declare_mapper_target_update.cpp +++ openmp/libomptarget/test/mapping/declare_mapper_target_update.cpp @@ -1,8 +1,8 @@ // RUN: %libomptarget-compile-run-and-check-aarch64-unknown-linux-gnu -// RUN: %libomptarget-compile-run-and-check-nvptx64-nvidia-cuda // 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-run-and-check-nvptx64-nvidia-cuda #include #include Index: openmp/libomptarget/test/mapping/delete_inf_refcount.c =================================================================== --- openmp/libomptarget/test/mapping/delete_inf_refcount.c +++ openmp/libomptarget/test/mapping/delete_inf_refcount.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-run-and-check-nvptx64-nvidia-cuda #include #include Index: openmp/libomptarget/test/mapping/pr38704.c =================================================================== --- openmp/libomptarget/test/mapping/pr38704.c +++ openmp/libomptarget/test/mapping/pr38704.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-run-and-check-nvptx64-nvidia-cuda // Clang 6.0 doesn't use the new map interface, undefined behavior when // the compiler emits "old" interface code for structures. Index: openmp/libomptarget/test/offloading/d2d_memcpy.c =================================================================== --- openmp/libomptarget/test/offloading/d2d_memcpy.c +++ openmp/libomptarget/test/offloading/d2d_memcpy.c @@ -2,6 +2,7 @@ // RUN: %libomptarget-compile-powerpc64-ibm-linux-gnu && env OMP_MAX_ACTIVE_LEVELS=2 %libomptarget-run-powerpc64-ibm-linux-gnu | %fcheck-powerpc64-ibm-linux-gnu // RUN: %libomptarget-compile-powerpc64le-ibm-linux-gnu && env OMP_MAX_ACTIVE_LEVELS=2 %libomptarget-run-powerpc64le-ibm-linux-gnu | %fcheck-powerpc64le-ibm-linux-gnu // RUN: %libomptarget-compile-x86_64-pc-linux-gnu && env OMP_MAX_ACTIVE_LEVELS=2 %libomptarget-run-x86_64-pc-linux-gnu | %fcheck-x86_64-pc-linux-gnu -allow-empty +// RUN: %libomptarget-compile-nvptx64-nvidia-cuda && env OMP_MAX_ACTIVE_LEVELS=2 %libomptarget-run-nvptx64-nvidia-cuda | %fcheck-nvptx64-nvidia-cuda -allow-empty #include #include @@ -21,9 +22,7 @@ } const int src_device = 0; - int dst_device = 1; - if (dst_device >= num_devices) - dst_device = num_devices - 1; + int dst_device = num_devices - 1; int length = N * sizeof(int); int *src_ptr = omp_target_alloc(length, src_device); Index: openmp/libomptarget/test/offloading/dynamic_module.c =================================================================== --- openmp/libomptarget/test/offloading/dynamic_module.c +++ openmp/libomptarget/test/offloading/dynamic_module.c @@ -2,6 +2,7 @@ // RUN: %libomptarget-compile-powerpc64-ibm-linux-gnu -DSHARED -fPIC -shared -o %t.so && %libomptarget-compile-powerpc64-ibm-linux-gnu %t.so && %libomptarget-run-powerpc64-ibm-linux-gnu 2>&1 | %fcheck-powerpc64-ibm-linux-gnu // RUN: %libomptarget-compile-powerpc64le-ibm-linux-gnu -DSHARED -fPIC -shared -o %t.so && %libomptarget-compile-powerpc64le-ibm-linux-gnu %t.so && %libomptarget-run-powerpc64le-ibm-linux-gnu 2>&1 | %fcheck-powerpc64le-ibm-linux-gnu // RUN: %libomptarget-compile-x86_64-pc-linux-gnu -DSHARED -fPIC -shared -o %t.so && %libomptarget-compile-x86_64-pc-linux-gnu %t.so && %libomptarget-run-x86_64-pc-linux-gnu 2>&1 | %fcheck-x86_64-pc-linux-gnu +// RUN: %libomptarget-compile-nvptx64-nvidia-cuda -DSHARED -fPIC -shared -o %t.so && %libomptarget-compile-nvptx64-nvidia-cuda %t.so && %libomptarget-run-nvptx64-nvidia-cuda 2>&1 | %fcheck-nvptx64-nvidia-cuda #ifdef SHARED void foo() {} Index: openmp/libomptarget/test/offloading/dynamic_module_load.c =================================================================== --- openmp/libomptarget/test/offloading/dynamic_module_load.c +++ openmp/libomptarget/test/offloading/dynamic_module_load.c @@ -2,6 +2,7 @@ // RUN: %libomptarget-compile-powerpc64-ibm-linux-gnu -DSHARED -fPIC -shared -o %t.so && %clang %flags %s -o %t-powerpc64-ibm-linux-gnu -ldl && %libomptarget-run-powerpc64-ibm-linux-gnu %t.so 2>&1 | %fcheck-powerpc64-ibm-linux-gnu // RUN: %libomptarget-compile-powerpc64le-ibm-linux-gnu -DSHARED -fPIC -shared -o %t.so && %clang %flags %s -o %t-powerpc64le-ibm-linux-gnu -ldl && %libomptarget-run-powerpc64le-ibm-linux-gnu %t.so 2>&1 | %fcheck-powerpc64le-ibm-linux-gnu // RUN: %libomptarget-compile-x86_64-pc-linux-gnu -DSHARED -fPIC -shared -o %t.so && %clang %flags %s -o %t-x86_64-pc-linux-gnu -ldl && %libomptarget-run-x86_64-pc-linux-gnu %t.so 2>&1 | %fcheck-x86_64-pc-linux-gnu +// RUN: %libomptarget-compile-nvptx64-nvidia-cuda -DSHARED -fPIC -shared -o %t.so && %clang %flags %s -o %t-nvptx64-nvidia-cuda -ldl && %libomptarget-run-nvptx64-nvidia-cuda %t.so 2>&1 | %fcheck-nvptx64-nvidia-cuda #ifdef SHARED #include Index: openmp/libomptarget/test/offloading/looptripcnt.c =================================================================== --- openmp/libomptarget/test/offloading/looptripcnt.c +++ openmp/libomptarget/test/offloading/looptripcnt.c @@ -2,6 +2,7 @@ // RUN: %libomptarget-compile-powerpc64-ibm-linux-gnu && env LIBOMPTARGET_DEBUG=1 %libomptarget-run-powerpc64-ibm-linux-gnu 2>&1 | %fcheck-powerpc64-ibm-linux-gnu -allow-empty -check-prefix=DEBUG // RUN: %libomptarget-compile-powerpc64le-ibm-linux-gnu && env LIBOMPTARGET_DEBUG=1 %libomptarget-run-powerpc64le-ibm-linux-gnu 2>&1 | %fcheck-powerpc64le-ibm-linux-gnu -allow-empty -check-prefix=DEBUG // RUN: %libomptarget-compile-x86_64-pc-linux-gnu && env LIBOMPTARGET_DEBUG=1 %libomptarget-run-x86_64-pc-linux-gnu 2>&1 | %fcheck-x86_64-pc-linux-gnu -allow-empty -check-prefix=DEBUG +// 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 // REQUIRES: libomptarget-debug /* Index: openmp/libomptarget/test/offloading/offloading_success.c =================================================================== --- openmp/libomptarget/test/offloading/offloading_success.c +++ openmp/libomptarget/test/offloading/offloading_success.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-run-and-check-nvptx64-nvidia-cuda #include #include Index: openmp/libomptarget/test/offloading/offloading_success.cpp =================================================================== --- openmp/libomptarget/test/offloading/offloading_success.cpp +++ openmp/libomptarget/test/offloading/offloading_success.cpp @@ -2,6 +2,7 @@ // RUN: %libomptarget-compilexx-run-and-check-powerpc64-ibm-linux-gnu // RUN: %libomptarget-compilexx-run-and-check-powerpc64le-ibm-linux-gnu // RUN: %libomptarget-compilexx-run-and-check-x86_64-pc-linux-gnu +// RUN: %libomptarget-compilexx-run-and-check-nvptx64-nvidia-cuda #include #include Index: openmp/libomptarget/test/offloading/parallel_offloading_map.c =================================================================== --- openmp/libomptarget/test/offloading/parallel_offloading_map.c +++ openmp/libomptarget/test/offloading/parallel_offloading_map.c @@ -2,6 +2,7 @@ // RUN: %libomptarget-compile-powerpc64-ibm-linux-gnu && env OMP_MAX_ACTIVE_LEVELS=2 %libomptarget-run-powerpc64-ibm-linux-gnu | %fcheck-powerpc64-ibm-linux-gnu // RUN: %libomptarget-compile-powerpc64le-ibm-linux-gnu && env OMP_MAX_ACTIVE_LEVELS=2 %libomptarget-run-powerpc64le-ibm-linux-gnu | %fcheck-powerpc64le-ibm-linux-gnu // RUN: %libomptarget-compile-x86_64-pc-linux-gnu && env OMP_MAX_ACTIVE_LEVELS=2 %libomptarget-run-x86_64-pc-linux-gnu | %fcheck-x86_64-pc-linux-gnu -allow-empty +// RUN: %libomptarget-compile-nvptx64-nvidia-cuda && env OMP_MAX_ACTIVE_LEVELS=2 %libomptarget-run-nvptx64-nvidia-cuda | %fcheck-nvptx64-nvidia-cuda -allow-empty #include #include Index: openmp/libomptarget/test/offloading/requires.c =================================================================== --- openmp/libomptarget/test/offloading/requires.c +++ openmp/libomptarget/test/offloading/requires.c @@ -2,6 +2,7 @@ // RUN: %libomptarget-compile-powerpc64-ibm-linux-gnu && env LIBOMPTARGET_DEBUG=1 %libomptarget-run-powerpc64-ibm-linux-gnu 2>&1 | %fcheck-powerpc64-ibm-linux-gnu -allow-empty -check-prefix=DEBUG // RUN: %libomptarget-compile-powerpc64le-ibm-linux-gnu && env LIBOMPTARGET_DEBUG=1 %libomptarget-run-powerpc64le-ibm-linux-gnu 2>&1 | %fcheck-powerpc64le-ibm-linux-gnu -allow-empty -check-prefix=DEBUG // RUN: %libomptarget-compile-x86_64-pc-linux-gnu && env LIBOMPTARGET_DEBUG=1 %libomptarget-run-x86_64-pc-linux-gnu 2>&1 | %fcheck-x86_64-pc-linux-gnu -allow-empty -check-prefix=DEBUG +// 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 // REQUIRES: libomptarget-debug /* Index: openmp/libomptarget/test/offloading/target_depend_nowait.cpp =================================================================== --- openmp/libomptarget/test/offloading/target_depend_nowait.cpp +++ openmp/libomptarget/test/offloading/target_depend_nowait.cpp @@ -2,6 +2,7 @@ // RUN: %libomptarget-compilexx-run-and-check-powerpc64-ibm-linux-gnu // RUN: %libomptarget-compilexx-run-and-check-powerpc64le-ibm-linux-gnu // RUN: %libomptarget-compilexx-run-and-check-x86_64-pc-linux-gnu +// RUN: %libomptarget-compilexx-run-and-check-nvptx64-nvidia-cuda #include #include