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

    <tr>
        <th>Summary</th>
        <td>
            ORC crashed with unnamed external GlobalValue
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            orcjit
      </td>
    </tr>

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

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

<pre>
    Consider the following reduced LLVM IR:
```llvm
@0 = constant [2 x i8] c"a\00"

define dso_local i32 @main() {
entry:
  ret i32 0
}
```

`lli --jit-kind=orc test.ll` crashes with
```
src/llvm/lib/ExecutionEngine/Orc/Core.cpp:2879: llvm::Error llvm::orc::ExecutionSession::OL_notifyResolved(llvm::orc::MaterializationResponsibility&, const SymbolMap&): Assertion `I != MR.SymbolFlags.end() && "Resolving symbol outside this responsibility set"' failed.
```

Of course, the IR doesn't make sense because you cannot reference the `GlobalValue` from anywhere other than this `Module` (as `@0`), but would be nice if the JIT didn't crash.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx9U01v4jAQ_TXhMiIKTiDkkAOFsmJVhMSueq2ceELcGhvZTin763ds6C5aVStFmWQ8H2_mPTdGXOql0U4KtOB7hM4oZc5SH8CiGFoU8PT0vIXNPskXSbZKskUyy66PUu_Hm6vIMkjyFbRUynPtIZk-MPgAOU-m5E0Y48l0mWX0ccuIb4Gd1AjCmRdlWq5A5gyo2JFLnbB5wipIyodrLGpvL39AAMHzMTy7FSxX_8C7bxTRShiPX6Ufv0ktCKyxLXh0PlWKjqG13PXo4Cx9_2UlZ2mOdRyajGzo_fiB7eCl0Y_6QIOQZxeDlsZi2p5OBJfNy4oMxDxCny8erTX27p9w3A4-q_1A58hcvbunF2287C57dEa9o6DFfJG85R6t5Er-4qEEBZ8CrY1U0l8SNkvY8soO_LgcG6O2_BS9EdzCObQhDWjaDSRsEsjc7tNr7Frxg0tRi09OQuKMDLtiCmpxMRLM4IOWSErSEUX3IMChD_yzEjouFYr0P4TtOkI7WIcBd9DlZg_CoCNZlB6O_A2pnHYIDbZ8IHsxA7Rc06qobYcWdYsxkQp_U6bh6pmrAQPTnTVH4Ppy7ikMDAUF6XN9BU0RWyMGFUNpYB5dQeHB0L4IUDN4OJtBCWoPWlIn2cVm3zc_QUhxRRkVlY5EnYsqr_jIS6-w3u2XN62JqDUYtOZH-sEPYlDTJbiDOxqsqnvvTy6wzNb0HChnaNLWHO_USGZ8suYVW1rxWjo3oKOPaTGf5KO-bprJhM9wUuI8x7aYlF1VzGZYTJCLWdU2I8UbVK6mW0sMkabomgSqpquRrFnGWFZkVKmYFnlazefY8XlVlaJtWNnSZpDuq0oDiNTYw8jWEU8zHBwdKum8-3vISdoHjRh7UX0--N7Yuue9fjWjiLyOsH8DvMVtHg">