1 ; BB cluster section test for exception handling.
3 ; Test1: Basic blocks #1 and #3 are landing pads and must be in the same section.
4 ; Basic block 2 will be placed in a unique section, but #1 and #3 are placed in the special exception section.
5 ; The rest will be placed in a section along with the entry basic block.
6 ; RUN: echo '!main' > %t1
7 ; RUN: echo '!!1 2' >> %t1
8 ; RUN: llc < %s -O0 -mtriple=x86_64-pc-linux -function-sections -basic-block-sections=%t1 | FileCheck %s -check-prefix=LINUX-SECTIONS1
10 ; Test2: Basic blocks #1, #2, and #3 go into a separate section.
11 ; No separate exception section will be created as #1 and #3 are already in one section.
12 ; The rest will be placed in a section along with the entry basic block.
13 ; RUN: echo '!main' > %t2
14 ; RUN: echo '!!1 2 3' >> %t2
15 ; RUN: llc < %s -O0 -mtriple=x86_64-pc-linux -function-sections -basic-block-sections=%t2 | FileCheck %s -check-prefix=LINUX-SECTIONS2
17 @_ZTIi = external constant ptr
19 define i32 @main() uwtable optsize ssp personality ptr @__gxx_personality_v0 {
21 invoke void @_Z1fv() optsize
22 to label %try.cont unwind label %lpad1
25 %0 = landingpad { ptr, i32 }
31 invoke void @_Z2fv() optsize
32 to label %try.cont unwind label %lpad2
36 %2 = landingpad { ptr, i32 }
42 resume { ptr, i32 } %0
45 resume { ptr, i32 } %2
48 declare void @_Z1fv() optsize
50 declare void @_Z2fv() optsize
52 declare i32 @__gxx_personality_v0(...)
54 ; LINUX-SECTIONS1: .section .text.main,"ax",@progbits
55 ; LINUX-SECTIONS1-LABEL: main:
56 ; LINUX-SECTIONS1-NOT: .section
57 ; LINUX-SECTIONS1-LABEL: .LBB0_4:
58 ; LINUX-SECTIONS1-NOT: .section
59 ; LINUX-SECTIONS1-LABEL: .LBB0_5:
60 ; LINUX-SECTIONS1-NOT: .section
61 ; LINUX-SECTIONS1-LABEL: .LBB0_6:
62 ; LINUX-SECTIONS1: .section .text.main,"ax",@progbits,unique,1
63 ; LINUX-SECTIONS1-LABEL: main.__part.0:
64 ; LINUX-SECTIONS1: .section .text.eh.main,"ax",@progbits
65 ; LINUX-SECTIONS1-LABEL: main.eh:
66 ; LINUX-SECTIONS1-NOT: .section
67 ; LINUX-SECTIONS1-LABEL: .LBB0_3:
68 ; LINUX-SECTIONS1-NOT: .section
69 ; LINUX-SECTIONS1: .section .text.main,"ax",@progbits
70 ; LINUX-SECTIONS1-LABEL: .Lfunc_end0
73 ; LINUX-SECTIONS2: .section .text.main,"ax",@progbits
74 ; LINUX-SECTIONS2-LABEL: main:
75 ; LINUX-SECTIONS2-NOT: .section
76 ; LINUX-SECTIONS2-LABEL: .LBB0_4:
77 ; LINUX-SECTIONS2-NOT: .section
78 ; LINUX-SECTIONS2-LABEL: .LBB0_5:
79 ; LINUX-SECTIONS2-NOT: .section
80 ; LINUX-SECTIONS2-LABEL: .LBB0_6:
81 ; LINUX-SECTIONS2: .section .text.main,"ax",@progbits,unique,1
82 ; LINUX-SECTIONS2-LABEL: main.__part.0:
83 ; LINUX-SECTIONS2-NOT: .section
84 ; LINUX-SECTIONS2-LABEL: .LBB0_2:
85 ; LINUX-SECTIONS2-NOT: .section
86 ; LINUX-SECTIONS2-LABEL: .LBB0_3:
87 ; LINUX-SECTIONS2: .section .text.main,"ax",@progbits
88 ; LINUX-SECTIONS2-LABEL: .Lfunc_end0