diff --git a/openmp/libomptarget/plugins/cuda/src/rtl.cpp b/openmp/libomptarget/plugins/cuda/src/rtl.cpp --- a/openmp/libomptarget/plugins/cuda/src/rtl.cpp +++ b/openmp/libomptarget/plugins/cuda/src/rtl.cpp @@ -829,10 +829,9 @@ return nullptr; } } else { - REPORT("Loading global exec_mode '%s' - symbol missing, using default " - "value GENERIC (1)\n", - ExecModeName); - CUDA_ERR_STRING(Err); + DP("Loading global exec_mode '%s' - symbol missing, using default " + "value GENERIC (1)\n", + ExecModeName); } KernelsList.emplace_back(Func, ExecModeVal); diff --git a/openmp/libomptarget/test/offloading/global_constructor.cpp b/openmp/libomptarget/test/offloading/global_constructor.cpp new file mode 100644 --- /dev/null +++ b/openmp/libomptarget/test/offloading/global_constructor.cpp @@ -0,0 +1,19 @@ +// RUN: %libomptarget-compilexx-generic && %libomptarget-run-generic | %fcheck-generic + +#include +#include + +const double Host = log(2.0) / log(2.0); +#pragma omp declare target +const double Device = log(2.0) / log(2.0); +#pragma omp end declare target + +int main() { + double X; +#pragma omp target map(from : X) + { X = Device; } + + // CHECK: PASS + if (X == Host) + printf("PASS\n"); +}