@@ -145,7 +145,6 @@ struct PointerOffsetTests {
145145 #expect( ( pointer + secondOffset) . pointee == 4 )
146146 #expect( ( pointer + thirdOffset) . pointee == 5 )
147147 }
148- #if !(!canImport(Darwin) && !DEBUG)
149148 withUnsafePointer ( to: triple) { pointer in
150149 #expect( ( pointer + firstOffset) . pointee == 3 )
151150 #expect( ( pointer + secondOffset) . pointee == 4 )
@@ -154,31 +153,6 @@ struct PointerOffsetTests {
154153 #expect( triple. first == 3 )
155154 #expect( triple. second == 4 )
156155 #expect( triple. third == 5 )
157- #endif
158- }
159- }
160-
161- #if !canImport(Darwin) && !DEBUG
162- @Test ( " Undefined Behavior Issue for PointerOffset " , . bug( " #73 " , relationship: . uncoveredBug) )
163- func unsafePointerAndUnsafeMutablePointerExtensionUB( ) {
164- var tuple = Tuple ( first: 1 , second: 2 )
165- typealias Base = Tuple < Int , Int >
166- let firstOffset = PointerOffset < Base , Int > ( byteOffset: 0 )
167- withUnsafeMutablePointer ( to: & tuple) { pointer in
168- #expect( pointer [ offset: firstOffset] == 1 )
169- pointer [ offset: firstOffset] = 3
170- }
171- let unexpectedValue = tuple. first
172- // The value will be unexpected due to UB
173- #expect( unexpectedValue == 1 )
174- // The value will be expected after and within a withKnownIssue block
175- withKnownIssue {
176- let expectedValue = tuple. first
177- #expect( expectedValue == 3 )
178- Issue . record ( " To make withKnownIssue pass " )
179156 }
180- let expectedValue = tuple. first
181- #expect( expectedValue == 3 )
182157 }
183- #endif
184158}
0 commit comments