[llvm] [WinEH] Fix asm in catchpad being turned into unreachable (PR #138392)

Reid Kleckner via llvm-commits llvm-commits at lists.llvm.org
Thu May 8 09:24:53 PDT 2025


https://github.com/rnk requested changes to this pull request.

Thanks for the fix! I think this bug has been present since the logic was added in 08dd52dc7568 , which has a test (WinEH/wineh-asm.ll). I realized that the original test doesn't fail because we forgot to invoke FileCheck on the output of opt! Can you please add that, and confirm that the original test now passes? I looked at the output , and it is clearly wrong:
```
$ opt -win-eh-prepare ../llvm/test/CodeGen/WinEH/wineh-asm.ll -o - -S
...
define void @test1() personality ptr @__CxxFrameHandler3 {
entry:
  invoke void @f(i32 1)
          to label %exit unwind label %cleanup

cleanup:                                          ; preds = %entry
  %cp = cleanuppad within none []
  unreachable
...
```

https://github.com/llvm/llvm-project/pull/138392


More information about the llvm-commits mailing list