File tree Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change 1+ // RUN: %empty-directory(%t)
2+ // RUN: %target-swift-frontend %s -Onone -parse-as-library -enable-experimental-feature Embedded -c -o %t/main.o
3+ // RUN: %target-clang %target-clang-resource-dir-opt %t/main.o -o %t/a.out -dead_strip
4+ // RUN: %target-run %t/a.out | %FileCheck %s
5+
6+ // REQUIRES: swift_in_compiler
7+ // REQUIRES: executable_test
8+ // REQUIRES: optimized_stdlib
9+ // REQUIRES: swift_feature_Embedded
10+
11+ public class C {
12+ public var x : Int {
13+ _read {
14+ yield( y)
15+ }
16+ _modify {
17+ yield( & y)
18+ }
19+ }
20+
21+ var y : Int = 27
22+ }
23+
24+ @main
25+ struct Main {
26+ static func main( ) {
27+ print ( " 1 " ) // CHECK: 1
28+ let c = C ( ) // CHECK: 27
29+ print ( c. y)
30+ c. y = 28
31+ print ( c. y) // CHECK: 28
32+ print ( " " )
33+
34+ print ( " 2 " ) // CHECK: 2
35+ print ( " " )
36+ }
37+ }
You can’t perform that action at this time.
0 commit comments