Skip to content

Commit 677424b

Browse files
authored
Merge pull request swiftlang#35315 from atrick/fix-settestlifetime
Add a _fixLifetime to stdlib/Set.swift test.
2 parents f601a6c + 0aa91f4 commit 677424b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

validation-test/stdlib/Set.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3242,6 +3242,11 @@ SetTestSuite.test("formSymmetricDifference")
32423242

32433243
// Removing all elements should cause an identity change
32443244
expectNotEqual(identity1, s1._rawIdentifier())
3245+
3246+
// Without a fixLifetime here, the (non-ObjC) optimizer destroys
3247+
// 's1' after its last uses and recycles the storage so the identity
3248+
// check above fails.
3249+
_fixLifetime(s1_copy)
32453250
}
32463251

32473252
SetTestSuite.test("removeFirst") {

0 commit comments

Comments
 (0)