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

    <tr>
        <th>Summary</th>
        <td>
            clang-cl -EHa doesn't generate calls to @llvm.seh.try.end
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang:codegen,
            platform:windows
      </td>
    </tr>

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

    <tr>
      <th>Reporter</th>
      <td>
          efriedma-quic
      </td>
    </tr>
</table>

<pre>
    Consider the following:

```
int volatile *NullPtr = 0;
void foo(), bar();
void baz() {
  try {
    try {
    } catch(...) {
 foo();
      __builtin_unreachable();
    }
    *NullPtr = 0;
  } catch (...) {
    bar();
  }
}
void baz2() {
  try {
 try {
      *NullPtr = 0;
    } catch(...) {
      foo();
 __builtin_unreachable();
    }
  } catch (...) {
    bar();
 }
}
```

baz() and baz2() currently lower to exactly the same code; that seems unlikely to be correct.

https://godbolt.org/z/f9odrKGEf
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyck91u2zoMx5-GviFiKHTiOBe-aJvmHGDAsDcoZImJtclSJ8nN0qcf5KZr2mYr0CCQTfovfvxAyhjN3jG3sLyG5aaQY-p9aHkXDOtBzn6ORhWd18f2xrtoNAdMPePOW-sPxu2hugKxAfF81uL0n0zjEj54K5OxjEBXX0drv6WAUG1QQHX9pHrwRuPOe6AGaA10g50MJ-OVppOPT26E1cmPmMLx3LzggNUGlUyqB2rKsnx9_yVvdXYF8e6uG41Nxt2NLrBUvewsX1DCanNm_K3FsyLwUhWIF3o-C_7n5ZkDfQTiHYV_VvcBpOl3gdQnIH2Gw3sMb-bs6XwZD-leQVJjCOySPaL1hzzBHvmXVNmRhznKgVF5zVBdY-plwsg8RBydNT84izx2WRECq1Sep-xTuo95B2gLtN173XmbSh_2QNtHoO1u7XX48t_trtBtpdfVWhbczutmMW9Wi6ou-rZRtdBCdCSbqlFaCV40tFysSEium0YXpiVBlVjOlzRfiqou67nQC81N0wi9m89rWAgepLGltQ9Dzl2YGEdua1pRVVjZsY3TehMpK6eVzc3u2QER0A0Q3VuZdj4MUF0djNP-EPOn5aYIbQ4668Z9hIWwJqb4kiaZZLmdYs6Uxdnt_xK15-iAVgn37DjIxKiktTEzzBHy3ch9mcKxZKeLMdj2DUST-rErlR-Atll_eszug__OKgFtp_4i0HZq8XcAAAD__9STUqw">