================
@@ -0,0 +1,52 @@
+// RUN: %libomptarget-compile-run-and-check-generic
+// RUN: %libomptarget-compile-generic -DOUT_OF_BOUNDS
+// RUN: %libomptarget-run-generic 2>&1 \
+// RUN: | %fcheck-generic --check-prefix=CHECK-OOB
+
+#include <stdio.h>
+
+int x[10];
+typedef struct {
+  int y;
+  int *p;
+} S;
+
+#ifdef OUT_OF_BOUNDS
+// s.p[0:20] extends beyond the mapped region x[0:10]; present check should
+// fail.
+// NOTE: While OpenMP 6.0:296 implies that the present "motion" modifier should
----------------
abhinavgaba wrote:

This was discussed in the spec committee. The divergence between present 
"motion" and present "map-type" modifiers was unintentional. It will be fixed 
as an erratum for OpenMP 6.0.

But for 5.2, we need to consider as-if present is ignored for `s.p[0:20]` for 
both `map` and `to/from` clauses. Let's add compiler-version based RUN lines 
for all 4 cases -- 5.2/6.0 x inbounds(CHECK)/out-of-bounds(OOB).


Also, we should add a version of this test using `target_enter_data map(always, 
to)` instead of `target update`, if we don't already have one.

https://github.com/llvm/llvm-project/pull/204269
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to