Skip to content

Commit 8a8de81

Browse files
committed
Add crashing test
Adding test to crash SIL optimizer while lowering hops to executors.
1 parent 2ee56f8 commit 8a8de81

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

test/SILOptimizer/lower_hop_to_actor.sil

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,3 +221,22 @@ bb0(%0 : @guaranteed $CustomActor):
221221
%r = tuple ()
222222
return %r : $()
223223
}
224+
225+
sil @get_raw_executor : $@convention(thin) () -> Builtin.Executor
226+
227+
// CHECK-LABEL: sil [ossa] @non_optional_executor :
228+
sil [ossa] @non_optional_executor : $@async () -> () {
229+
bb0:
230+
// CHECK: bb0:
231+
// CHECK: [[GET_RAW_EXECUTOR:%.*]] = function_ref @get_raw_executor
232+
// CHECK-NEXT: [[EXECUTOR:%.*]] = apply [[GET_RAW_EXECUTOR]]()
233+
// CHECK-NEXT: [[SOME:%.*]] = enum $Optional<Builtin.Executor>, #Optional.some!enumelt, [[EXECUTOR]] : $Builtin.Executor
234+
// CHECK-NEXT: hop_to_executor [[SOME]] : $Optional<Builtin.Executor>
235+
// CHECK-NEXT: [[RET:%.*]] = tuple ()
236+
// CHECK-NEXT: return [[RET]] : $()
237+
%0 = function_ref @get_raw_executor : $@convention(thin) () -> Builtin.Executor
238+
%1 = apply %0() : $@convention(thin) () -> Builtin.Executor
239+
hop_to_executor %1 : $Builtin.Executor
240+
%r = tuple ()
241+
return %r : $()
242+
}

0 commit comments

Comments
 (0)