Skip to content

Commit df29fc3

Browse files
committed
[cxx-interop] Make a test work properly with optimizations
The compiler might optimize away the first copy, so just make sure that no copies are happening during the actual initialization of Array. rdar://110422053
1 parent 138def7 commit df29fc3

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

Diff for: test/Interop/Cxx/stdlib/overlay/custom-convertible-to-collection.swift

+1-5
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,9 @@ CxxSequenceTestSuite.test("SimpleCopyAwareSequence to Swift.Array") {
2020
copiesCount = 0
2121

2222
let seq = SimpleCopyAwareSequence()
23-
24-
let seqCopy = seq
25-
expectEqual(1, copiesCount) // make sure our copy tracking mechanism works
26-
2723
let array = Array(seq)
2824

29-
expectEqual(1, copiesCount) // make sure we don't copy the C++ sequence value unnecessarily
25+
expectEqual(0, copiesCount) // make sure we don't copy the C++ sequence value unnecessarily
3026
}
3127
#endif
3228

0 commit comments

Comments
 (0)