1# RUN: llc -run-pass=if-converter %s -o - | FileCheck %s
2--- |
3  target triple = "thumbv8m.main-arm-none-eabi"
4
5  define hidden void @foo(void ()* nocapture %baz) local_unnamed_addr #0 {
6  entry:
7    %call = call i32 @bar() #0
8    %tobool = icmp eq i32 %call, 0
9    br i1 %tobool, label %land.end, label %land.rhs
10
11  land.rhs:                                         ; preds = %entry
12    %call1 = call i32 @bar() #0
13    br label %land.end
14
15  land.end:                                         ; preds = %land.rhs, %entry
16    call void %baz() #0
17    ret void
18  }
19  declare dso_local i32 @bar() local_unnamed_addr #0
20
21  attributes #0 = { nounwind }
22
23...
24---
25name:            foo
26alignment:       4
27tracksRegLiveness: true
28liveins:
29  - { reg: '$r0' }
30frameInfo:
31  stackSize:       8
32  maxAlignment:    4
33  adjustsStack:    true
34  hasCalls:        true
35  maxCallFrameSize: 0
36stack:
37  - { id: 0, type: spill-slot, offset: -4, size: 4, alignment: 4, callee-saved-register: '$lr',
38      callee-saved-restored: false }
39  - { id: 1, type: spill-slot, offset: -8, size: 4, alignment: 4, callee-saved-register: '$r4' }
40machineFunctionInfo: {}
41body:             |
42  bb.0.entry:
43    successors: %bb.2(0x30000000), %bb.1(0x50000000)
44    liveins: $r0, $r4, $lr
45
46    $sp = frame-setup t2STMDB_UPD $sp, 14, $noreg, killed $r4, killed $lr
47    $r4 = tMOVr $r0, 14, $noreg
48    tBL 14, $noreg, @bar, csr_aapcs, implicit-def dead $lr, implicit $sp, implicit-def $sp, implicit-def $r0
49    t2CMPri killed renamable $r0, 0, 14, $noreg, implicit-def $cpsr
50    t2Bcc %bb.2, 0, killed $cpsr
51
52  bb.1.land.rhs:
53    liveins: $r4
54
55    tBL 14, $noreg, @bar, csr_aapcs, implicit-def dead $lr, implicit $sp, implicit-def $sp, implicit-def dead $r0
56
57  bb.2.land.end:
58    liveins: $r4
59
60    $sp = t2STMDB_UPD $sp, 14, $noreg, $r4, killed $r5, killed $r6, killed $r7, killed $r8, killed $r9, killed $r10, killed $r11
61    $r4 = t2BICri $r4, 1, 14, $noreg, $noreg
62    $sp = tSUBspi $sp, 34, 14, $noreg
63    VLSTM $sp, 14, $noreg
64    tBLXNSr 14, $noreg, killed $r4, csr_aapcs, implicit-def $lr, implicit $sp, implicit-def dead $lr, implicit $sp, implicit-def $sp
65    VLLDM $sp, 14, $noreg, implicit-def $q0, implicit-def $q1, implicit-def $q2, implicit-def $q3, implicit-def $q4, implicit-def $q5, implicit-def $q6, implicit-def $q7, implicit-def $vpr, implicit-def $fpscr, implicit-def $fpscr_nzcv
66    $sp = tADDspi $sp, 34, 14, $noreg
67    $sp = t2LDMIA_UPD $sp, 14, $noreg, def $r4, def $r5, def $r6, def $r7, def $r8, def $r9, def $r10, def $r11
68    $sp = t2LDMIA_RET $sp, 14, $noreg, def $r4, def $pc
69
70...
71# Just check there is no ICE (in debug builds)
72# CHECK: name: foo
73