1
1
// RUN: %target-swift-frontend -primary-file %s -emit-ir | %FileCheck %s
2
+ // RUN: %target-swift-frontend -primary-file %s -emit-ir -enable-resilience | %FileCheck %s --check-prefix=RESILIENT
2
3
3
4
// Test if all methods which go into a vtable have at least the visibility of its class.
4
5
// Reason: Derived classes from "outside" still have to put the less visible base members
17
18
18
19
class Base {
19
20
// CHECK: define hidden swiftcc void @"$s14method_linkage4Base{{.*}}3foo0
21
+ // RESILIENT: define hidden swiftcc void @"$s14method_linkage4Base{{.*}}3foo0
20
22
@inline ( never)
21
23
fileprivate func foo( ) {
22
24
}
23
25
24
26
// CHECK: define internal swiftcc void @"$s14method_linkage4Base{{.*}}3bar0
27
+ // RESILIENT: define internal swiftcc void @"$s14method_linkage4Base{{.*}}3bar0
25
28
@inline ( never)
26
29
fileprivate final func bar( ) {
27
30
}
28
31
29
32
// CHECK: define hidden swiftcc void @"$s14method_linkage4Base{{.*}}5other0
33
+ // RESILIENT: define hidden swiftcc void @"$s14method_linkage4Base{{.*}}5other0
30
34
@inline ( never)
31
35
fileprivate func other( ) {
32
36
}
33
37
}
34
38
class Derived : Base {
35
39
// CHECK: define internal swiftcc void @"$s14method_linkage7Derived{{.*}}3foo0
40
+ // RESILIENT: define internal swiftcc void @"$s14method_linkage7Derived{{.*}}3foo0
36
41
@inline ( never)
37
42
fileprivate final override func foo( ) {
38
43
}
39
44
}
40
45
41
46
extension Base {
42
47
// CHECK: define internal swiftcc void @"$s14method_linkage4Base{{.*}}7extfunc0
48
+ // RESILIENT: define internal swiftcc void @"$s14method_linkage4Base{{.*}}7extfunc0
43
49
@inline ( never)
44
50
fileprivate func extfunc( ) {
45
51
}
@@ -49,11 +55,13 @@ public class PublicClass {
49
55
internal init ( ) { }
50
56
51
57
// CHECK: define hidden swiftcc void @"$s14method_linkage11PublicClass{{.*}}4pfoo0
58
+ // RESILIENT: define hidden swiftcc void @"$s14method_linkage11PublicClass{{.*}}4pfoo0
52
59
@inline ( never)
53
60
fileprivate func pfoo( ) {
54
61
}
55
62
56
63
// CHECK: define hidden swiftcc void @"$s14method_linkage11PublicClassC4pbaryyF
64
+ // RESILIENT: define hidden swiftcc void @"$s14method_linkage11PublicClassC4pbaryyF
57
65
@inline ( never)
58
66
internal func pbar( ) {
59
67
}
@@ -63,11 +71,13 @@ open class OpenClass {
63
71
internal init ( ) { }
64
72
65
73
// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s14method_linkage9OpenClassC4pfoo0
74
+ // RESILIENT: define hidden swiftcc void @"$s14method_linkage9OpenClassC4pfoo0
66
75
@inline ( never)
67
76
fileprivate func pfoo( ) {
68
77
}
69
78
70
79
// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s14method_linkage9OpenClassC4pbaryyF
80
+ // RESILIENT: define hidden swiftcc void @"$s14method_linkage9OpenClassC4pbaryyF
71
81
@inline ( never)
72
82
internal func pbar( ) {
73
83
}
0 commit comments