1 # Check if the alignment directive is put on the correct place when the basic block section option is used.
2 # RUN: llc -mtriple x86_64-unknown-linux-gnu -start-after=bbsections-prepare %s -o - | FileCheck %s -check-prefix=CHECK
4 # How to generate the input:
20 # clang -O0 -S -emit-llvm test.c
21 # llc < test.ll -stop-after=bbsections-prepare -align-all-nofallthru-blocks=8 -basic-block-sections=all
25 define i32 @test(i32 noundef %a) {
27 switch i32 %a, label %return [
30 i32 8, label %sw.epilog
33 sw.bb1: ; preds = %entry, %entry
36 sw.epilog: ; preds = %sw.bb1, %entry
37 %a.addr.1 = phi i32 [ %a, %entry ], [ -2, %sw.bb1 ]
40 return: ; preds = %sw.epilog, %entry
41 %retval.0 = phi i32 [ %a.addr.1, %sw.epilog ], [ 10, %entry ]
50 exposesReturnsTwice: false
52 regBankSelected: false
55 tracksRegLiveness: true
58 callsUnwindInit: false
62 failsVerification: false
63 tracksDebugUserValues: true
66 - { reg: '$edi', virtual-reg: '' }
68 isFrameAddressTaken: false
69 isReturnAddressTaken: false
80 cvBytesOfCalleeSavedRegisters: 0
81 hasOpaqueSPAdjustment: false
83 hasMustTailInVarArgFunc: false
91 debugValueSubstitutions: []
93 machineFunctionInfo: {}
96 successors: %bb.1(0x40000000), %bb.2(0x40000000)
99 renamable $edi = KILL $edi, implicit-def $rdi
100 renamable $eax = LEA64_32r renamable $rdi, 1, $noreg, -1, $noreg
101 CMP32ri8 killed renamable $eax, 2, implicit-def $eflags
102 JCC_1 %bb.2, 3, implicit $eflags
105 bb.1.sw.bb1 (bbsections 1):
106 successors: %bb.3(0x80000000)
108 renamable $edi = MOV32ri -2, implicit-def $rdi
111 bb.2.entry (align 256, bbsections 2):
112 successors: %bb.3(0x40000000), %bb.4(0x40000000)
115 renamable $eax = MOV32ri 10
116 CMP32ri8 renamable $edi, 8, implicit-def $eflags
117 JCC_1 %bb.4, 5, implicit $eflags
120 bb.3.sw.epilog (bbsections 3):
121 successors: %bb.4(0x80000000)
124 $eax = MOV32rr $edi, implicit killed $rdi
127 bb.4.return (bbsections 4):
134 # CHECK: .section .text.test,"ax",@progbits,unique,2
135 # CHECK-NEXT: .p2align 8, 0x90
136 # CHECK-NEXT: test.__part.2: # %entry