diff --git a/openmp/libomptarget/src/api.cpp b/openmp/libomptarget/src/api.cpp --- a/openmp/libomptarget/src/api.cpp +++ b/openmp/libomptarget/src/api.cpp @@ -137,6 +137,11 @@ DPxPTR(src), dst_offset, src_offset, length); if (!dst || !src || length <= 0) { + if (length == 0) { + DP("Call to omp_target_memcpy with zero length, nothing to do\n"); + return OFFLOAD_SUCCESS; + } + REPORT("Call to omp_target_memcpy with invalid arguments\n"); return OFFLOAD_FAIL; }