1 ;; Check the basic block sections list option.
3 ; RUN: echo '!_Z3foob' > %t1
7 ; RUN: echo 'f _Z3foob' >> %t2
9 ; RUN: llc < %s -mtriple=x86_64-pc-linux -function-sections -basic-block-sections=%t1 -unique-basic-block-section-names | FileCheck %s -check-prefix=LINUX-SECTIONS --check-prefix=LINUX-SECTIONS-FUNCTION-SECTION
10 ; RUN: llc < %s -mtriple=x86_64-pc-linux -basic-block-sections=%t1 -unique-basic-block-section-names | FileCheck %s -check-prefix=LINUX-SECTIONS --check-prefix=LINUX-SECTIONS-NO-FUNCTION-SECTION
11 ; RUN: llc < %s -mtriple=x86_64-pc-linux -basic-block-sections=%t1 -unique-basic-block-section-names --bbsections-guided-section-prefix=false | FileCheck %s -check-prefix=LINUX-SECTIONS-NO-GUIDED-PREFIX
12 ; RUN: llc < %s -mtriple=x86_64-pc-linux -function-sections -basic-block-sections=%t2 -unique-basic-block-section-names | FileCheck %s -check-prefix=LINUX-SECTIONS --check-prefix=LINUX-SECTIONS-FUNCTION-SECTION
13 ; RUN: llc < %s -mtriple=x86_64-pc-linux -basic-block-sections=%t2 -unique-basic-block-section-names | FileCheck %s -check-prefix=LINUX-SECTIONS --check-prefix=LINUX-SECTIONS-NO-FUNCTION-SECTION
14 ; RUN: llc < %s -mtriple=x86_64-pc-linux -basic-block-sections=%t2 -unique-basic-block-section-names --bbsections-guided-section-prefix=false | FileCheck %s -check-prefix=LINUX-SECTIONS-NO-GUIDED-PREFIX
16 define i32 @_Z3foob(i1 zeroext %0) nounwind {
17 %2 = alloca i32, align 4
18 %3 = alloca i8, align 1
20 store i8 %4, ptr %3, align 1
21 %5 = load i8, ptr %3, align 1
22 %6 = trunc i8 %5 to i1
23 %7 = zext i1 %6 to i32
24 %8 = icmp sgt i32 %7, 0
25 br i1 %8, label %9, label %11
28 %10 = call i32 @_Z3barv()
29 store i32 %10, ptr %2, align 4
33 %12 = call i32 @_Z3bazv()
34 store i32 %12, ptr %2, align 4
38 %14 = load i32, ptr %2, align 4
42 declare i32 @_Z3barv() #1
43 declare i32 @_Z3bazv() #1
45 define i32 @_Z3zipb(i1 zeroext %0) nounwind {
46 %2 = alloca i32, align 4
47 %3 = alloca i8, align 1
49 store i8 %4, ptr %3, align 1
50 %5 = load i8, ptr %3, align 1
51 %6 = trunc i8 %5 to i1
52 %7 = zext i1 %6 to i32
53 %8 = icmp sgt i32 %7, 0
54 br i1 %8, label %9, label %11
57 %10 = call i32 @_Z3barv()
58 store i32 %10, ptr %2, align 4
62 %12 = call i32 @_Z3bazv()
63 store i32 %12, ptr %2, align 4
67 %14 = load i32, ptr %2, align 4
71 ; LINUX-SECTIONS-NO-GUIDED-PREFIX: .section .text._Z3foob,"ax",@progbits
72 ; LINUX-SECTIONS: .section .text.hot._Z3foob,"ax",@progbits
73 ; LINUX-SECTIONS: _Z3foob:
74 ; LINUX-SECTIONS: .section .text.hot._Z3foob._Z3foob.__part.1,"ax",@progbits
75 ; LINUX-SECTIONS: _Z3foob.__part.1:
76 ; LINUX-SECTIONS: .section .text.hot._Z3foob._Z3foob.__part.2,"ax",@progbits
77 ; LINUX-SECTIONS: _Z3foob.__part.2:
78 ; LINUX-SECTIONS: .section .text.hot._Z3foob._Z3foob.__part.3,"ax",@progbits
79 ; LINUX-SECTIONS: _Z3foob.__part.3:
81 ; LINUX-SECTIONS-FUNCTION-SECTION: .section .text._Z3zipb,"ax",@progbits
82 ; LINUX-SECTIONS-NO-FUNCTION-SECTION-NOT: .section .text{{.*}}._Z3zipb,"ax",@progbits
83 ; LINUX-SECTIONS: _Z3zipb:
84 ; LINUX-SECTIONS-NOT: .section .text{{.*}}._Z3zipb.__part.{{[0-9]+}},"ax",@progbits
85 ; LINUX-SECTIONS-NOT: _Z3zipb.__part.{{[0-9]+}}: