<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/59160>59160</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            OpenMP regression test failure (target_has_device_addr.c): Libomptarget error: Call to getTargetPointer returned null pointer (device failure or illegal mapping). 
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            openmp
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          Meinersbur
      </td>
    </tr>
</table>

<pre>
    The test target_has_device_addr.c is failing [mapping/openmp-offload-cuda-runtime](https://lab.llvm.org/staging/#/builders/154) buildbot:
```
******************** TEST 'libomptarget :: nvptx64-nvidia-cuda :: mapping/target_has_device_addr.c' FAILED ********************
Script:
--
: 'RUN: at line 1';   /home/buildbot-worker/minipc-1050ti-linux/rundir/llvm.build/./bin/clang -fopenmp -pthread --cuda-path=/opt/cuda  -I /home/buildbot-worker/minipc-1050ti-linux/rundir/llvm.src/openmp/libomptarget/test -I /home/buildbot-worker/minipc-1050ti-linux/rundir/llvm.build/projects/openmp/runtime/src -L /home/buildbot-worker/minipc-1050ti-linux/rundir/llvm.build/projects/openmp/libomptarget -L /home/buildbot-worker/minipc-1050ti-linux/rundir/llvm.build/./lib  -fno-openmp-implicit-rpath -Wl,-rpath,/home/buildbot-worker/minipc-1050ti-linux/rundir/llvm.build/projects/openmp/libomptarget -Wl,-rpath,/home/buildbot-worker/minipc-1050ti-linux/rundir/llvm.build/./lib -Wl,-rpath,/home/buildbot-worker/minipc-1050ti-linux/rundir/llvm.build/./lib -Wl,-rpath,/opt/cuda/lib64 --libomptarget-nvptx-bc-path=/home/buildbot-worker/minipc-1050ti-linux/rundir/llvm.build/projects/openmp/libomptarget -fopenmp-targets=nvptx64-nvidia-cuda /home/buildbot-worker/src/llvm-project/openmp/libomptarget/test/mapping/target_has_device_addr.c -o /home/buildbot-worker/minipc-1050ti-linux/openmp-offload-cuda-project/llvm.build/projects/openmp/libomptarget/test/nvptx64-nvidia-cuda/mapping/Output/target_has_device_addr.c.tmp -fopenmp-version=51
: 'RUN: at line 2';   /home/buildbot-worker/minipc-1050ti-linux/openmp-offload-cuda-project/llvm.build/projects/openmp/libomptarget/test/nvptx64-nvidia-cuda/mapping/Output/target_has_device_addr.c.tmp 2>&1  | /home/buildbot-worker/minipc-1050ti-linux/rundir/llvm.build/./bin/FileCheck /home/buildbot-worker/src/llvm-project/openmp/libomptarget/test/mapping/target_has_device_addr.c
--
Exit Code: 1
Command Output (stdout):
--
$ ":" "RUN: at line 1"
$ "/home/buildbot-worker/minipc-1050ti-linux/rundir/llvm.build/./bin/clang" "-fopenmp" "-pthread" "--cuda-path=/opt/cuda" "-I" "/home/buildbot-worker/minipc-1050ti-linux/rundir/llvm.src/openmp/libomptarget/test" "-I" "/home/buildbot-worker/minipc-1050ti-linux/rundir/llvm.build/projects/openmp/runtime/src" "-L" "/home/buildbot-worker/minipc-1050ti-linux/rundir/llvm.build/projects/openmp/libomptarget" "-L" "/home/buildbot-worker/minipc-1050ti-linux/rundir/llvm.build/./lib" "-fno-openmp-implicit-rpath" "-Wl,-rpath,/home/buildbot-worker/minipc-1050ti-linux/rundir/llvm.build/projects/openmp/libomptarget" "-Wl,-rpath,/home/buildbot-worker/minipc-1050ti-linux/rundir/llvm.build/./lib" "-Wl,-rpath,/home/buildbot-worker/minipc-1050ti-linux/rundir/llvm.build/./lib" "-Wl,-rpath,/opt/cuda/lib64" "--libomptarget-nvptx-bc-path=/home/buildbot-worker/minipc-1050ti-linux/rundir/llvm.build/projects/openmp/libomptarget" "-fopenmp-targets=nvptx64-nvidia-cuda" "/home/buildbot-worker/src/llvm-project/openmp/libomptarget/test/mapping/target_has_device_addr.c" "-o" "/home/buildbot-worker/minipc-1050ti-linux/openmp-offload-cuda-project/llvm.build/projects/openmp/libomptarget/test/nvptx64-nvidia-cuda/mapping/Output/target_has_device_addr.c.tmp" "-fopenmp-version=51"
$ ":" "RUN: at line 2"
$ "/home/buildbot-worker/minipc-1050ti-linux/openmp-offload-cuda-project/llvm.build/projects/openmp/libomptarget/test/nvptx64-nvidia-cuda/mapping/Output/target_has_device_addr.c.tmp"
note: command had no output on stdout or stderr
error: command failed with exit status: -6
$ "/home/buildbot-worker/minipc-1050ti-linux/rundir/llvm.build/./bin/FileCheck" "/home/buildbot-worker/src/llvm-project/openmp/libomptarget/test/mapping/target_has_device_addr.c"
# command stderr:
/home/buildbot-worker/src/llvm-project/openmp/libomptarget/test/mapping/target_has_device_addr.c:89:12: error: CHECK: expected string not found in input
 // CHECK: 222 222
           ^
<stdin>:7:4: note: scanning from here
222 0x7ffff631ef30 0x7ffff631ef32
   ^
<stdin>:7:16: note: possible intended match here
222 0x7ffff631ef30 0x7ffff631ef32
               ^
Input file: <stdin>
Check file: /home/buildbot-worker/src/llvm-project/openmp/libomptarget/test/mapping/target_has_device_addr.c
-dump-input=help explains the following input dump.
Input was:
<<<<<<
            1: Success 
            2: 222 0x7fcf44800602 
            3: 222 0x7ffff631ef32 
            4: 222 0x7fcf448007fe 0x7fcf44800800 0x7fcf419ff920 
            5: 222 0x55847488ce8e 0x55847488ce90 0x7ffff631ef48 
            6: 222 0x7fcf448007fe 0x7fcf44800800 
            7: 222 0x7ffff631ef30 0x7ffff631ef32 
check:89'0        X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found
check:89'1                    ?                   possible intended match
            8: CUDA error: invalid argument  
check:89'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            9: Libomptarget error: Copying data to device failed. 
check:89'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           10: Libomptarget error: Call to getTargetPointer returned null pointer (device failure or illegal mapping). 
check:89'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           11: Libomptarget error: Call to targetDataBegin failed, abort target. 
check:89'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           12: Libomptarget error: Failed to process data before launching the kernel. 
check:89'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            .
            .
            .
>>>>>>
error: command failed with exit status: 1
--
********************
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzdWVlv2zgQ_jXyCyFDog7bD35wbAcbbLottim6bwUlURa3tChQVJL--x1SkiWfOZ1kaxAG75n5ZjgzpCKR_JreZBQpWiqkiFxR9SMj5Y-E3rKY_iBJIocxYiVKCeMsXyEruFiTooCqhS9FQfN1YYs05YIkdlwlxJZVrtiaWsHCwuNMqaK0vBnMhcJJNOT8dj0UUq8uFVnV-1jYg_-oYjyhsoSqG_gWniDTEwmld3AWljOzQqcpdRM_v6Cb5dcbZOERZ5FYF7XsSFPyZii_LdR96Nv5LUsYMYK1Q530x-CCPdHl7Op6uUAvYbAW8WssWdEBYNuN5MAJ0Pn721-6RhQC5VDkQpflXSAEY5eZAC00qAKG9p2QP6mEnjXLWRHbrhM4itmwsLqHXtBbwvSw0ZBZBY2h3oHl8B9zAuq301rnyC5UJilJkF2rvSAqs7yFMQqlp2vIkH31Yk5KGW8sTff1tKV1oO32Fai08hZS_EtjVfZJthYNFitjZF-fldiWNb4irWG9N6gkzYXdHFy2LjiLmbKlVh-yv3MLz-sGVN5OzPPQbUV-8-27E1BPCX04JX2JbeNf7CjuHZs3gro5v3bdBt-8OOjrTvBTH0hN1m7IPXA-tQwPOk1ki2fY-qEA1DH1JGg6Zg8AsiXC50oVlTohy1BpB9kifQshjYkckA7cU84bv8B5f2AcsOUtLRy6INZofoa4dMk4nWc0_vkORrsdk5f3TKG5SKjWaqPquVivSZ6gGitgcVyqRGjUJv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