1 # Start after bbsections0-prepare and check if the right code is generated.
2 # RUN: llc -mtriple x86_64-unknown-linux-gnu -start-after=bbsections-prepare %s -o - | FileCheck %s -check-prefix=CHECK
5 # How to generate the input:
12 # clang -O0 -S -emit-llvm foo.cc
13 # llc < foo.ll -stop-after=bbsections-prepare -basic-block-sections=all
16 ; Function Attrs: noinline nounwind optnone uwtable
17 define dso_local i32 @_Z3foob(i1 zeroext %0) #0 {
18 %2 = alloca i32, align 4
19 %3 = alloca i8, align 1
21 store i8 %4, ptr %3, align 1
22 %5 = load i8, ptr %3, align 1
23 %6 = trunc i8 %5 to i1
24 br i1 %6, label %7, label %8
27 store i32 1, ptr %2, align 4
31 store i32 0, ptr %2, align 4
35 %10 = load i32, ptr %2, align 4
39 attributes #0 = { "frame-pointer"="all" "target-cpu"="x86-64" }
46 exposesReturnsTwice: false
48 regBankSelected: false
51 tracksRegLiveness: true
55 - { reg: '$edi', virtual-reg: '' }
57 isFrameAddressTaken: false
58 isReturnAddressTaken: false
68 cvBytesOfCalleeSavedRegisters: 0
69 hasOpaqueSPAdjustment: false
71 hasMustTailInVarArgFunc: false
76 - { id: 0, type: spill-slot, offset: -16, size: 8, alignment: 16, stack-id: default,
77 callee-saved-register: '', callee-saved-restored: true, debug-info-variable: '',
78 debug-info-expression: '', debug-info-location: '' }
80 - { id: 0, type: default, offset: -24, size: 4,
81 alignment: 4, stack-id: default, callee-saved-register: '', callee-saved-restored: true,
82 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
83 - { id: 1, type: default, offset: -17, size: 1,
84 alignment: 1, stack-id: default, callee-saved-register: '', callee-saved-restored: true,
85 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
88 machineFunctionInfo: {}
90 bb.0 (%ir-block.1, align 4, bbsections 0):
91 successors: %bb.2(0x40000000), %bb.1(0x40000000)
94 frame-setup PUSH64r killed $rbp, implicit-def $rsp, implicit $rsp
95 CFI_INSTRUCTION def_cfa_offset 16
96 CFI_INSTRUCTION offset $rbp, -16
97 $rbp = frame-setup MOV64rr $rsp
98 CFI_INSTRUCTION def_cfa_register $rbp
99 renamable $dil = AND8ri renamable $dil, 1, implicit-def dead $eflags, implicit killed $edi, implicit-def $edi
100 MOV8mr $rbp, 1, $noreg, -1, $noreg, renamable $dil, implicit killed $edi :: (store (s8) into %ir.3)
101 TEST8mi $rbp, 1, $noreg, -1, $noreg, 1, implicit-def $eflags :: (load (s8) from %ir.3)
102 JCC_1 %bb.2, 4, implicit killed $eflags
105 bb.1 (%ir-block.7, bbsections 1):
106 successors: %bb.3(0x80000000)
108 MOV32mi $rbp, 1, $noreg, -8, $noreg, 1 :: (store (s32) into %ir.2)
111 bb.2 (%ir-block.8, bbsections 2):
112 successors: %bb.3(0x80000000)
114 MOV32mi $rbp, 1, $noreg, -8, $noreg, 0 :: (store (s32) into %ir.2)
117 bb.3 (%ir-block.9, bbsections 3):
118 renamable $eax = MOV32rm $rbp, 1, $noreg, -8, $noreg :: (load (s32) from %ir.2)
119 $rbp = frame-destroy POP64r implicit-def $rsp, implicit $rsp
120 CFI_INSTRUCTION def_cfa $rsp, 8
125 # CHECK: .section .text._Z3foob,"ax",@progbits
127 # CHECK: .section .text._Z3foob,"ax",@progbits,unique
128 # CHECK: _Z3foob.__part.1:
129 # CHECK: .section .text._Z3foob,"ax",@progbits,unique
130 # CHECK: _Z3foob.__part.2:
131 # CHECK: .section .text._Z3foob,"ax",@progbits,unique
132 # CHECK: _Z3foob.__part.3: