Skip to content

Commit 9a57840

Browse files
authored
Merge pull request #65598 from hyp/eng/loop-std-vector-test-reenable
[interop] NFC, test, re-enable unit test for the for loop iteration o…
2 parents 3e89c4d + 17abf2c commit 9a57840

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

test/Interop/Cxx/stdlib/use-std-vector.swift

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// RUN: %target-run-simple-swift(-I %S/Inputs -Xfrontend -enable-experimental-cxx-interop)
2+
// FIXME: also test this in C++20 mode once rdar://108810356 is fixed.
23
//
34
// REQUIRES: executable_test
45
//
@@ -33,19 +34,17 @@ func fill(vector v: inout Vector) {
3334
v.push_back(&_3)
3435
}
3536

36-
// TODO: in some configurations the stdlib emits a "initializeWithCopy" where the arguments
37-
// have incorrect indirection: rdar://87728422 and rdar://87805795
38-
// StdVectorTestSuite.test("for loop") {
39-
// var v = Vector()
40-
// fill(vector: &v)
41-
//
42-
// var count: CInt = 1
43-
// for e in v {
44-
// expectEqual(e, count)
45-
// count += 1
46-
// }
47-
// expectEqual(count, 4)
48-
// }
37+
StdVectorTestSuite.test("for loop") {
38+
var v = Vector()
39+
fill(vector: &v)
40+
41+
var count: CInt = 1
42+
for e in v {
43+
expectEqual(e, count)
44+
count += 1
45+
}
46+
expectEqual(count, 4)
47+
}
4948

5049
StdVectorTestSuite.test("map") {
5150
var v = Vector()

0 commit comments

Comments
 (0)