[LIBOMPTARGET]Ignore empty target descriptors.
authorAlexey Bataev <a.bataev@hotmail.com>
Thu, 9 Jan 2020 19:54:44 +0000 (14:54 -0500)
committerAlexey Bataev <a.bataev@hotmail.com>
Fri, 10 Jan 2020 14:45:27 +0000 (09:45 -0500)
commitb19c0810e56b552d31247dcff081643799fd97fb
treeade17da055bc7ebef9a7da2c8f8b150f73cac140
parentbac995d97896c1e785d709da24c55f0e050eb899
[LIBOMPTARGET]Ignore empty target descriptors.

Summary:
If the dynamically loaded module has been compiled with -fopenmp-targets
and has no target regions, it has empty target descriptor. It leads to a
crash at the runtime if another module has at least one target region
and at least one entry in its descriptor. The runtime library is unable
to load the empty binary descriptor and terminates the execution.
Caused by a clang-offload-wrapper.

Reviewers: grokos, jdoerfert

Subscribers: caomhin, kkwli0, openmp-commits

Tags: #openmp

Differential Revision: https://reviews.llvm.org/D72472
openmp/libomptarget/src/rtl.cpp
openmp/libomptarget/test/offloading/dynamic_module.c [new file with mode: 0644]