Skip to content

Commit 99dec9f

Browse files
committed
Test: finish noncopyable accessor test
rdar://106164128
1 parent 6e35711 commit 99dec9f

File tree

2 files changed

+30
-19
lines changed

2 files changed

+30
-19
lines changed

test/ModuleInterface/Inputs/moveonly_simple.swift

Lines changed: 0 additions & 13 deletions
This file was deleted.

test/ModuleInterface/moveonly_interface.swift

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,33 @@
1-
// RUN: %empty-directory(%t)
1+
// RUN: %target-swift-emit-module-interface(%t.swiftinterface) %s -module-name test
2+
// RUN: %target-swift-typecheck-module-from-interface(%t.swiftinterface) -module-name test
3+
// RUN: %FileCheck --check-prefix INTERFACE %s < %t.swiftinterface
24

3-
// FIXME: should work without syntize accessors too
4-
// RUN: %target-swift-frontend -DSYNTHESIZE_ACCESSORS -enable-library-evolution -module-name Hello -emit-module -o %t/Hello.swiftmodule -emit-module-interface-path %t/Hello.swiftinterface %S/Inputs/moveonly_simple.swift
5+
// RUN: %target-swift-frontend -module-name test -emit-silgen %s -o %t.silgen
6+
// RUN: %FileCheck --check-prefix SILGEN %s < %t.silgen
7+
8+
public class Message { var s: String = "hello" }
9+
10+
public struct FileDescriptor: ~Copyable {
11+
public var x: Int = 0
12+
public var msg: Message = Message()
13+
}
14+
15+
public class FileHandle {
16+
// INTERFACE: public var _stored: test.FileDescriptor
17+
18+
// SILGEN: @_hasStorage @_hasInitialValue public var _stored: FileDescriptor { get set }
19+
public var _stored: FileDescriptor = FileDescriptor()
20+
21+
// INTERFACE: public var file: test.FileDescriptor {
22+
// INTERFACE-NEXT: _read
23+
// INTERFACE-NEXT: _modify
24+
// INTERFACE-NEXT: }
25+
26+
// SILGEN: public var file: FileDescriptor { _read _modify }
27+
public var file: FileDescriptor {
28+
_read { yield _stored }
29+
_modify { yield &_stored }
30+
}
31+
}
532

6-
// rdar://106164128
7-
// REQUIRES: rdar106164128
833

9-
// TODO: finish this test by verifying the interface with FileCheck

0 commit comments

Comments
 (0)