1 ; RUN: llc < %s -asm-verbose=false -verify-machineinstrs -disable-block-placement -wasm-disable-explicit-locals -wasm-keep-registers | FileCheck %s
3 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
4 target triple = "wasm32-unknown-unknown"
7 ; Test an interesting pattern of nested irreducibility.
8 ; Just check we resolve all the irreducibility here (if not we'd crash).
10 ; CHECK-LABEL: tre_parse:
12 define void @tre_parse() {
14 br label %for.cond.outer
16 for.cond.outer: ; preds = %do.body14, %entry
19 for.cond: ; preds = %for.cond.backedge, %for.cond.outer
20 %nbranch.0 = phi i32* [ null, %for.cond.outer ], [ %call188, %for.cond.backedge ]
21 switch i8 undef, label %if.else [
22 i8 40, label %do.body14
23 i8 41, label %if.then63
26 do.body14: ; preds = %for.cond
27 br label %for.cond.outer
29 if.then63: ; preds = %for.cond
32 if.else: ; preds = %for.cond
33 switch i8 undef, label %if.then84 [
34 i8 92, label %if.end101
35 i8 42, label %if.end101
38 if.then84: ; preds = %if.else
39 switch i8 undef, label %cleanup.thread [
40 i8 43, label %if.end101
41 i8 63, label %if.end101
42 i8 123, label %if.end101
45 if.end101: ; preds = %if.then84, %if.then84, %if.then84, %if.else, %if.else
48 cleanup.thread: ; preds = %if.then84
49 %call188 = tail call i32* undef(i32* %nbranch.0)
50 switch i8 undef, label %for.cond.backedge [
51 i8 92, label %land.lhs.true208
52 i8 0, label %if.else252
55 land.lhs.true208: ; preds = %cleanup.thread
58 for.cond.backedge: ; preds = %cleanup.thread
61 if.else252: ; preds = %cleanup.thread