Skip to content

Commit 6a52cfd

Browse files
committed
Cleanup test case comments.
1 parent e04e7ce commit 6a52cfd

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

test/SILOptimizer/access_enforcement_noescape.swift

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@
88
// Each FIXME line is a case that the current implementation misses.
99
// The model is currently being refined, so this isn't set in stone.
1010
//
11-
// TODO: Ensure that each of these cases is covered by
11+
// TODO: Move all static cases (search for // Error:) into
12+
// a set of -verify tests (noescape_static_diagnostics.swift).
13+
// and a set of separate SILGen-only tests to check [unknown] markers.
14+
//
15+
// TODO: Ensure that each dynamic case is covered by
1216
// Interpreter/enforce_exclusive_access.swift.
1317

1418
// Helper
@@ -22,12 +26,6 @@ func doTwo(_: ()->(), _: ()->()) {}
2226
// Helper
2327
func doOneInout(_: ()->(), _: inout Int) {}
2428

25-
// Helper
26-
struct Frob {
27-
mutating func outerMut() { doOne { innerMut() } }
28-
mutating func innerMut() {}
29-
}
30-
3129
// FIXME: statically prohibit a call to a non-escaping closure
3230
// parameter using another non-escaping closure parameter as an argument.
3331
func reentrantNoescape(fn: (() -> ()) -> ()) {
@@ -40,6 +38,12 @@ func reentrantNoescape(fn: (() -> ()) -> ()) {
4038
// fn(c)
4139
// }
4240

41+
// Helper
42+
struct Frob {
43+
mutating func outerMut() { doOne { innerMut() } }
44+
mutating func innerMut() {}
45+
}
46+
4347
// Allow nested mutable access via closures.
4448
func nestedNoEscape(f: inout Frob) {
4549
doOne { f.outerMut() }
@@ -296,7 +300,7 @@ func readWriteBox() {
296300
// doTwo({ _ = x }, c)
297301
// }
298302

299-
// Error on noescape read + write inout.
303+
// Error: noescape read + write inout.
300304
func readWriteInout() {
301305
var x = 3
302306
// Around the call: [read] [dynamic]
@@ -321,7 +325,7 @@ func readWriteInout() {
321325
// FIXME-CHECK: end_access [[ACCESS]]
322326
// CHECK-LABEL: } // end sil function '_T027access_enforcement_noescape14readWriteInoutyyFyycfU_'
323327

324-
// Error on noescape read + write inout of an inout.
328+
// Error: noescape read + write inout of an inout.
325329
func inoutReadWriteInout(x: inout Int) {
326330
// Around the call: [read] [static]
327331
// Around the call: [modify] [static] // Error
@@ -345,7 +349,7 @@ func inoutReadWriteInout(x: inout Int) {
345349
// FIXME-CHECK: end_access [[ACCESS]]
346350
// CHECK-LABEL: } // end sil function '_T027access_enforcement_noescape19inoutReadWriteInoutySiz1x_tFyycfU_'
347351

348-
// Error: cannout capture inout.
352+
// Trap on boxed read + write inout.
349353
func readBoxWriteInout() {
350354
var x = 3
351355
let c = { _ = x }
@@ -478,7 +482,7 @@ func writeWriteBox() {
478482
// doTwo({ x = 42 }, c)
479483
// }
480484

481-
/// Error on noescape write + write inout.
485+
/// Error: on noescape write + write inout.
482486
func writeWriteInout() {
483487
var x = 3
484488
// Around the call: [modify] [dynamic]
@@ -502,7 +506,7 @@ func writeWriteInout() {
502506
// FIXME-CHECK: end_access [[ACCESS]]
503507
// CHECK-LABEL: } // end sil function '_T027access_enforcement_noescape15writeWriteInoutyyFyycfU_'
504508

505-
// Error on noescape write + write inout.
509+
// Error: on noescape write + write inout.
506510
func inoutWriteWriteInout(x: inout Int) {
507511
// Around the call: [modify] [static]
508512
// Around the call: [modify] [static] // Error

0 commit comments

Comments
 (0)