-
Notifications
You must be signed in to change notification settings - Fork 10.4k
/
Copy pathrdar40899824.swift
38 lines (27 loc) · 1.01 KB
/
rdar40899824.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// RUN: %empty-directory(%t)
// RUN: %target-build-swift %s -emit-module -o %t/Library.swiftmodule -I %S/Inputs/custom-modules -DLIBRARY -Xfrontend -enable-objc-interop -Xfrontend -disable-objc-attr-requires-foundation-module
// RUN: %target-swift-frontend %s -I %t -I %S/Inputs/custom-modules -enable-objc-interop -emit-ir > /dev/null
// RUN: %target-swift-frontend %s -I %t -I %S/Inputs/custom-modules -enable-objc-interop -emit-ir -Xcc -DBAD > /dev/null
// RUN: %target-swift-frontend %s -I %t -I %S/Inputs/custom-modules -enable-objc-interop -emit-ir -Xcc -DBAD -O > /dev/null
#if LIBRARY
import rdar40899824Helper
public protocol Proto: class {
func use(_: SoonToBeMissing)
func unrelated()
}
extension Impl: Proto {}
#else // LIBRARY
import Library
import rdar40899824Helper
func testGeneric<T: Proto>(_ obj: T) {
obj.unrelated()
}
func testExistential(_ obj: Proto) {
obj.unrelated()
}
func test(_ proto: Proto, _ impl: Impl) {
impl.unrelated()
testGeneric(impl)
testExistential(impl)
}
#endif // LIBRARY