Skip to content

Commit 44a9420

Browse files
committed
[Test] Add regression test.
For #70234 (comment) .
1 parent 675fda3 commit 44a9420

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

test/SILOptimizer/consume_operator_kills_copyable_loadable_vars.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -723,6 +723,12 @@ func consumeInitdArray() {
723723
_ = consume x
724724
}
725725

726+
func isNegative(_ c: consuming Int) -> Bool { return c < 0 }
727+
func consumeInt() {
728+
var g = 0 // expected-warning{{variable 'g' was never mutated; consider changing to 'let' constant}}
729+
isNegative(consume g) // expected-warning{{result of call to 'isNegative' is unused}}
730+
}
731+
726732
//////////////////////
727733
// Reinit in pieces //
728734
//////////////////////

0 commit comments

Comments
 (0)