182 lines · plain
1; RUN: llc -simplifycfg-require-and-preserve-domtree=1 < %s -mtriple=sparc -relocation-model=static | FileCheck -check-prefix=V8ABS %s2; RUN: llc -simplifycfg-require-and-preserve-domtree=1 < %s -mtriple=sparc -relocation-model=pic | FileCheck -check-prefix=V8PIC %s3; RUN: llc -simplifycfg-require-and-preserve-domtree=1 < %s -mtriple=sparcv9 -relocation-model=static | FileCheck -check-prefix=V9ABS %s4; RUN: llc -simplifycfg-require-and-preserve-domtree=1 < %s -mtriple=sparcv9 -relocation-model=pic | FileCheck -check-prefix=V9PIC %s5 6; RUN: llc -simplifycfg-require-and-preserve-domtree=1 < %s -mtriple=sparcv9 -relocation-model=static -filetype=obj | llvm-readobj -r - | FileCheck -check-prefix=V9ABS-REL %s7; RUN: llc -simplifycfg-require-and-preserve-domtree=1 < %s -mtriple=sparcv9 -relocation-model=pic -filetype=obj | llvm-readobj -r - | FileCheck -check-prefix=V9PIC-REL %s8 9%struct.__fundamental_type_info_pseudo = type { %struct.__type_info_pseudo }10%struct.__type_info_pseudo = type { ptr, ptr }11 12@_ZTIi = external constant %struct.__fundamental_type_info_pseudo13@_ZTIf = external constant %struct.__fundamental_type_info_pseudo14@.cst = private unnamed_addr constant [12 x i8] c"catched int\00", align 6415@.cst1 = private unnamed_addr constant [14 x i8] c"catched float\00", align 6416 17; V8ABS-LABEL: main:18; V8ABS: .cfi_startproc19; V8ABS: .cfi_personality 0, __gxx_personality_v020; V8ABS: .cfi_lsda 0,21; V8ABS: .cfi_def_cfa_register {{30|%fp}}22; V8ABS: .cfi_window_save23; V8ABS: .cfi_register %o7, %i724 25; V8ABS: call __cxa_throw26; V8ABS: call __cxa_throw27 28; V8ABS: call __cxa_begin_catch29; V8ABS: call __cxa_end_catch30 31; V8ABS: call __cxa_begin_catch32; V8ABS: call __cxa_end_catch33 34; V8ABS: .cfi_endproc35 36; V8PIC-LABEL: main:37; V8PIC: .cfi_startproc38; V8PIC: .cfi_personality 155, DW.ref.__gxx_personality_v039; V8PIC: .cfi_lsda 27,40; V8PIC: .cfi_def_cfa_register {{30|%fp}}41; V8PIC: .cfi_window_save42; V8PIC: .cfi_register %o7, %i743; V8PIC: .section .gcc_except_table44; V8PIC-NOT: .section45; V8PIC: .word %r_disp32(.L_ZTIi.DW.stub)46; V8PIC: .data47; V8PIC: .L_ZTIi.DW.stub:48; V8PIC-NEXT: .word _ZTIi49 50 51; V9ABS-LABEL: main:52; V9ABS: .cfi_startproc53; V9ABS: .cfi_personality 0, __gxx_personality_v054; V9ABS: .cfi_lsda 27,55; V9ABS: .cfi_def_cfa_register {{30|%fp}}56; V9ABS: .cfi_window_save57; V9ABS: .cfi_register %o7, %i758; V9ABS: .section .gcc_except_table59; V9ABS-NOT: .section60; V9ABS: .xword _ZTIi61 62; V9ABS-REL: .rela.gcc_except_table {63; V9ABS-REL-NEXT: 0x14 R_SPARC_64 _ZTIi 0x064; V9ABS-REL-NEXT: 0x1C R_SPARC_64 _ZTIf 0x065; V9ABS-REL-NEXT: }66; V9ABS-REL-NEXT: .rela.eh_frame {67; V9ABS-REL-NEXT: 0x13 R_SPARC_UA64 __gxx_personality_v0 0x068; V9ABS-REL-NEXT: 0x2C R_SPARC_DISP32 .text 0x069; V9ABS-REL-NEXT: 0x35 R_SPARC_DISP32 .gcc_except_table 0x070; V9ABS-REL-NEXT: }71 72; V9PIC-LABEL: main:73; V9PIC: .cfi_startproc74; V9PIC: .cfi_personality 155, DW.ref.__gxx_personality_v075; V9PIC: .cfi_lsda 27,76; V9PIC: .cfi_def_cfa_register {{30|%fp}}77; V9PIC: .cfi_window_save78; V9PIC: .cfi_register %o7, %i779; V9PIC: .section .gcc_except_table80; V9PIC-NOT: .section81; V9PIC: .word %r_disp32(.L_ZTIi.DW.stub)82; V9PIC: .data83; V9PIC: .L_ZTIi.DW.stub:84; V9PIC-NEXT: .xword _ZTIi85 86; V9PIC-REL: .rela.gcc_except_table {87; V9PIC-REL-NEXT: 0x14 R_SPARC_DISP32 .data 0x888; V9PIC-REL-NEXT: 0x18 R_SPARC_DISP32 .data 0x089; V9PIC-REL-NEXT: }90; V9PIC-REL-NEXT: .rela.data {91; V9PIC-REL: .rela.data.DW.ref.__gxx_personality_v0 {92; V9PIC-REL: .rela.eh_frame {93; V9PIC-REL-NEXT: 0x13 R_SPARC_DISP32 DW.ref.__gxx_personality_v0 0x094; V9PIC-REL-NEXT: 0x28 R_SPARC_DISP32 .text 0x095; V9PIC-REL-NEXT: 0x31 R_SPARC_DISP32 .gcc_except_table 0x096; V9PIC-REL-NEXT: }97 98define i32 @main(i32 %argc, ptr nocapture readnone %argv) unnamed_addr #0 personality ptr @__gxx_personality_v0 {99entry:100 %0 = icmp eq i32 %argc, 2101 %1 = tail call ptr @__cxa_allocate_exception(i32 4) #1102 br i1 %0, label %"3", label %"4"103 104"3": ; preds = %entry105 %2 = bitcast ptr %1 to ptr106 store i32 0, ptr %2, align 4107 invoke void @__cxa_throw(ptr %1, ptr @_ZTIi, ptr null) #2108 to label %3 unwind label %"8"109 110; <label>:3 ; preds = %"3"111 unreachable112 113"4": ; preds = %entry114 %4 = bitcast ptr %1 to ptr115 store float 1.000000e+00, ptr %4, align 4116 117 118 invoke void @__cxa_throw(ptr %1, ptr @_ZTIf, ptr null) #2119 to label %5 unwind label %"8"120 121; <label>:5 ; preds = %"4"122 unreachable123 124"5": ; preds = %"13", %"11"125 %6 = phi i32 [ 2, %"13" ], [ 0, %"11" ]126 ret i32 %6127 128"8": ; preds = %"4", %"3"129 %exc = landingpad { ptr, i32 }130 catch ptr @_ZTIi131 catch ptr @_ZTIf132 %exc_ptr12 = extractvalue { ptr, i32 } %exc, 0133 %filter13 = extractvalue { ptr, i32 } %exc, 1134 %typeid = tail call i32 @llvm.eh.typeid.for(ptr @_ZTIi)135 %7 = icmp eq i32 %filter13, %typeid136 br i1 %7, label %"11", label %8137 138; <label>:8 ; preds = %"8"139 %typeid8 = tail call i32 @llvm.eh.typeid.for(ptr @_ZTIf)140 %9 = icmp eq i32 %filter13, %typeid8141 br i1 %9, label %"13", label %"9"142 143"9": ; preds = %8144 resume { ptr, i32 } %exc145 146"11": ; preds = %"8"147 %10 = tail call ptr @__cxa_begin_catch(ptr %exc_ptr12) #1148 %11 = tail call i32 @puts(ptr @.cst)149 tail call void @__cxa_end_catch() #1150 br label %"5"151 152"13": ; preds = %8153 %12 = tail call ptr @__cxa_begin_catch(ptr %exc_ptr12) #1154 %13 = tail call i32 @puts(ptr @.cst1)155 tail call void @__cxa_end_catch() #1156 br label %"5"157}158 159; Function Attrs: nounwind160declare ptr @__cxa_allocate_exception(i32) #1161 162; Function Attrs: noreturn163declare void @__cxa_throw(ptr, ptr, ptr) #2164 165declare void @__cxa_end_catch()166 167; Function Attrs: nounwind readnone168declare i32 @llvm.eh.typeid.for(ptr) #3169 170; Function Attrs: nounwind171declare ptr @__cxa_begin_catch(ptr) #1172 173; Function Attrs: nounwind174declare i32 @puts(ptr nocapture readonly) #1175 176declare i32 @__gxx_personality_v0(i32, i64, ptr, ptr)177 178attributes #0 = { "frame-pointer"="none" }179attributes #1 = { nounwind }180attributes #2 = { noreturn }181attributes #3 = { nounwind readnone }182