mirror of
https://github.com/apple/swift.git
synced 2026-10-10 13:50:43 +02:00
- 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.
31 lines
716 B
Swift
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()
|