1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -S -passes=verify,iroutliner -ir-outlining-no-cost < %s | FileCheck %s
4 %swift.error = type opaque
6 define void @outlining_swifterror1(ptr swifterror %err) {
7 ; CHECK-LABEL: @outlining_swifterror1(
9 ; CHECK-NEXT: [[X:%.*]] = alloca i64, align 8
10 ; CHECK-NEXT: call void @outlined_ir_func_0(i64 5, ptr [[X]], ptr swifterror [[ERR:%.*]])
11 ; CHECK-NEXT: ret void
18 store ptr %x, ptr %err
22 define void @outlining_swifterror2(ptr swifterror %err) {
23 ; CHECK-LABEL: @outlining_swifterror2(
25 ; CHECK-NEXT: [[X:%.*]] = alloca i64, align 8
26 ; CHECK-NEXT: call void @outlined_ir_func_0(i64 3, ptr [[X]], ptr swifterror [[ERR:%.*]])
27 ; CHECK-NEXT: ret void
34 store ptr %x, ptr %err
38 ; CHECK: define internal void @outlined_ir_func_0(i64 [[ARG0:%.*]], ptr [[ARG1:%.*]], ptr swifterror [[ARG2:%.*]])
39 ; CHECK: entry_to_outline:
40 ; CHECK-NEXT: [[TMP0:%.*]] = mul i64 [[ARG0]], [[ARG0]]
41 ; CHECK-NEXT: [[TMP1:%.*]] = add i64 [[TMP0]], [[TMP0]]
42 ; CHECK-NEXT: store i64 [[TMP1]], ptr [[ARG1]], align 4
43 ; CHECK-NEXT: store ptr [[ARG1]], ptr [[ARG2]], align 8
44 ; CHECK-NEXT: br label %entry_after_outline.exitStub