Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions Sources/Testing/Issues/Issue+Recording.swift
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,12 @@ extension Issue {
// MARK: - Debugging failures

/// A unique value used by ``failureBreakpoint()``.
@usableFromInline @exclusivity(unchecked) nonisolated(unsafe) var failureBreakpointValue = 0
#if !os(Windows)
// Work around compiler bug by not specifying unchecked exclusivity on Windows.
// SEE: https://github.com/swiftlang/swift/issues/76279
@exclusivity(unchecked)
#endif
@usableFromInline nonisolated(unsafe) var failureBreakpointValue = 0

/// A function called by the testing library when a failure occurs.
///
Expand Down Expand Up @@ -272,5 +277,5 @@ func failureBreakpoint() {
// opportunities elsewhere. Instead, this function performs a trivial
// operation on a usable-from-inline value, which the compiler must assume
// cannot be optimized away.
failureBreakpointValue = 1
failureBreakpointValue = 0
}
4 changes: 2 additions & 2 deletions Tests/TestingTests/MiscellaneousTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -531,9 +531,9 @@ struct MiscellaneousTests {

@Test("failureBreakpoint() call")
func failureBreakpointCall() {
failureBreakpointValue = 0
failureBreakpointValue = 1
failureBreakpoint()
#expect(failureBreakpointValue == 1)
#expect(failureBreakpointValue == 0)
}

@available(_clockAPI, *)
Expand Down