Skip to content

Commit 5925df7

Browse files
authored
Merge pull request #76670 from swiftlang/egorzhdan/reenable-c-frt-test
[cxx-interop] Re-enable a test for C foreign reference types
2 parents d3c5149 + 8610974 commit 5925df7

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

test/Interop/C/struct/foreign-reference.swift

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
// RUN: %target-run-simple-swift(-I %S/Inputs/ -Xfrontend -validate-tbd-against-ir=none -Xfrontend -experimental-c-foreign-reference-types)
1+
// RUN: %target-run-simple-swift(-I %S/Inputs/ -Xfrontend -validate-tbd-against-ir=none -Xfrontend -experimental-c-foreign-reference-types -Onone -D NO_OPTIMIZATIONS)
2+
// RUN: %target-run-simple-swift(-I %S/Inputs/ -Xfrontend -validate-tbd-against-ir=none -Xfrontend -experimental-c-foreign-reference-types -O)
23
//
34
// REQUIRES: executable_test
45
// TODO: This should work without ObjC interop in the future rdar://97497120
56
// REQUIRES: objc_interop
6-
// REQUIRES: rdar101790203
77

88
import StdlibUnittest
99
import ForeignReference
@@ -15,24 +15,32 @@ public func blackHole<T>(_ _: T) { }
1515

1616
ReferenceCountedTestSuite.test("Local") {
1717
var x = createLocalCount()
18+
#if NO_OPTIMIZATIONS
1819
expectEqual(x.value, 6) // This is 6 because of "var x" "x.value" * 2 and "(x, x, x)".
20+
#endif
1921

2022
let t = (x, x, x)
23+
#if NO_OPTIMIZATIONS
2124
expectEqual(x.value, 5)
25+
#endif
2226
}
2327

2428
@inline(never)
2529
func globalTest1() {
2630
var x = createGlobalCount()
2731
let t = (x, x, x)
32+
#if NO_OPTIMIZATIONS
2833
expectEqual(globalCount, 4)
34+
#endif
2935
blackHole(t)
3036
}
3137

3238
@inline(never)
3339
func globalTest2() {
3440
var x = createGlobalCount()
41+
#if NO_OPTIMIZATIONS
3542
expectEqual(globalCount, 1)
43+
#endif
3644
}
3745

3846
ReferenceCountedTestSuite.test("Global") {

0 commit comments

Comments
 (0)