1
- // RUN: %target-sil-opt -loadable-address -enable-sil-verify-all %s | %FileCheck %s
1
+ // RUN: %target-sil-opt -assume-parsing-unqualified-ownership-sil - loadable-address -enable-sil-verify-all %s | %FileCheck %s
2
2
3
3
// REQUIRES: CPU=x86_64
4
4
// REQUIRES: OS=macosx
@@ -57,8 +57,8 @@ unwind:
57
57
// CHECK-NEXT: [[CORO:%.*]] = function_ref @test_yield_big : $@yield_once @convention(thin) () -> @yields @in_constant BigStruct
58
58
// CHECK-NEXT: ([[ADDR:%.*]], [[TOKEN:%.*]]) = begin_apply [[CORO]]()
59
59
// TODO: this isn't very efficient
60
- // CHECK-NEXT: [[T0:%.*]] = load [trivial] [ [ADDR]] : $*BigStruct
61
- // CHECK-NEXT: store [[T0]] to [trivial] [ [TEMP]] : $*BigStruct
60
+ // CHECK-NEXT: [[T0:%.*]] = load [[ADDR]] : $*BigStruct
61
+ // CHECK-NEXT: store [[T0]] to [[TEMP]] : $*BigStruct
62
62
// CHECK-NEXT: // function_ref
63
63
// CHECK-NEXT: [[USE:%.*]] = function_ref @use_big_struct : $@convention(thin) (@in_constant BigStruct) -> ()
64
64
// CHECK-NEXT: apply [[USE]]([[TEMP]])
@@ -76,3 +76,24 @@ entry:
76
76
%ret = tuple ()
77
77
return %ret : $()
78
78
}
79
+
80
+ sil @yield_fun_ptr2 : $@yield_once @convention(thin) () -> @yields @inout Optional<@callee_guaranteed (@guaranteed BigStruct) -> ()>
81
+
82
+ // CHECK-LABEL: sil @yield_funptr : $
83
+ // CHECK: (%1, %2) = begin_apply %0() : $@yield_once @convention(thin) () -> @yields @inout Optional<@callee_guaranteed (@in_guaranteed BigStruct) -> ()>
84
+ // CHECK: yield %1
85
+ sil @yield_funptr : $@yield_once @convention(thin) () -> @yields @inout Optional<@callee_guaranteed (@guaranteed BigStruct) -> ()> {
86
+ bb0:
87
+ %2 = function_ref @yield_fun_ptr2 : $@yield_once @convention(thin) () -> @yields @inout Optional<@callee_guaranteed (@guaranteed BigStruct) -> ()>
88
+ (%3, %4) = begin_apply %2() : $@yield_once @convention(thin) () -> @yields @inout Optional<@callee_guaranteed (@guaranteed BigStruct) -> ()>
89
+ yield %3 : $*Optional<@callee_guaranteed (@guaranteed BigStruct) -> ()>, resume bb1, unwind bb2
90
+
91
+ bb1:
92
+ end_apply %4
93
+ %7 = tuple ()
94
+ return %7 : $()
95
+
96
+ bb2:
97
+ abort_apply %4
98
+ unwind
99
+ }
0 commit comments