Skip to content

Commit f4258dd

Browse files
committed
[embedded] expand description and checks in availability-code-removal.swift
1 parent 9a38021 commit f4258dd

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed
Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
1-
// RUN: %target-swift-frontend -emit-ir %s -parse-stdlib -enable-experimental-feature Embedded
1+
// This test is checking that usage of an existential (which is normally
2+
// disallowed in embedded Swift and flagged in IRGen) is left undiagnosed
3+
// because the context is @_unavailableInEmbedded.
4+
//
5+
// The breakdown of that is
6+
// - (1) @_unavailableInEmbedded makes the declaration unavailable,
7+
// - (2) unavailable function bodies is removed in embedded Swift,
8+
// - (3) the test() function is not reported by the existential checker.
9+
10+
// RUN: %target-swift-frontend -emit-ir %s -parse-stdlib | %FileCheck %s --check-prefix CHECK-A
11+
// RUN: %target-swift-frontend -emit-ir %s -parse-stdlib -enable-experimental-feature Embedded | %FileCheck %s --check-prefix CHECK-B
212

313
public protocol Player {}
414
struct Concrete: Player {}
@@ -7,3 +17,6 @@ struct Concrete: Player {}
717
public func test() -> any Player {
818
Concrete() // no error because we're in unavailable-in-embedded context
919
}
20+
21+
// CHECK-A: $s4main4testAA6Player_pyF
22+
// CHECK-B-NOT: $s4main4testAA6Player_pyF

0 commit comments

Comments
 (0)