Skip to content

Commit 208ef65

Browse files
committed
Add a test
1 parent 0aff7c0 commit 208ef65

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// RUN: %target-swift-frontend -O -sil-inline-threshold 0 -emit-sil -primary-file %s | %FileCheck %s
2+
3+
// rdar://problem/31910351
4+
5+
// Check that swift compiler does not crash on this input.
6+
7+
public protocol P {
8+
func use<T:AnyObject>(_ t: T)
9+
}
10+
11+
public class C<T> {
12+
}
13+
14+
public func callee(_ t: C<Int32>?, _ p: P) {
15+
// This call results in a creation of a specialized conformance of C<Int32> to AnyObject.
16+
p.use(t!)
17+
}
18+
19+
// CHECK-LABEL: sil @_T033specialized_anyobject_conformance7caller1yAA1P_p1p_tF : $@convention(thin) (@in P) -> ()
20+
public func caller1(p: P) {
21+
callee(C<Int32>(), p)
22+
}
23+

0 commit comments

Comments
 (0)