brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.9 KiB · 77b4b27 Raw
89 lines · plain
1; BB cluster section test for exception handling.2;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' > %t17; RUN: echo '!!1 2' >> %t18; RUN: llc < %s -O0 -mtriple=x86_64-pc-linux -function-sections -basic-block-sections=%t1 | FileCheck %s -check-prefix=LINUX-SECTIONS19;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' > %t214; RUN: echo '!!1 2 3' >> %t215; RUN: llc < %s -O0 -mtriple=x86_64-pc-linux -function-sections -basic-block-sections=%t2 | FileCheck %s -check-prefix=LINUX-SECTIONS216 17@_ZTIi = external constant ptr18 19define i32 @main() uwtable optsize ssp personality ptr @__gxx_personality_v0 {20entry:21  invoke void @_Z1fv() optsize22          to label %try.cont unwind label %lpad123 24lpad1:25  %0 = landingpad { ptr, i32 }26          cleanup27          catch ptr @_ZTIi28  br label %eh.resume129 30try.cont:31  invoke void @_Z2fv() optsize32          to label %try.cont unwind label %lpad233  ret i32 034 35lpad2:36  %2 = landingpad { ptr, i32 }37          cleanup38          catch ptr @_ZTIi39  br label %eh.resume240 41eh.resume1:42  resume { ptr, i32 } %043 44eh.resume2:45  resume { ptr, i32 } %246}47 48declare void @_Z1fv() optsize49 50declare void @_Z2fv() optsize51 52declare i32 @__gxx_personality_v0(...)53 54; LINUX-SECTIONS1:		.section	.text.main,"ax",@progbits55; LINUX-SECTIONS1-LABEL:	main:56; LINUX-SECTIONS1-NOT: 		.section57; LINUX-SECTIONS1-LABEL:	.LBB0_4:58; LINUX-SECTIONS1-NOT: 		.section59; LINUX-SECTIONS1-LABEL:	.LBB0_5:60; LINUX-SECTIONS1-NOT: 		.section61; LINUX-SECTIONS1-LABEL:	.LBB0_6:62; LINUX-SECTIONS1: 		.section	.text.main,"ax",@progbits,unique,163; LINUX-SECTIONS1-LABEL:	main.__part.0:64; LINUX-SECTIONS1:		.section	.text.eh.main,"ax",@progbits65; LINUX-SECTIONS1-LABEL: 	main.eh:66; LINUX-SECTIONS1-NOT: 		.section67; LINUX-SECTIONS1-LABEL:	.LBB0_3:68; LINUX-SECTIONS1-NOT:		.section69; LINUX-SECTIONS1:		.section	.text.main,"ax",@progbits70; LINUX-SECTIONS1-LABEL: 	.Lfunc_end071 72 73; LINUX-SECTIONS2:		.section	.text.main,"ax",@progbits74; LINUX-SECTIONS2-LABEL:	main:75; LINUX-SECTIONS2-NOT: 		.section76; LINUX-SECTIONS2-LABEL:	.LBB0_4:77; LINUX-SECTIONS2-NOT: 		.section78; LINUX-SECTIONS2-LABEL:	.LBB0_5:79; LINUX-SECTIONS2-NOT: 		.section80; LINUX-SECTIONS2-LABEL:	.LBB0_6:81; LINUX-SECTIONS2: 		.section	.text.main,"ax",@progbits,unique,182; LINUX-SECTIONS2-LABEL: 	main.__part.0:83; LINUX-SECTIONS2-NOT: 		.section84; LINUX-SECTIONS2-LABEL:	.LBB0_2:85; LINUX-SECTIONS2-NOT: 		.section86; LINUX-SECTIONS2-LABEL:	.LBB0_3:87; LINUX-SECTIONS2:		.section	.text.main,"ax",@progbits88; LINUX-SECTIONS2-LABEL: 	.Lfunc_end089