File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -692,3 +692,37 @@ bb0(%0 : $*T):
692
692
%13 = tuple ()
693
693
return %13 : $()
694
694
} // end sil function 'testSelfRecursiveFunction'
695
+
696
+ sil @id : $@convention(thin) <T> (@in T) -> @out T {
697
+ bb0(%0 : $*T, %1 :$*T):
698
+ copy_addr [take] %1 to [initialization] %0 : $*T
699
+ %t = tuple ()
700
+ return %t : $()
701
+ }
702
+
703
+ // This should not assert.
704
+ // CHECK-LABEL: sil shared @$s26specialize_no_return_applys5NeverO_Tg5
705
+ // CHECK: apply
706
+ // CHECK-NEXT: unreachable
707
+
708
+ sil @specialize_no_return_apply: $@convention(thin) <T> (@thick T.Type) -> () {
709
+ bb0(%0 : $@thick T.Type):
710
+ %in = alloc_stack $T
711
+ %out = alloc_stack $T
712
+ %f = function_ref @id : $@convention(thin) <T> (@in T) -> @out T
713
+ %r = apply %f<T>(%out, %in) : $@convention(thin) <T> (@in T) -> @out T
714
+ dealloc_stack %out : $*T
715
+ dealloc_stack %in : $*T
716
+ %t = tuple ()
717
+ return %t : $()
718
+ }
719
+
720
+ sil @test_specialize_noreturn_apply : $@convention(thin) () -> () {
721
+ bb0:
722
+ %f = function_ref @specialize_no_return_apply : $@convention(thin) <T> (@thick T.Type) -> ()
723
+ %m = metatype $@thick Never.Type
724
+ %r = apply %f<Never>(%m) : $@convention(thin) <T> (@thick T.Type) -> ()
725
+ %t = tuple ()
726
+ return %t : $()
727
+
728
+ }
You can’t perform that action at this time.
0 commit comments