[llvm] Reland "[OpenMP][Offload] Handle `present/to/from` when a different entry did `alloc/delete`." (PR #184260)
Mehdi Amini via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 16 04:47:56 PDT 2026
================
@@ -0,0 +1,20 @@
+// RUN: %libomptarget-compile-run-and-check-generic
+// XFAIL: intelgpu
+
+#include <stdio.h>
+
+int main() {
+ int x = 111;
+#pragma omp target data map(alloc : x)
+ {
+#pragma omp target enter data map(alloc : x) map(to : x)
+#pragma omp target map(present, alloc : x)
+ {
+ // NOTE: It's ok for this to be 111 under "unified_shared_memory"
+ printf("In tgt: %d\n", x); // CHECK-NOT: In tgt: 111
----------------
joker-eph wrote:
Can you explain what is x value supposed to be here?
Is this uninitialized? If so printing it would be undefined behavior.
I encountered a buildbot failure, and I suspect it unfortunately included 111 in the uninitialized payload. Seems like an overly fragile test here.
https://github.com/llvm/llvm-project/pull/184260
More information about the llvm-commits
mailing list