Files
Guillaume Lessard 3fb26b9cdb [test] encode expectations
-  assertionFailure(“”) and assert(false, “”) unexpectedly behaved differently, and they should not. A previous fix caused a regression in compilation behaviour.
- These tests probe the behaviour of assertionFailure(“”) for all four combinations of (-O, -Onone) and (-assert-config Debug, -assert-config Release).
- The compilation regression is guarded by a -verify test.
2026-08-06 13:46:09 -07:00

31 lines
716 B
Swift

// RUN: %target-run-stdlib-swift(-O -assert-config Debug)
// RUN: %target-run-stdlib-swift(-O -assert-config Release)
// RUN: %target-run-stdlib-swift(-Onone -assert-config Debug)
// RUN: %target-run-stdlib-swift(-Onone -assert-config Release)
// REQUIRES: executable_test
import StdlibUnittest
var suite = TestSuite("issue 85382 tests")
suite.test("reproducer")
.require(.crashTesting)
.code {
if _isDebugAssertConfiguration() {
expectCrashLater()
}
assertionFailure("Should only crash in debug mode.")
}
suite.test("counter-example")
.require(.crashTesting)
.code {
if _isDebugAssertConfiguration() {
expectCrashLater()
}
assert(false, "Should only crash in debug mode.")
}
runAllTests()