Skip to content

Commit 4fbf22c

Browse files
authored
Merge pull request #4175 from apple/disable-casts-test-in-optimized-mode
Disable a test for a bug in optimized mode, its behavior is unpredictable with the optimizer on
2 parents c9e57af + ddff3dc commit 4fbf22c

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

test/1_stdlib/Casts.swift

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -70,18 +70,16 @@ func isP<T>(_ t: T) -> Bool {
7070
return t is P
7171
}
7272

73-
CastsTests.test("Dynamic casts of CF types to protocol existentials") {
73+
CastsTests.test("Dynamic casts of CF types to protocol existentials")
74+
.skip(.custom(
75+
{ !_isDebugAssertConfiguration() },
76+
reason: "This test behaves unpredictably in optimized mode."))
77+
.code {
7478
expectTrue(isP(10 as Int))
7579

7680
// FIXME: SR-2289: dynamic casting of CF types to protocol existentials
7781
// should work, but there is a bug in the runtime that prevents them from
7882
// working.
79-
if !_isDebugAssertConfiguration() {
80-
// FIXME: this test should not crash. It currently crashes in optimized
81-
// mode because the optimizer assumes that the type conforms, but then the
82-
// runtime disagrees.
83-
expectCrashLater()
84-
}
8583
expectFailure {
8684
expectTrue(isP(CFBitVector.makeImmutable(from: [10, 20])))
8785
}

0 commit comments

Comments
 (0)