Demetrius Kanios 0a76568db0
[WebAssembly] Reapply "[WebAssembly] Incorporate SCCs into WebAssemblyFixIrreducibleControlFlow" (#181755) (#184441)
Re-application of #181755.

Includes fixes to issues found after the original's merge.
2026-03-05 11:13:43 -08:00

22 lines
562 B
LLVM

; RUN: llc < %s -O0 -verify-machineinstrs
target triple = "wasm32-unknown-unknown"
; Regression test for #184441.
; Ensures that the orphanation of block %b due to the eliding of the
; `unreachable` default label of the switch during IR => DAG translation
; (without any subsequent DCE) doesn't trip our assertions in
; WebAssemblyFixIrreducibleControlFlow, which expect all blocks in a function
; to be reachable from the function's entry.
define void @test() {
entry:
switch i32 poison, label %b [
i32 0, label %a
]
a:
ret void
b:
unreachable
}