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

    <tr>
        <th>Summary</th>
        <td>
            SOLLVE V&V test failure (test_declare_target_link_extended_list.c): An asserting value handle still pointed to this value!
        </td>
    </tr>

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

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

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

<pre>
    The SOLLVE V&V test [External/sollve_vv/omptargetvv-test_declare_target_link_extended_list-45_declare_target-c](https://github.com/SOLLVE/sollve_vv/blob/40099135fbd02d912d9ca54c0aa6cf24c59914a6/tests/4.5/declare_target/test_declare_target_link_extended_list.c) is failing on the [openmp-offload-cuda-runtime](https://lab.llvm.org/staging/#/builders/154) buildbot. 

The regression was introduced after 69d117edc29d4c74e034d8474433e981b2702898 (it was still working in https://lab.llvm.org/staging/#/builders/154/builds/5460).

```
FAILED: External/sollve_vv/CMakeFiles/omptargetvv-test_declare_target_link_extended_list-45_declare_target-c.dir/home/buildbot-worker/minipc-1050ti-linux/rundir/sollvevv.src/tests/4.5/declare_target/test_declare_target_link_extended_list.c.o 
[stdout] /home/buildbot-worker/minipc-1050ti-linux/rundir/test-suite.build/tools/timeit --summary External/sollve_vv/CMakeFiles/omptargetvv-test_declare_target_link_extended_list-45_declare_target-c.dir/home/buildbot-worker/minipc-1050ti-linux/rundir/sollvevv.src/tests/4.5/declare_target/test_declare_target_link_extended_list.c.o.time /home/buildbot-worker/minipc-1050ti-linux/openmp-offload-cuda-runtime/llvm.inst/bin/clang -DNDEBUG -I/home/buildbot-worker/minipc-1050ti-linux/rundir/sollvevv.src/ompvv -gline-tables-only -O3 -DNDEBUG   -w -Werror=date-time -fopenmp-targets=nvptx64-nvidia-cuda --cuda-path=/opt/cuda -fopenmp=libomp -MD -MT External/sollve_vv/CMakeFiles/omptargetvv-test_declare_target_link_extended_list-45_declare_target-c.dir/home/buildbot-worker/minipc-1050ti-linux/rundir/sollvevv.src/tests/4.5/declare_target/test_declare_target_link_extended_list.c.o -MF External/sollve_vv/CMakeFiles/omptargetvv-test_declare_target_link_extended_list-45_declare_target-c.dir/home/buildbot-worker/minipc-1050ti-linux/rundir/sollvevv.src/tests/4.5/declare_target/test_declare_target_link_extended_list.c.o.d -o External/sollve_vv/CMakeFiles/omptargetvv-test_declare_target_link_extended_list-45_declare_target-c.dir/home/buildbot-worker/minipc-1050ti-linux/rundir/sollvevv.src/tests/4.5/declare_target/test_declare_target_link_extended_list.c.o   -c /home/buildbot-worker/minipc-1050ti-linux/rundir/sollvevv.src/tests/4.5/declare_target/test_declare_target_link_extended_list.c
[stdout] While deleting: ptr %aint_decl_tgt_ref_ptr
[stdout] An asserting value handle still pointed to this value!
[stdout] UNREACHABLE executed at /home/buildbot-worker/minipc-1050ti-linux/rundir/llvm.src/llvm/lib/IR/Value.cpp:1182!
[stdout] PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
[stdout] Stack dump:
[stdout] 0.     Program arguments: /home/buildbot-worker/minipc-1050ti-linux/openmp-offload-cuda-runtime/llvm.inst/bin/clang-16 -cc1 -triple nvptx64-nvidia-cuda -aux-triple x86_64-unknown-linux-gnu -S -disable-free -clear-ast-before-backend -main-file-name test_declare_target_link_extended_list.c -mrelocation-model pic -pic-level 2 -fhalf-no-semantic-interposition -mframe-pointer=all -ffp-contract=on -fno-rounding-math -fno-verbose-asm -no-integrated-as -mlink-builtin-bitcode /opt/cuda/nvvm/libdevice/libdevice.10.bc -target-sdk-version=11.5 -mlink-builtin-bitcode /home/buildbot-worker/minipc-1050ti-linux/openmp-offload-cuda-runtime/llvm.inst/lib/libomptarget-nvptx-sm_61.bc -target-cpu sm_61 -target-feature +ptx75 -mllvm -treat-scalable-fixed-error-as-warning -debug-info-kind=line-directives-only -dwarf-version=2 -debugger-tuning=gdb -fno-dwarf-directory-asm -resource-dir /home/buildbot-worker/minipc-1050ti-linux/openmp-offload-cuda-runtime/llvm.inst/lib/clang/16 -dependency-file External/sollve_vv/CMakeFiles/omptargetvv-test_declare_target_link_extended_list-45_declare_target-c.dir/home/buildbot-worker/minipc-1050ti-linux/rundir/sollvevv.src/tests/4.5/declare_target/test_declare_target_link_extended_list.c.o.d -MT External/sollve_vv/CMakeFiles/omptargetvv-test_declare_target_link_extended_list-45_declare_target-c.dir/home/buildbot-worker/minipc-1050ti-linux/rundir/sollvevv.src/tests/4.5/declare_target/test_declare_target_link_extended_list.c.o -sys-header-deps -internal-isystem /home/buildbot-worker/minipc-1050ti-linux/openmp-offload-cuda-runtime/llvm.inst/lib/clang/16/include/openmp_wrappers -include __clang_openmp_device_functions.h -D NDEBUG -I /home/buildbot-worker/minipc-1050ti-linux/rundir/sollvevv.src/ompvv -D NDEBUG -internal-isystem /home/buildbot-worker/minipc-1050ti-linux/openmp-offload-cuda-runtime/llvm.inst/lib/clang/16/include -internal-isystem /usr/local/include -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/9/../../../../x86_64-linux-gnu/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -internal-isystem /opt/cuda/include -internal-isystem /home/buildbot-worker/minipc-1050ti-linux/openmp-offload-cuda-runtime/llvm.inst/lib/clang/16/include -internal-isystem /usr/local/include -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/9/../../../../x86_64-linux-gnu/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -O3 -Werror=date-time -w -fdebug-compilation-dir=/home/buildbot-worker/minipc-1050ti-linux/rundir/test-suite.build -ferror-limit 19 -fvisibility=protected -fopenmp -fgnuc-version=4.2.1 -vectorize-loops -vectorize-slp -fopenmp-is-device -fopenmp-host-ir-file-path /tmp/buildbot-worker/test_declare_target_link_extended_list-7f9e51.bc -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /tmp/buildbot-worker/test_declare_target_link_extended_list-e1449d.s -x c /home/buildbot-worker/minipc-1050ti-linux/rundir/sollvevv.src/tests/4.5/declare_target/test_declare_target_link_extended_list.c
[stdout] 1.     <eof> parser at end of file
[stdout] 2.     Code generation
[stdout] 3.     Running pass 'Ensure that the global variables are in the global address space' on module '/home/buildbot-worker/minipc-1050ti-linux/rundir/sollvevv.src/tests/4.5/declare_target/test_declare_target_link_extended_list.c'.
[stdout]  #0 0x0000562ad8d568a4 PrintStackTraceSignalHandler(void*) Signals.cpp:0:0
[stdout]  #1 0x0000562ad8d54094 SignalHandler(int) Signals.cpp:0:0
[stdout]  #2 0x00007f87c911a420 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x14420)
[stdout]  #3 0x00007f87c8be700b raise /build/glibc-SzIz7B/glibc-2.31/signal/../sysdeps/unix/sysv/linux/raise.c:51:1
[stdout]  #4 0x00007f87c8bc6859 abort /build/glibc-SzIz7B/glibc-2.31/stdlib/abort.c:81:7
[stdout]  #5 0x0000562ad8c9625e (/home/buildbot-worker/minipc-1050ti-linux/openmp-offload-cuda-runtime/llvm.inst/bin/clang-16+0x3e2325e)
[stdout]  #6 0x0000562ad850345d llvm::ValueHandleBase::ValueIsDeleted(llvm::Value*) (/home/buildbot-worker/minipc-1050ti-linux/openmp-offload-cuda-runtime/llvm.inst/bin/clang-16+0x369045d)
[stdout]  #7 0x0000562ad850430d llvm::Value::~Value() (/home/buildbot-worker/minipc-1050ti-linux/openmp-offload-cuda-runtime/llvm.inst/bin/clang-16+0x369130d)
[stdout]  #8 0x0000562ad8429463 llvm::GlobalVariable::eraseFromParent() (/home/buildbot-worker/minipc-1050ti-linux/openmp-offload-cuda-runtime/llvm.inst/bin/clang-16+0x35b6463)
[stdout]  #9 0x0000562ad7a0794f (anonymous namespace)::GenericToNVVM::runOnModule(llvm::Module&) NVPTXGenericToNVVM.cpp:0:0
[stdout] #10 0x0000562ad8494972 llvm::legacy::PassManagerImpl::run(llvm::Module&) (/home/buildbot-worker/minipc-1050ti-linux/openmp-offload-cuda-runtime/llvm.inst/bin/clang-16+0x3621972)
[stdout] #11 0x0000562ad9523144 clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::HeaderSearchOptions const&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::StringRef, llvm::Module*, clang::BackendAction, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream>>) (/home/buildbot-worker/minipc-1050ti-linux/openmp-offload-cuda-runtime/llvm.inst/bin/clang-16+0x46b0144)
[stdout] #12 0x0000562ad9c4d8db clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) CodeGenAction.cpp:0:0
[stdout] #13 0x0000562ada6ff965 clang::ParseAST(clang::Sema&, bool, bool) (/home/buildbot-worker/minipc-1050ti-linux/openmp-offload-cuda-runtime/llvm.inst/bin/clang-16+0x588c965)
[stdout] #14 0x0000562ad9c4c388 clang::CodeGenAction::ExecuteAction() (/home/buildbot-worker/minipc-1050ti-linux/openmp-offload-cuda-runtime/llvm.inst/bin/clang-16+0x4dd9388)
[stdout] #15 0x0000562ad9b4d909 clang::FrontendAction::Execute() (/home/buildbot-worker/minipc-1050ti-linux/openmp-offload-cuda-runtime/llvm.inst/bin/clang-16+0x4cda909)
[stdout] #16 0x0000562ad9ad1bfe clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/home/buildbot-worker/minipc-1050ti-linux/openmp-offload-cuda-runtime/llvm.inst/bin/clang-16+0x4c5ebfe)
[stdout] #17 0x0000562ad9c40ce7 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/home/buildbot-worker/minipc-1050ti-linux/openmp-offload-cuda-runtime/llvm.inst/bin/clang-16+0x4dcdce7)
[stdout] #18 0x0000562ad75af949 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/home/buildbot-worker/minipc-1050ti-linux/openmp-offload-cuda-runtime/llvm.inst/bin/clang-16+0x273c949)
[stdout] #19 0x0000562ad75ab237 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&) driver.cpp:0:0
[stdout] #20 0x0000562ad75ac8c0 clang_main(int, char**) (/home/buildbot-worker/minipc-1050ti-linux/openmp-offload-cuda-runtime/llvm.inst/bin/clang-16+0x27398c0)
[stdout] #21 0x00007f87c8bc8083 __libc_start_main /build/glibc-SzIz7B/glibc-2.31/csu/../csu/libc-start.c:342:3
[stdout] #22 0x0000562ad75a6b6e _start (/home/buildbot-worker/minipc-1050ti-linux/openmp-offload-cuda-runtime/llvm.inst/bin/clang-16+0x2733b6e)
[stdout] clang-16: error: unable to execute command: Aborted
[stdout] clang-16: error: clang frontend command failed due to signal (use -v to see invocation)
[stdout] clang version 16.0.0 (https://github.com/llvm/llvm-project.git ca515294879652a46c0e76aaa66f8e415e308b8d)
[stdout] Target: x86_64-unknown-linux-gnu
[stdout] Thread model: posix
[stdout] InstalledDir: /home/buildbot-worker/minipc-1050ti-linux/openmp-offload-cuda-runtime/llvm.inst/bin
[stdout] clang-16: note: diagnostic msg: 
[stdout] ********************
[stdout] 
[stdout] PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
[stdout] Preprocessed source(s) and associated run script(s) are located at:
[stdout] clang-16: note: diagnostic msg: /tmp/buildbot-worker/test_declare_target_link_extended_list-62d178.c
[stdout] clang-16: note: diagnostic msg: /tmp/buildbot-worker/test_declare_target_link_extended_list-4e7ddc.c
[stdout] clang-16: note: diagnostic msg: /tmp/buildbot-worker/test_declare_target_link_extended_list-62d178.sh
[stdout] clang-16: note: diagnostic msg: 
[stdout] 
[stdout] ********************
```

[Clang automatically generated reproducer](https://github.com/llvm/llvm-project/files/10077427/test_declare_target_link_extended_list-7c2dde.zip)


</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJztO1tT27rWvya8aOzx_fLAg0lCywwtTGHT7y0jS3KiU8fyke0A_fVnLdmBJHUou-0u-5spE5xEl6V1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