File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change 1+ // RUN: %target-run-simple-swift(-Xfrontend -sil-verify-all) | %FileCheck %s
2+ // RUN: %target-run-simple-swift(-O -Xfrontend -sil-verify-all) | %FileCheck %s
3+
4+ // REQUIRES: executable_test
5+ // REQUIRES: foundation
6+
7+ import StdlibUnittest
8+ import Foundation
9+
10+ defer { runAllTests ( ) }
11+
12+ var Tests = TestSuite ( " MoveOnlyFoundationTests " )
13+
14+ // coverage for rdar://132915515
15+ // CHECK-LABEL: borrowing get on copyable type
16+ Tests . test ( " borrowing get on copyable type " ) {
17+ struct Loaner {
18+ let value : UUID
19+ var property : UUID { borrowing get { value } }
20+ borrowing func method( ) -> UUID { value }
21+ }
22+
23+ func printLoanedValue( _ loaner: borrowing Loaner ) {
24+ // CHECK: UUID = [[UUID_VAL:.*]]
25+ print ( " UUID = \( loaner. property) " )
26+
27+ // CHECK: UUID = [[UUID_VAL]]
28+ print ( " UUID = \( loaner. method ( ) ) " )
29+ }
30+
31+ do {
32+ let l = Loaner ( value: UUID ( ) )
33+ printLoanedValue ( l)
34+ }
35+ }
You can’t perform that action at this time.
0 commit comments