1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -S -verify -iroutliner -ir-outlining-no-cost < %s | FileCheck %s
4 ; This test checks that invoke instructions are not outlined even if they
5 ; in a similar section. Outlining does not currently handle control flow
8 declare void @llvm.donothing() nounwind readnone
10 define void @function1() personality i8 3 {
11 ; CHECK-LABEL: @function1(
13 ; CHECK-NEXT: [[A:%.*]] = alloca i32, align 4
14 ; CHECK-NEXT: [[B:%.*]] = alloca i32, align 4
15 ; CHECK-NEXT: call void @outlined_ir_func_0(i32* [[A]], i32* [[B]])
16 ; CHECK-NEXT: invoke void @llvm.donothing()
17 ; CHECK-NEXT: to label [[NORMAL:%.*]] unwind label [[EXCEPTION:%.*]]
19 ; CHECK-NEXT: [[CLEANUP:%.*]] = landingpad i8
21 ; CHECK-NEXT: br label [[NORMAL]]
23 ; CHECK-NEXT: ret void
26 %a = alloca i32, align 4
27 %b = alloca i32, align 4
28 store i32 2, i32* %a, align 4
29 store i32 3, i32* %b, align 4
30 invoke void @llvm.donothing() to label %normal unwind label %exception
32 %cleanup = landingpad i8 cleanup
38 define void @function2() personality i8 3 {
39 ; CHECK-LABEL: @function2(
41 ; CHECK-NEXT: [[A:%.*]] = alloca i32, align 4
42 ; CHECK-NEXT: [[B:%.*]] = alloca i32, align 4
43 ; CHECK-NEXT: call void @outlined_ir_func_0(i32* [[A]], i32* [[B]])
44 ; CHECK-NEXT: invoke void @llvm.donothing()
45 ; CHECK-NEXT: to label [[NORMAL:%.*]] unwind label [[EXCEPTION:%.*]]
47 ; CHECK-NEXT: [[CLEANUP:%.*]] = landingpad i8
49 ; CHECK-NEXT: br label [[NORMAL]]
51 ; CHECK-NEXT: ret void
54 %a = alloca i32, align 4
55 %b = alloca i32, align 4
56 store i32 2, i32* %a, align 4
57 store i32 3, i32* %b, align 4
58 invoke void @llvm.donothing() to label %normal unwind label %exception
60 %cleanup = landingpad i8 cleanup