brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.1 KiB · b9eeba9 Raw
63 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 cleanuppad 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:    [[CLEAN:%.*]] = cleanuppad within none []19; CHECK-NEXT:    call void @outlined_ir_func_0(ptr [[A]], ptr [[B]])20; CHECK-NEXT:    br label [[NORMAL]]21; CHECK:       normal:22; CHECK-NEXT:    ret void23;24entry:25  %a = alloca i32, align 426  %b = alloca i32, align 427  invoke void @llvm.donothing() to label %normal unwind label %exception28exception:29  %clean = cleanuppad within none []30  store i32 2, ptr %a, align 431  store i32 3, ptr %b, align 432  br label %normal33normal:34  ret void35}36 37define void @function2() personality i8 3 {38; CHECK-LABEL: @function2(39; CHECK-NEXT:  entry:40; CHECK-NEXT:    [[A:%.*]] = alloca i32, align 441; CHECK-NEXT:    [[B:%.*]] = alloca i32, align 442; CHECK-NEXT:    invoke void @llvm.donothing()43; CHECK-NEXT:    to label [[NORMAL:%.*]] unwind label [[EXCEPTION:%.*]]44; CHECK:       exception:45; CHECK-NEXT:    [[CLEAN:%.*]] = cleanuppad within none []46; CHECK-NEXT:    call void @outlined_ir_func_0(ptr [[A]], ptr [[B]])47; CHECK-NEXT:    br label [[NORMAL]]48; CHECK:       normal:49; CHECK-NEXT:    ret void50;51entry:52  %a = alloca i32, align 453  %b = alloca i32, align 454  invoke void @llvm.donothing() to label %normal unwind label %exception55exception:56  %clean = cleanuppad within none []57  store i32 2, ptr %a, align 458  store i32 3, ptr %b, align 459  br label %normal60normal:61  ret void62}63