71 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py2; RUN: opt -S -passes=verify,iroutliner -no-ir-sim-branch-matching -ir-outlining-no-cost < %s | FileCheck %s3 4; This test checks that catchpad instructions are not outlined even if they5; in a similar section. Dealing with exception handling inside of an outlined6; function would require a lot of handling that is not implemented yet.7 8declare void @llvm.donothing() nounwind readnone9 10define void @function1() personality i8 3 {11; CHECK-LABEL: @function1(12; CHECK-NEXT: entry:13; CHECK-NEXT: [[A:%.*]] = alloca i32, align 414; CHECK-NEXT: [[B:%.*]] = alloca i32, align 415; CHECK-NEXT: invoke void @llvm.donothing()16; CHECK-NEXT: to label [[NORMAL:%.*]] unwind label [[EXCEPTION:%.*]]17; CHECK: exception:18; CHECK-NEXT: [[CS1:%.*]] = catchswitch within none [label %catchpad1] unwind to caller19; CHECK: catchpad1:20; CHECK-NEXT: [[TMP0:%.*]] = catchpad within [[CS1]] []21; CHECK-NEXT: call void @outlined_ir_func_0(ptr [[A]], ptr [[B]])22; CHECK-NEXT: br label [[NORMAL]]23; CHECK: normal:24; CHECK-NEXT: ret void25;26entry:27 %a = alloca i32, align 428 %b = alloca i32, align 429 invoke void @llvm.donothing() to label %normal unwind label %exception30exception:31 %cs1 = catchswitch within none [label %catchpad1] unwind to caller32catchpad1:33 catchpad within %cs1 []34 store i32 2, ptr %a, align 435 store i32 3, ptr %b, align 436 br label %normal37normal:38 ret void39}40 41define void @function2() personality i8 3 {42; CHECK-LABEL: @function2(43; CHECK-NEXT: entry:44; CHECK-NEXT: [[A:%.*]] = alloca i32, align 445; CHECK-NEXT: [[B:%.*]] = alloca i32, align 446; CHECK-NEXT: invoke void @llvm.donothing()47; CHECK-NEXT: to label [[NORMAL:%.*]] unwind label [[EXCEPTION:%.*]]48; CHECK: exception:49; CHECK-NEXT: [[CS1:%.*]] = catchswitch within none [label %catchpad1] unwind to caller50; CHECK: catchpad1:51; CHECK-NEXT: [[TMP0:%.*]] = catchpad within [[CS1]] []52; CHECK-NEXT: call void @outlined_ir_func_0(ptr [[A]], ptr [[B]])53; CHECK-NEXT: br label [[NORMAL]]54; CHECK: normal:55; CHECK-NEXT: ret void56;57entry:58 %a = alloca i32, align 459 %b = alloca i32, align 460 invoke void @llvm.donothing() to label %normal unwind label %exception61exception:62 %cs1 = catchswitch within none [label %catchpad1] unwind to caller63catchpad1:64 catchpad within %cs1 []65 store i32 2, ptr %a, align 466 store i32 3, ptr %b, align 467 br label %normal68normal:69 ret void70}71