1; Check if basic blocks that don't get unique sections are placed in cold sections.
2; Basic block with id 1 and 2 must be in the cold section.
3; RUN: echo '!_Z3bazb' > %t
4; RUN: echo '!!0' >> %t
5; RUN: llc < %s -mtriple=x86_64-pc-linux -function-sections -basic-block-sections=%t -unique-basic-block-section-names | FileCheck %s -check-prefix=LINUX-SECTIONS
6
7define void @_Z3bazb(i1 zeroext) nounwind {
8  %2 = alloca i8, align 1
9  %3 = zext i1 %0 to i8
10  store i8 %3, i8* %2, align 1
11  %4 = load i8, i8* %2, align 1
12  %5 = trunc i8 %4 to i1
13  br i1 %5, label %6, label %8
14
156:                                                ; preds = %1
16  %7 = call i32 @_Z3barv()
17  br label %10
18
198:                                                ; preds = %1
20  %9 = call i32 @_Z3foov()
21  br label %10
22
2310:                                               ; preds = %8, %6
24  ret void
25}
26
27declare i32 @_Z3barv() #1
28
29declare i32 @_Z3foov() #1
30
31; LINUX-SECTIONS: .section        .text._Z3bazb,"ax",@progbits
32; LINUX-SECTIONS: _Z3bazb:
33; Check that the basic block with id 1 doesn't get a section.
34; LINUX-SECTIONS-NOT: .section        .text._Z3bazb._Z3bazb.1,"ax",@progbits,unique
35; Check that a single cold section is started here and id 1 and 2 blocks are placed here.
36; LINUX-SECTIONS: .section	.text.unlikely._Z3bazb,"ax",@progbits
37; LINUX-SECTIONS: _Z3bazb.cold:
38; LINUX-SECTIONS-NOT: .section        .text._Z3bazb._Z3bazb.2,"ax",@progbits,unique
39; LINUX-SECTIONS: .LBB0_2:
40; LINUX-SECTIONS: .size   _Z3bazb, .Lfunc_end{{[0-9]}}-_Z3bazb
41