Skip to content

Commit 1fbded6

Browse files
committed
Allow -swift-version 6 in asserts compilers only
To allow us to start testing language changes tied to a future Swift 6 mode without actually *shipping* a Swift 6 mode to customers who might accidentally use it before it's ready. This commit also adds parallel tests for a number of already existing (but untested) Swift 6 mode behaviors.
1 parent 700b11d commit 1fbded6

File tree

8 files changed

+638
-0
lines changed

8 files changed

+638
-0
lines changed

lib/Basic/Version.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,17 @@ Optional<Version> Version::getEffectiveLanguageVersion() const {
326326
static_assert(SWIFT_VERSION_MAJOR == 5,
327327
"getCurrentLanguageVersion is no longer correct here");
328328
return Version::getCurrentLanguageVersion();
329+
case 6:
330+
// Allow version '6' in asserts compilers *only* so that we can start
331+
// testing changes slated for Swift 6. Note that it's still not listed in
332+
// `Version::getValidEffectiveVersions()`.
333+
// FIXME: When Swift 6 becomes real, remove 'REQUIRES: asserts' from tests
334+
// using '-swift-version 6'.
335+
#ifdef NDEBUG
336+
LLVM_FALLTHROUGH;
337+
#else
338+
return Version{6};
339+
#endif
329340
default:
330341
return None;
331342
}

0 commit comments

Comments
 (0)