Skip to content

Commit f860741

Browse files
committed
Update tests
1 parent f78678a commit f860741

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed

test/SILOptimizer/specialize.sil

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -614,3 +614,31 @@ bb3:
614614
%8 = tuple ()
615615
return %8 : $()
616616
}
617+
618+
struct YYY<T> {
619+
}
620+
621+
enum MyOptional<T> {
622+
case none
623+
case some(T)
624+
}
625+
626+
// Check that a specialization of a self-recursive function is produced
627+
// and it is not crashing the compiler.
628+
// CHECK-LABEL: sil shared @_T025testSelfRecursiveFunction4main10MyOptionalOyAB3YYYVyypGG_Tg5 : $@convention(thin) (MyOptional<YYY<Any>>) -> ()
629+
sil @testSelfRecursiveFunction : $@convention(thin) <T> (@in T) -> () {
630+
bb0(%0 : $*T):
631+
%2 = function_ref @testSelfRecursiveFunction : $@convention(thin) <τ_0_0> (@in τ_0_0) -> ()
632+
%3 = alloc_stack $MyOptional<YYY<Any>>
633+
inject_enum_addr %3 : $*MyOptional<YYY<Any>>, #MyOptional.none!enumelt
634+
%5 = tuple ()
635+
%6 = load %3 : $*MyOptional<YYY<Any>>
636+
%7 = alloc_stack $MyOptional<YYY<Any>>
637+
store %6 to %7 : $*MyOptional<YYY<Any>>
638+
%9 = apply %2<MyOptional<YYY<Any>>>(%7) : $@convention(thin) <τ_0_0> (@in τ_0_0) -> ()
639+
dealloc_stack %7 : $*MyOptional<YYY<Any>>
640+
dealloc_stack %3 : $*MyOptional<YYY<Any>>
641+
destroy_addr %0 : $*T
642+
%13 = tuple ()
643+
return %13 : $()
644+
} // end sil function 'testSelfRecursiveFunction'

validation-test/compiler_crashers/28736-anonymous-namespacesilverifier-require.swift renamed to validation-test/compiler_crashers_fixed/28736-anonymous-namespacesilverifier-require.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//
55
// See https://swift.org/LICENSE.txt for license information
66
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
7-
// RUN: not --crash %target-swift-frontend -primary-file %s -emit-ir -O
7+
// RUN: %target-swift-frontend -primary-file %s -emit-ir -O
88
// non-fuzz (@dusek)
99

1010
func f<T>(_ a:T)->Void{f(nil as[Any]?)}

0 commit comments

Comments
 (0)