@@ -491,23 +491,23 @@ bb0(%0 : @owned $Parent, %1 : $*Builtin.Int32):
491
491
// CHECK: PAIR #8.
492
492
// CHECK-NEXT: %{{.*}} = begin_access [modify] [static] %0 : $*Builtin.Int32
493
493
// CHECK-NEXT: %0 = argument of bb0 : $*Builtin.Int32
494
- // CHECK-NEXT: r=0 ,w=1
494
+ // CHECK-NEXT: r=1 ,w=1
495
495
// CHECK: PAIR #9.
496
496
// CHECK-NEXT: %{{.*}} = begin_access [modify] [static] %0 : $*Builtin.Int32
497
497
// CHECK-NEXT: %{{.*}} = begin_access [read] [static] %0 : $*Builtin.Int32
498
- // CHECK-NEXT: r=0 ,w=1
498
+ // CHECK-NEXT: r=1 ,w=1
499
499
// CHECK: PAIR #13.
500
500
// CHECK-NEXT: end_access %{{.*}} : $*Builtin.Int32
501
501
// CHECK-NEXT: %0 = argument of bb0 : $*Builtin.Int32
502
- // CHECK-NEXT: r=0 ,w=1
502
+ // CHECK-NEXT: r=1 ,w=1
503
503
// CHECK: PAIR #14.
504
504
// CHECK-NEXT: end_access %{{.*}} : $*Builtin.Int32
505
505
// CHECK-NEXT: %{{.*}} = begin_access [read] [static] %0 : $*Builtin.Int32
506
- // CHECK-NEXT: r=0 ,w=1
506
+ // CHECK-NEXT: r=1 ,w=1
507
507
// CHECK: PAIR #15.
508
508
// CHECK-NEXT: end_access %{{.*}} : $*Builtin.Int32
509
509
// CHECK-NEXT: %{{.*}} = begin_access [modify] [static] %0 : $*Builtin.Int32
510
- // CHECK-NEXT: r=0 ,w=1
510
+ // CHECK-NEXT: r=1 ,w=1
511
511
sil [ossa] @testReadWriteAccess : $@convention(thin) (@inout Builtin.Int32) -> Builtin.Int32 {
512
512
bb0(%0 : $*Builtin.Int32):
513
513
%read = begin_access [read] [static] %0 : $*Builtin.Int32
@@ -520,6 +520,42 @@ bb0(%0 : $*Builtin.Int32):
520
520
return %val : $Builtin.Int32
521
521
}
522
522
523
+ // CHECK-LABEL: @testDeinitAccess
524
+ // CHECK: PAIR #0.
525
+ // CHECK-NEXT: %1 = begin_access [deinit] [static] %0 : $*Builtin.Int32
526
+ // CHECK-NEXT: %0 = argument of bb0 : $*Builtin.Int32
527
+ // CHECK-NEXT: r=1,w=1
528
+ // CHECK: PAIR #1.
529
+ // CHECK-NEXT: end_access %1 : $*Builtin.Int32
530
+ // CHECK-NEXT: %0 = argument of bb0 : $*Builtin.Int32
531
+ // CHECK-NEXT: r=1,w=1
532
+ sil [ossa] @testDeinitAccess : $@convention(thin) (@in Builtin.Int32) -> () {
533
+ bb0(%0 : $*Builtin.Int32):
534
+ %1 = begin_access [deinit] [static] %0 : $*Builtin.Int32
535
+ end_access %1 : $*Builtin.Int32
536
+ %r = tuple ()
537
+ return %r : $()
538
+ }
539
+
540
+ // CHECK-LABEL: @testInitAccess
541
+ // CHECK: PAIR #0.
542
+ // CHECK-NEXT: %{{.*}} = begin_access [init] [static] %0 : $*Builtin.Int32
543
+ // CHECK-NEXT: %0 = argument of bb0 : $*Builtin.Int32
544
+ // CHECK-NEXT: r=0,w=1
545
+ // CHECK: PAIR #3.
546
+ // CHECK-NEXT: end_access %{{.*}} : $*Builtin.Int32
547
+ // CHECK-NEXT: %0 = argument of bb0 : $*Builtin.Int32
548
+ // CHECK-NEXT: r=0,w=1
549
+ sil [ossa] @testInitAccess : $@convention(thin) (Builtin.Int32) -> @out Builtin.Int32 {
550
+ bb0(%0 : $*Builtin.Int32, %1 : $Builtin.Int32):
551
+ %init = begin_access [init] [static] %0 : $*Builtin.Int32
552
+ store %1 to [trivial] %init : $*Builtin.Int32
553
+ end_access %init : $*Builtin.Int32
554
+ %val = load [trivial] %0 : $*Builtin.Int32
555
+ %r = tuple ()
556
+ return %r : $()
557
+ }
558
+
523
559
// CHECK-LABEL: @testLoadTake
524
560
// CHECK: PAIR #0.
525
561
// CHECK-NEXT: %2 = load [take] %0 : $*C
@@ -572,7 +608,7 @@ struct Int64Wrapper {
572
608
// CHECK: PAIR #2.
573
609
// CHECK: %1 = begin_access [modify] [static] %0 : $*Int64Wrapper // users: %7, %2
574
610
// CHECK: %3 = begin_access [read] [static] %2 : $*Int64 // users: %6, %4
575
- // CHECK: r=0 ,w=1
611
+ // CHECK: r=1 ,w=1
576
612
// CHECK: PAIR #3.
577
613
sil @testNestedAccessWithInterposedProjection : $@convention(thin) (@inout Int64Wrapper) -> () {
578
614
bb0(%0 : $*Int64Wrapper):
0 commit comments