90 lines · plain
1; RUN: llc -mtriple=mipsel -mattr=mips16 -relocation-model=pic -O3 < %s | FileCheck %s -check-prefix=162 3;16: main:4;16-NEXT: [[TMP:.*]]:5;16-NEXT: $func_begin0 = [[TMP]]6;16-NEXT: .cfi_startproc7;16-NEXT: .cfi_personality8@.str = private unnamed_addr constant [7 x i8] c"hello\0A\00", align 19@_ZTIi = external constant ptr10@.str1 = private unnamed_addr constant [15 x i8] c"exception %i \0A\00", align 111 12define i32 @main() personality ptr @__gxx_personality_v0 {13entry:14 %retval = alloca i32, align 415 %exn.slot = alloca ptr16 %ehselector.slot = alloca i3217 %e = alloca i32, align 418 store i32 0, ptr %retval19 %call = call i32 (ptr, ...) @printf(ptr @.str)20 %exception = call ptr @__cxa_allocate_exception(i32 4) nounwind21 store i32 20, ptr %exception22 invoke void @__cxa_throw(ptr %exception, ptr @_ZTIi, ptr null) noreturn23 to label %unreachable unwind label %lpad24 25lpad: ; preds = %entry26 %0 = landingpad { ptr, i32 }27 catch ptr @_ZTIi28 %1 = extractvalue { ptr, i32 } %0, 029 store ptr %1, ptr %exn.slot30 %2 = extractvalue { ptr, i32 } %0, 131 store i32 %2, ptr %ehselector.slot32 br label %catch.dispatch33 34catch.dispatch: ; preds = %lpad35 %sel = load i32, ptr %ehselector.slot36 %3 = call i32 @llvm.eh.typeid.for(ptr @_ZTIi) nounwind37 %matches = icmp eq i32 %sel, %338 br i1 %matches, label %catch, label %eh.resume39 40catch: ; preds = %catch.dispatch41 %exn = load ptr, ptr %exn.slot42 %4 = call ptr @__cxa_begin_catch(ptr %exn) nounwind43 %exn.scalar = load i32, ptr %444 store i32 %exn.scalar, ptr %e, align 445 %5 = load i32, ptr %e, align 446 %call2 = invoke i32 (ptr, ...) @printf(ptr @.str1, i32 %5)47 to label %invoke.cont unwind label %lpad148 49invoke.cont: ; preds = %catch50 call void @__cxa_end_catch() nounwind51 br label %try.cont52 53try.cont: ; preds = %invoke.cont54 ret i32 055 56lpad1: ; preds = %catch57 %6 = landingpad { ptr, i32 }58 cleanup59 %7 = extractvalue { ptr, i32 } %6, 060 store ptr %7, ptr %exn.slot61 %8 = extractvalue { ptr, i32 } %6, 162 store i32 %8, ptr %ehselector.slot63 call void @__cxa_end_catch() nounwind64 br label %eh.resume65 66eh.resume: ; preds = %lpad1, %catch.dispatch67 %exn3 = load ptr, ptr %exn.slot68 %sel4 = load i32, ptr %ehselector.slot69 %lpad.val = insertvalue { ptr, i32 } undef, ptr %exn3, 070 %lpad.val5 = insertvalue { ptr, i32 } %lpad.val, i32 %sel4, 171 resume { ptr, i32 } %lpad.val572 73unreachable: ; preds = %entry74 unreachable75}76 77declare i32 @printf(ptr, ...)78 79declare ptr @__cxa_allocate_exception(i32)80 81declare i32 @__gxx_personality_v0(...)82 83declare void @__cxa_throw(ptr, ptr, ptr)84 85declare i32 @llvm.eh.typeid.for(ptr) nounwind readnone86 87declare ptr @__cxa_begin_catch(ptr)88 89declare void @__cxa_end_catch()90