Skip to content

Commit 1b887e5

Browse files
committed
Tests: Factor unavailable protocol conformance tests into separate file.
1 parent e23e158 commit 1b887e5

File tree

2 files changed

+26
-11
lines changed

2 files changed

+26
-11
lines changed

test/IRGen/unavailable_decl_optimization.swift

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -147,17 +147,6 @@ public class C<T> {
147147
deinit {}
148148
}
149149

150-
public protocol P {
151-
func requirement()
152-
}
153-
154-
@available(*, unavailable)
155-
extension S: P {
156-
// CHECK-NO-STRIP: s4Test1SV11requirementyyF
157-
// CHECK-STRIP-NOT: s4Test1SV11requirementyyF
158-
public func requirement() {}
159-
}
160-
161150
// MARK: -
162151

163152
// MARK: UnavailableEnum
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// RUN: %target-swift-frontend -parse-as-library -module-name Test -validate-tbd-against-ir=missing %s -emit-ir | %FileCheck %s --check-prefixes=CHECK,CHECK-NO-STRIP
2+
3+
// RUN: %target-swift-frontend -parse-as-library -module-name Test -validate-tbd-against-ir=missing -unavailable-decl-optimization=complete %s -emit-ir | %FileCheck %s --check-prefixes=CHECK,CHECK-STRIP
4+
5+
// CHECK-NO-STRIP: s4Test1SVAA1PAAMc
6+
// CHECK-STRIP-NOT: s4Test1SVAA1PAAMc
7+
8+
// CHECK-NO-STRIP: s4Test1SVAA1PAAWP
9+
// CHECK-STRIP-NOT: s4Test1SVAA1PAAWP
10+
11+
// CHECK-NO-STRIP: s4Test1PMp
12+
// CHECK-STRIP-NOT: s4Test1PMp
13+
14+
@available(*, unavailable)
15+
public protocol P {
16+
func requirement()
17+
}
18+
19+
public struct S {}
20+
21+
@available(*, unavailable)
22+
extension S: P {
23+
// CHECK-NO-STRIP: s4Test1SV11requirementyyF
24+
// CHECK-STRIP-NOT: s4Test1SV11requirementyyF
25+
public func requirement() {}
26+
}

0 commit comments

Comments
 (0)