brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.1 KiB · 5d70d55 Raw
65 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 landingpad 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:    [[CLEANUP:%.*]] = landingpad i819; CHECK-NEXT:    cleanup20; CHECK-NEXT:    call void @outlined_ir_func_0(ptr [[A]], ptr [[B]])21; CHECK-NEXT:    br label [[NORMAL]]22; CHECK:       normal:23; CHECK-NEXT:    ret void24;25entry:26  %a = alloca i32, align 427  %b = alloca i32, align 428  invoke void @llvm.donothing() to label %normal unwind label %exception29exception:30  %cleanup = landingpad i8 cleanup31  store i32 2, ptr %a, align 432  store i32 3, ptr %b, align 433  br label %normal34normal:35  ret void36}37 38define void @function2() personality i8 3 {39; CHECK-LABEL: @function2(40; CHECK-NEXT:  entry:41; CHECK-NEXT:    [[A:%.*]] = alloca i32, align 442; CHECK-NEXT:    [[B:%.*]] = alloca i32, align 443; CHECK-NEXT:    invoke void @llvm.donothing()44; CHECK-NEXT:    to label [[NORMAL:%.*]] unwind label [[EXCEPTION:%.*]]45; CHECK:       exception:46; CHECK-NEXT:    [[CLEANUP:%.*]] = landingpad i847; CHECK-NEXT:    cleanup48; CHECK-NEXT:    call void @outlined_ir_func_0(ptr [[A]], ptr [[B]])49; CHECK-NEXT:    br label [[NORMAL]]50; CHECK:       normal:51; CHECK-NEXT:    ret void52;53entry:54  %a = alloca i32, align 455  %b = alloca i32, align 456  invoke void @llvm.donothing() to label %normal unwind label %exception57exception:58  %cleanup = landingpad i8 cleanup59  store i32 2, ptr %a, align 460  store i32 3, ptr %b, align 461  br label %normal62normal:63  ret void64}65