Skip to content

Commit 35dbb3e

Browse files
committed
[move-function] Add a test to the copyable values test suite that I already added to the address test suites.
1 parent dd7aebf commit 35dbb3e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

test/SILOptimizer/move_function_kills_copyable_values.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,13 @@ public func errorLoopMultipleMove(_ x: __owned Klass) -> () { // expected-error
136136
}
137137
}
138138

139+
public func errorLoopMultipleMove1(_ x: __owned Klass) -> () { // expected-error {{'x' used after being moved}}
140+
for _ in 0..<1024 {
141+
let _ = _move(x) // expected-note {{move here}}
142+
// expected-note @-1 {{cyclic move here. move will occur multiple times in the loop}}
143+
}
144+
}
145+
139146
public func errorLoopMoveOfParameter(_ x: __owned Klass) -> () { // expected-error {{'x' used after being moved}}
140147
let _ = _move(x) // expected-note {{move here}}
141148
for _ in 0..<1024 {

0 commit comments

Comments
 (0)