Skip to content

Commit b73352a

Browse files
committed
Disable Unsafe[Raw]BufferPointer testing in optimized mode.
The optimized-build behavior of UnsafeBufferPointer bounds/overflow checking cannot be tested. The standard library always compiles with debug checking enabled, so the behavior of the optimized test depends on whether the inlining heuristics decide to inline these methods. To fix this, we need a way to force @_inlineable UnsafeBufferPointer methods to be emitted inside the client code, and thereby subject the stdlib implementation to the test case's compile options.
1 parent e7b002f commit b73352a

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

test/stdlib/UnsafeRawBufferPointer.swift

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,15 @@
55
// General Collection behavior tests are in
66
// validation-test/stdlib/UnsafeBufferPointer.swift.
77

8-
// rdar://35052802 unexpected assertions when test is run with optimize_size
9-
// XFAIL: swift_test_mode_optimize_size && optimized_stdlib
8+
// FIXME: The optimized-build behavior of UnsafeBufferPointer bounds/overflow
9+
// checking cannot be tested. The standard library always compiles with debug
10+
// checking enabled, so the behavior of the optimized test depends on whether
11+
// the inlining heuristics decide to inline these methods. To fix this, we need
12+
// a way to force @_inlineable UnsafeBufferPointer methods to be emitted inside
13+
// the client code, and thereby subject the stdlib implementation to the test
14+
// case's compile options.
15+
//
16+
// REQUIRES: swift_test_mode_optimize_none
1017

1118
import StdlibUnittest
1219

validation-test/stdlib/UnsafeBufferPointer.swift.gyb

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
11
// RUN: %target-run-simple-swiftgyb
22
// REQUIRES: executable_test
33

4-
// rdar://35052802 unexpected assertions when test is run with optimize_size
5-
// XFAIL: swift_test_mode_optimize_size && optimized_stdlib
4+
// FIXME: The optimized-build behavior of UnsafeBufferPointer bounds/overflow
5+
// checking cannot be tested. The standard library always compiles with debug
6+
// checking enabled, so the behavior of the optimized test depends on whether
7+
// the inlining heuristics decide to inline these methods. To fix this, we need
8+
// a way to force @_inlineable UnsafeBufferPointer methods to be emitted inside
9+
// the client code, and thereby subject the stdlib implementation to the test
10+
// case's compile options.
11+
//
12+
// REQUIRES: swift_test_mode_optimize_none
613

714
import StdlibUnittest
815
import StdlibCollectionUnittest

0 commit comments

Comments
 (0)