[libomptarget] Handle offload policy in push_tripcount

If the first target region in a program calls the push_tripcount
function, libomptarget didn't handle the offload policy correctly.
This could lead to unexpected error messages as seen in
http://lists.llvm.org/pipermail/openmp-dev/2019-June/002561.html

To solve this, add a check calling IsOffloadDisabled() as all other
entry points already do. If this method returns false, libomptarget
is effectively disabled.

Differential Revision: https://reviews.llvm.org/D64626

git-svn-id: https://llvm.org/svn/llvm-project/openmp/trunk@366810 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/libomptarget/src/interface.cpp b/libomptarget/src/interface.cpp
index 32afe3f..b3ace37 100644
--- a/libomptarget/src/interface.cpp
+++ b/libomptarget/src/interface.cpp
@@ -306,6 +306,9 @@
 
 EXTERN void __kmpc_push_target_tripcount(int64_t device_id,
     uint64_t loop_tripcount) {
+  if (IsOffloadDisabled())
+    return;
+
   if (device_id == OFFLOAD_DEVICE_DEFAULT) {
     device_id = omp_get_default_device();
   }