|
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 |
2 | 4 |
|
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 | +} |
5 | 32 |
|
6 |
| -// rdar://106164128 |
7 |
| -// REQUIRES: rdar106164128 |
8 | 33 |
|
9 |
| -// TODO: finish this test by verifying the interface with FileCheck |
|
0 commit comments