diff --git a/include/swift/Basic/Features.def b/include/swift/Basic/Features.def index 2b59fc02cf7e6..fe048ebeef635 100644 --- a/include/swift/Basic/Features.def +++ b/include/swift/Basic/Features.def @@ -541,6 +541,10 @@ SUPPRESSIBLE_EXPERIMENTAL_FEATURE(Lifetimes, true) /// Allow macro based aliases to be imported into Swift EXPERIMENTAL_FEATURE(ImportMacroAliases, true) +/// Allow support for the nonisolated(nonsending) dynamic hop elim off of +/// on platforms that do not support aarch64 tbi. +EXPERIMENTAL_FEATURE(NonisolatedNonsendingDynamicHopElim, false) + #undef EXPERIMENTAL_FEATURE_EXCLUDED_FROM_MODULE_INTERFACE #undef EXPERIMENTAL_FEATURE #undef UPCOMING_FEATURE diff --git a/include/swift/Basic/LangOptions.h b/include/swift/Basic/LangOptions.h index 0b650a7d1f6db..8915da9f3ac50 100644 --- a/include/swift/Basic/LangOptions.h +++ b/include/swift/Basic/LangOptions.h @@ -670,6 +670,9 @@ namespace swift { bool RestrictNonProductionExperimentalFeatures = false; #endif + /// Set to true if we support AArch64TBI. + bool HasAArch64TBI = false; + bool isConcurrencyModelTaskToThread() const { return ActiveConcurrencyModel == ConcurrencyModel::TaskToThread; } diff --git a/include/swift/Frontend/Frontend.h b/include/swift/Frontend/Frontend.h index 029e296ab5d38..6e331491a25bd 100644 --- a/include/swift/Frontend/Frontend.h +++ b/include/swift/Frontend/Frontend.h @@ -274,6 +274,9 @@ class CompilerInvocation { /// C++ stdlib is the default for the specified target. void computeCXXStdlibOptions(); + /// Compute whether or not we support aarch64TBI + void computeAArch64TBIOptions(); + /// Computes the runtime resource path relative to the given Swift /// executable. static void computeRuntimeResourcePathFromExecutablePath( diff --git a/include/swift/SIL/SILType.h b/include/swift/SIL/SILType.h index 41fdfae5daba3..d19e6a839eeca 100644 --- a/include/swift/SIL/SILType.h +++ b/include/swift/SIL/SILType.h @@ -1025,6 +1025,10 @@ class SILType { /// Return '()' static SILType getEmptyTupleType(const ASTContext &C); + /// Return (elementTypes). + static SILType getTupleType(const ASTContext &ctx, + ArrayRef elementTypes); + /// Get the type for opaque actor isolation values. static SILType getOpaqueIsolationType(const ASTContext &C); diff --git a/lib/AST/FeatureSet.cpp b/lib/AST/FeatureSet.cpp index dc65c877264e4..6a773c4690536 100644 --- a/lib/AST/FeatureSet.cpp +++ b/lib/AST/FeatureSet.cpp @@ -123,6 +123,7 @@ UNINTERESTING_FEATURE(SuppressedAssociatedTypes) UNINTERESTING_FEATURE(StructLetDestructuring) UNINTERESTING_FEATURE(MacrosOnImports) UNINTERESTING_FEATURE(NonisolatedNonsendingByDefault) +UNINTERESTING_FEATURE(NonisolatedNonsendingDynamicHopElim) UNINTERESTING_FEATURE(KeyPathWithMethodMembers) UNINTERESTING_FEATURE(ImportMacroAliases) UNINTERESTING_FEATURE(NoExplicitNonIsolated) diff --git a/lib/DriverTool/sil_opt_main.cpp b/lib/DriverTool/sil_opt_main.cpp index a3f7217c432ef..8e74ad4a7d15c 100644 --- a/lib/DriverTool/sil_opt_main.cpp +++ b/lib/DriverTool/sil_opt_main.cpp @@ -814,6 +814,8 @@ int sil_opt_main(ArrayRef argv, void *MainAddr) { Invocation.getLangOptions().UnavailableDeclOptimizationMode = options.UnavailableDeclOptimization; + Invocation.computeAArch64TBIOptions(); + // Enable strict concurrency if we have the feature specified or if it was // specified via a command line option to sil-opt. if (Invocation.getLangOptions().hasFeature(Feature::StrictConcurrency)) { diff --git a/lib/Frontend/CompilerInvocation.cpp b/lib/Frontend/CompilerInvocation.cpp index f07a6659ebae2..3d0ffd6f8210f 100644 --- a/lib/Frontend/CompilerInvocation.cpp +++ b/lib/Frontend/CompilerInvocation.cpp @@ -382,6 +382,13 @@ setBridgingHeaderFromFrontendOptions(ClangImporterOptions &ImporterOpts, FrontendOpts.InputsAndOutputs.getFilenameOfFirstInput(); } +void CompilerInvocation::computeAArch64TBIOptions() { + auto &LLVMArgs = getFrontendOptions().LLVMArgs; + auto aarch64_use_tbi = + std::find(LLVMArgs.begin(), LLVMArgs.end(), "-aarch64-use-tbi"); + LangOpts.HasAArch64TBI = aarch64_use_tbi != LLVMArgs.end(); +} + void CompilerInvocation::computeCXXStdlibOptions() { // The MSVC driver in Clang is not aware of the C++ stdlib, and currently // always assumes libstdc++, which is incorrect: the Microsoft stdlib is @@ -4108,6 +4115,8 @@ bool CompilerInvocation::parseArgs( setIRGenOutputOptsFromFrontendOptions(IRGenOpts, FrontendOpts); setBridgingHeaderFromFrontendOptions(ClangImporterOpts, FrontendOpts); computeCXXStdlibOptions(); + computeAArch64TBIOptions(); + if (LangOpts.hasFeature(Feature::Embedded)) { IRGenOpts.InternalizeAtLink = true; IRGenOpts.DisableLegacyTypeInfo = true; diff --git a/lib/IRGen/GenThunk.cpp b/lib/IRGen/GenThunk.cpp index f0bfd4fa0b2bb..0682f51ab7673 100644 --- a/lib/IRGen/GenThunk.cpp +++ b/lib/IRGen/GenThunk.cpp @@ -137,6 +137,23 @@ void IRGenThunk::prepareArguments() { if (isWitnessMethod) { witnessMetadata.SelfWitnessTable = original.takeLast(); + + // Mask out the bottom bits when we dispatch specifically to + // Actor.unownedExecutor if we NonisolatedNonsendingDynamicHopElim is + // enabled and we are not on a platform that supports TBI. + auto &langOpts = IGF.getSILModule().getASTContext().LangOpts; + if (langOpts.hasFeature(Feature::NonisolatedNonsendingDynamicHopElim) && + !langOpts.HasAArch64TBI && + IGF.CurFn->getName() == "$sScA15unownedExecutorScevgTj") { + auto type = llvm::Type::getInt64Ty(IGF.CurFn->getContext()); + auto pointerCast = IGF.Builder.CreateBitOrPointerCast( + witnessMetadata.SelfWitnessTable, type); + witnessMetadata.SelfWitnessTable = IGF.Builder.CreateBitOrPointerCast( + IGF.Builder.CreateBinOp(llvm::Instruction::BinaryOps::And, + pointerCast, + llvm::ConstantInt::get(IGF.IGM.IntPtrTy, -4)), + witnessMetadata.SelfWitnessTable->getType()); + } witnessMetadata.SelfMetadata = original.takeLast(); } diff --git a/lib/SIL/IR/SILType.cpp b/lib/SIL/IR/SILType.cpp index f919f98f2d01a..f659e0a6ae293 100644 --- a/lib/SIL/IR/SILType.cpp +++ b/lib/SIL/IR/SILType.cpp @@ -103,6 +103,21 @@ SILType SILType::getEmptyTupleType(const ASTContext &C) { return getPrimitiveObjectType(C.TheEmptyTupleType); } +SILType SILType::getTupleType(const ASTContext &ctx, + ArrayRef elementTypes) { + if (elementTypes.empty()) + return SILType::getEmptyTupleType(ctx); + + SmallVector tupleTypeElts; + auto category = elementTypes[0].getCategory(); + for (auto type : elementTypes) { + assert(type.getCategory() == category && "Mismatched tuple elt categories"); + tupleTypeElts.push_back(TupleTypeElt(type.getRawASTType())); + } + auto tupleType = TupleType::get(tupleTypeElts, ctx); + return SILType::getPrimitiveType(tupleType->getCanonicalType(), category); +} + SILType SILType::getSILTokenType(const ASTContext &C) { return getPrimitiveObjectType(C.TheSILTokenType); } diff --git a/lib/SILGen/CMakeLists.txt b/lib/SILGen/CMakeLists.txt index 71fc895654e6c..f39661e71b6fb 100644 --- a/lib/SILGen/CMakeLists.txt +++ b/lib/SILGen/CMakeLists.txt @@ -3,6 +3,7 @@ add_swift_host_library(swiftSILGen STATIC ArgumentSource.cpp Cleanup.cpp Condition.cpp + ConcurrencyUtils.cpp FormalEvaluation.cpp ManagedValue.cpp ResultPlan.cpp diff --git a/lib/SILGen/ConcurrencyUtils.cpp b/lib/SILGen/ConcurrencyUtils.cpp new file mode 100644 index 0000000000000..4caf4a4e808af --- /dev/null +++ b/lib/SILGen/ConcurrencyUtils.cpp @@ -0,0 +1,163 @@ +//===--- ConcurrencyUtils.cpp ---------------------------------------------===// +// +// This source file is part of the Swift.org open source project +// +// Copyright (c) 2014 - 2025 Apple Inc. and the Swift project authors +// Licensed under Apache License v2.0 with Runtime Library Exception +// +// See https://swift.org/LICENSE.txt for license information +// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors +// +//===----------------------------------------------------------------------===// + +#include "ConcurrencyUtils.h" + +#include "RValue.h" +#include "SILGenFunction.h" + +using namespace swift; +using namespace swift::Lowering; + +// We could use a higher bit. But by reusing the first bit, we just save a +// little bit of code. +// +// $valueToShift << (((sizeof(Word) - 1) << 3) + 4) +// +// Mathematicaly this is $valueToShift * 2**((sizeof(Word) - 1)*8 + 4) +// +// On 64 bit this is 60. This works since we want to use the bottom two bits of +// the top nibble of the TBI bits. +static SILValue getTBIBits(SILGenFunction &SGF, SILLocation loc, + unsigned valueToShift = 1) { + auto &ctx = SGF.getASTContext(); + auto silWordType = SILType::getBuiltinWordType(ctx); + + auto id = ctx.getIdentifier(getBuiltinName(BuiltinValueKind::Sizeof)); + auto *builtin = ::cast(getBuiltinValueDecl(ctx, id)); + auto wordType = BuiltinIntegerType::getWordType(ctx)->getCanonicalType(); + auto metatypeTy = SILType::getPrimitiveObjectType(CanMetatypeType::get( + wordType->getCanonicalType(), MetatypeRepresentation::Thin)); + auto metatypeVal = SGF.B.createMetatype(loc, metatypeTy); + + auto sizeOfWord = + SGF.B.createBuiltin(loc, id, silWordType, + SubstitutionMap::get(builtin->getGenericSignature(), + ArrayRef{wordType}, + LookUpConformanceInModule()), + {metatypeVal}); + auto one = SGF.B.createIntegerLiteral(loc, silWordType, 1); + auto three = SGF.B.createIntegerLiteral(loc, silWordType, 3); + auto four = SGF.B.createIntegerLiteral(loc, silWordType, 4); + auto valueToShiftLit = + SGF.B.createIntegerLiteral(loc, silWordType, valueToShift); + + // sizeof(Word) - 1 + auto sub = SGF.B.createBuiltinBinaryFunction(loc, "sub", silWordType, + silWordType, {sizeOfWord, one}); + // (sizeof(Word) - 1) << 3 + auto innerShift = SGF.B.createBuiltinBinaryFunction( + loc, "shl", silWordType, silWordType, {sub, three}); + // ((sizeof(Word) - 1) << 3) + 4 + auto innerShiftOffset = SGF.B.createBuiltinBinaryFunction( + loc, "add", silWordType, silWordType, {innerShift, four}); + auto outerShift = + SGF.B.createBuiltinBinaryFunction(loc, "shl", silWordType, silWordType, + {valueToShiftLit, innerShiftOffset}); + return outerShift; +} + +/// Construct the TBI mask in a platform independent way that works on all +/// platforms. +/// +/// We compute: +/// +/// mask = (0x3 << (((sizeof(Word) - 1) << 3) + 4)) ^ -1 +static SILValue getTBIClearMask(SILGenFunction &SGF, SILLocation loc) { + auto &ctx = SGF.getASTContext(); + auto silWordType = SILType::getBuiltinWordType(ctx); + auto negBits = SGF.B.createIntegerLiteral(loc, silWordType, -1); + + return SGF.B.createBuiltinBinaryFunction(loc, "xor", silWordType, silWordType, + {getTBIBits(SGF, loc, 3), negBits}); +} + +static ManagedValue +transformTupleElts(SILGenFunction &SGF, SILLocation loc, ManagedValue mv, + llvm::function_ref func) { + auto &ctx = SGF.getASTContext(); + auto silWordType = SILType::getBuiltinWordType(ctx); + auto tupleType = + SILType::getTupleType(SGF.getASTContext(), {silWordType, silWordType}); + auto cast = + SGF.B.createUncheckedBitCast(loc, mv, tupleType).getUnmanagedValue(); + auto *destructure = SGF.B.createDestructureTuple(loc, cast); + SILValue reformedValue = func(destructure); + auto reformedPointer = + ManagedValue::forBorrowedRValue(SGF.B.createUncheckedOwnershipConversion( + loc, + SGF.B.createUncheckedReinterpretCast(loc, reformedValue, + mv.getType()), + OwnershipKind::Guaranteed)); + return SGF.B.createMarkDependence(loc, reformedPointer, mv, + MarkDependenceKind::NonEscaping); +} + +ManagedValue swift::Lowering::clearImplicitIsolatedActorBits( + SILGenFunction &SGF, SILLocation loc, ManagedValue isolatedMV) { + auto &ctx = SGF.getASTContext(); + if (!ctx.LangOpts.hasFeature(Feature::NonisolatedNonsendingDynamicHopElim) && + !ctx.LangOpts.HasAArch64TBI) { + return isolatedMV; + } + + return transformTupleElts( + SGF, loc, isolatedMV, [&](DestructureTupleInst *dti) { + auto silWordType = SILType::getBuiltinWordType(ctx); + SILValue bitMask = + ctx.LangOpts.HasAArch64TBI + ? getTBIClearMask(SGF, loc) + : SGF.B.createIntegerLiteral(loc, silWordType, -4); + + auto result = SGF.B.createBuiltinBinaryFunction( + loc, "and", silWordType, silWordType, {dti->getResult(1), bitMask}); + return SGF.B.createTuple(loc, {dti->getResult(0), result}); + }); +} + +RValue +swift::Lowering::clearImplicitIsolatedActorBits(SILGenFunction &SGF, Expr *expr, + ManagedValue isolatedMV) { + return RValue( + SGF, expr, + clearImplicitIsolatedActorBits(SGF, SILLocation(expr), isolatedMV)); +} + +ManagedValue swift::Lowering::setImplicitIsolatedActorBits( + SILGenFunction &SGF, SILLocation loc, ManagedValue isolatedMV) { + auto &ctx = SGF.getASTContext(); + if (!ctx.LangOpts.hasFeature(Feature::NonisolatedNonsendingDynamicHopElim) && + !ctx.LangOpts.HasAArch64TBI) { + return isolatedMV; + } + + return transformTupleElts( + SGF, loc, isolatedMV, [&](DestructureTupleInst *dti) { + auto silWordType = SILType::getBuiltinWordType(ctx); + SILValue bitMask = + ctx.LangOpts.HasAArch64TBI + ? getTBIBits(SGF, loc) + : SGF.B.createIntegerLiteral(loc, silWordType, 1); + + auto result = SGF.B.createBuiltinBinaryFunction( + loc, "or", silWordType, silWordType, {dti->getResult(1), bitMask}); + return SGF.B.createTuple(loc, {dti->getResult(0), result}); + }); +} + +RValue swift::Lowering::setImplicitIsolatedActorBits(SILGenFunction &SGF, + Expr *expr, + ManagedValue isolatedMV) { + return RValue( + SGF, expr, + setImplicitIsolatedActorBits(SGF, SILLocation(expr), isolatedMV)); +} diff --git a/lib/SILGen/ConcurrencyUtils.h b/lib/SILGen/ConcurrencyUtils.h new file mode 100644 index 0000000000000..7e7649b58ebd0 --- /dev/null +++ b/lib/SILGen/ConcurrencyUtils.h @@ -0,0 +1,50 @@ +//===--- ConcurrencyUtils.h -----------------------------------------------===// +// +// This source file is part of the Swift.org open source project +// +// Copyright (c) 2014 - 2025 Apple Inc. and the Swift project authors +// Licensed under Apache License v2.0 with Runtime Library Exception +// +// See https://swift.org/LICENSE.txt for license information +// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors +// +//===----------------------------------------------------------------------===// + +#ifndef SWIFT_SILGEN_CONCURRENCYUTILS_H +#define SWIFT_SILGEN_CONCURRENCYUTILS_H + +namespace swift { + +class SILLocation; +class Expr; + +namespace Lowering { + +class SILGenFunction; +class RValue; +class ManagedValue; + +/// Clear the TBI bits if AArch64HasTBI is set. Otherwise clear the low tagged +/// bits. +/// +/// \param expr - the expression which yielded this r-value; its type +/// will become the substituted formal type of this r-value +/// \param implicitIsolatedActor should be an Optional. +RValue clearImplicitIsolatedActorBits(SILGenFunction &SGF, Expr *expr, + ManagedValue implicitIsolatedActor); + +ManagedValue clearImplicitIsolatedActorBits(SILGenFunction &SGF, + SILLocation loc, + ManagedValue implicitIsolatedActor); + +RValue setImplicitIsolatedActorBits(SILGenFunction &SGF, Expr *expr, + ManagedValue implicitIsolatedActor); + +ManagedValue setImplicitIsolatedActorBits(SILGenFunction &SGF, SILLocation loc, + ManagedValue implicitIsolatedActor); + +} // namespace Lowering + +} // namespace swift + +#endif diff --git a/lib/SILGen/SILGenApply.cpp b/lib/SILGen/SILGenApply.cpp index 6ae1e93fe6113..6914167d156ba 100644 --- a/lib/SILGen/SILGenApply.cpp +++ b/lib/SILGen/SILGenApply.cpp @@ -13,6 +13,7 @@ #include "ArgumentScope.h" #include "ArgumentSource.h" #include "Callee.h" +#include "ConcurrencyUtils.h" #include "Conversion.h" #include "ExecutorBreadcrumb.h" #include "FormalEvaluation.h" @@ -5861,8 +5862,12 @@ ApplyOptions CallEmission::emitArgumentsForNormalApply( args.push_back({}); // NOTE: Even though this calls emitActorInstanceIsolation, this also // handles glboal actor isolated cases. - args.back().push_back(SGF.emitActorInstanceIsolation( - callSite->Loc, executor, executor.getType().getASTType())); + auto erasedActor = + SGF.emitActorInstanceIsolation(callSite->Loc, executor, + executor.getType().getASTType()) + .borrow(SGF, callSite->Loc); + args.back().push_back( + clearImplicitIsolatedActorBits(SGF, callSite->Loc, erasedActor)); } uncurriedLoc = callSite->Loc; diff --git a/lib/SILGen/SILGenConcurrency.cpp b/lib/SILGen/SILGenConcurrency.cpp index ddb6890a3c1da..95a2559ef4949 100644 --- a/lib/SILGen/SILGenConcurrency.cpp +++ b/lib/SILGen/SILGenConcurrency.cpp @@ -27,7 +27,7 @@ using namespace Lowering; static void setExpectedExecutorForGeneric(SILGenFunction &SGF) { auto loc = RegularLocation::getAutoGeneratedLocation(SGF.F.getLocation()); - SGF.ExpectedExecutor.set(SGF.emitGenericExecutor(loc)); + SGF.ExpectedExecutor.set(SGF.emitNonIsolatedIsolation(loc).getValue()); } static void setExpectedExecutorForGlobalActor(SILGenFunction &SGF, @@ -284,8 +284,9 @@ void SILGenFunction::emitConstructorExpectedExecutorProlog() { loc.markAsPrologue(); loc = loc.asAutoGenerated(); - auto initialExecutor = emitGenericExecutor(loc); - B.createHopToExecutor(loc, initialExecutor, /*mandatory*/ false); + auto initialExecutor = emitNonIsolatedIsolation(loc); + B.createHopToExecutor(loc, initialExecutor.getValue(), + /*mandatory*/ false); return; } } diff --git a/lib/SILGen/SILGenExpr.cpp b/lib/SILGen/SILGenExpr.cpp index 17cc3ca344527..c62554df9051d 100644 --- a/lib/SILGen/SILGenExpr.cpp +++ b/lib/SILGen/SILGenExpr.cpp @@ -13,6 +13,7 @@ #include "ArgumentScope.h" #include "ArgumentSource.h" #include "Callee.h" +#include "ConcurrencyUtils.h" #include "Condition.h" #include "Conversion.h" #include "Initialization.h" @@ -7319,13 +7320,8 @@ RValue RValueEmitter::visitCurrentContextIsolationExpr( auto *isolatedArg = SGF.F.maybeGetIsolatedArgument(); assert(isolatedArg && "Caller Isolation Inheriting without isolated parameter"); - ManagedValue isolatedMV; - if (isolatedArg->getOwnershipKind() == OwnershipKind::Guaranteed) { - isolatedMV = ManagedValue::forBorrowedRValue(isolatedArg); - } else { - isolatedMV = ManagedValue::forUnmanagedOwnedValue(isolatedArg); - } - return RValue(SGF, E, isolatedMV); + auto isolatedMV = ManagedValue::forBorrowedRValue(isolatedArg); + return clearImplicitIsolatedActorBits(SGF, E, isolatedMV); } } diff --git a/test/Concurrency/Runtime/actor_counters.swift b/test/Concurrency/Runtime/actor_counters.swift index 5749f6012db42..26c19a1143839 100644 --- a/test/Concurrency/Runtime/actor_counters.swift +++ b/test/Concurrency/Runtime/actor_counters.swift @@ -1,4 +1,6 @@ // RUN: %target-run-simple-swift( -Xfrontend -sil-verify-all -target %target-swift-5.1-abi-triple %import-libdispatch -parse-as-library) +// RUN: %target-run-simple-swift( -Xfrontend -sil-verify-all -target %target-swift-5.1-abi-triple %import-libdispatch -parse-as-library -swift-version 5 -strict-concurrency=complete -enable-upcoming-feature NonisolatedNonsendingByDefault) +// REQUIRES: swift_feature_NonisolatedNonsendingByDefault // REQUIRES: executable_test // REQUIRES: concurrency diff --git a/test/Concurrency/Runtime/actor_counters_freestanding.swift b/test/Concurrency/Runtime/actor_counters_freestanding.swift index 827e94356115c..afe2a5359c870 100644 --- a/test/Concurrency/Runtime/actor_counters_freestanding.swift +++ b/test/Concurrency/Runtime/actor_counters_freestanding.swift @@ -1,4 +1,6 @@ // RUN: %target-run-simple-swift( -Xfrontend -sil-verify-all -target %target-swift-5.1-abi-triple %import-libdispatch -parse-as-library) +// RUN: %target-run-simple-swift( -Xfrontend -sil-verify-all -target %target-swift-5.1-abi-triple %import-libdispatch -parse-as-library -swift-version 5 -strict-concurrency=complete -enable-upcoming-feature NonisolatedNonsendingByDefault) +// REQUIRES: swift_feature_NonisolatedNonsendingByDefault // REQUIRES: executable_test // REQUIRES: concurrency diff --git a/test/Concurrency/Runtime/actor_deinit_escaping_self.swift b/test/Concurrency/Runtime/actor_deinit_escaping_self.swift index dd3e23d0aef39..13879a163b1a2 100644 --- a/test/Concurrency/Runtime/actor_deinit_escaping_self.swift +++ b/test/Concurrency/Runtime/actor_deinit_escaping_self.swift @@ -1,4 +1,6 @@ // RUN: %target-run-simple-swift( -target %target-future-triple %import-libdispatch -parse-as-library) +// RUN: %target-run-simple-swift( -target %target-future-triple %import-libdispatch -parse-as-library -swift-version 5 -strict-concurrency=complete -enable-upcoming-feature NonisolatedNonsendingByDefault) +// REQUIRES: swift_feature_NonisolatedNonsendingByDefault // REQUIRES: executable_test // REQUIRES: libdispatch diff --git a/test/Concurrency/Runtime/actor_detach.swift b/test/Concurrency/Runtime/actor_detach.swift index b7b178a28bd38..22b65d6e33b7d 100644 --- a/test/Concurrency/Runtime/actor_detach.swift +++ b/test/Concurrency/Runtime/actor_detach.swift @@ -1,4 +1,6 @@ // RUN: %target-run-simple-swift( -target %target-swift-5.1-abi-triple) | %FileCheck %s +// RUN: %target-run-simple-swift( -target %target-swift-5.1-abi-triple -swift-version 5 -strict-concurrency=complete -enable-upcoming-feature NonisolatedNonsendingByDefault) | %FileCheck %s +// REQUIRES: swift_feature_NonisolatedNonsendingByDefault // REQUIRES: executable_test // REQUIRES: concurrency diff --git a/test/Concurrency/Runtime/actor_dynamic_subclass.swift b/test/Concurrency/Runtime/actor_dynamic_subclass.swift index 83a73fce14bfe..c02ba70cea761 100644 --- a/test/Concurrency/Runtime/actor_dynamic_subclass.swift +++ b/test/Concurrency/Runtime/actor_dynamic_subclass.swift @@ -1,4 +1,6 @@ // RUN: %target-run-simple-swift(-target %target-swift-5.1-abi-triple -parse-as-library) +// RUN: %target-run-simple-swift(-target %target-swift-5.1-abi-triple -parse-as-library -swift-version 5 -strict-concurrency=complete -enable-upcoming-feature NonisolatedNonsendingByDefault) +// REQUIRES: swift_feature_NonisolatedNonsendingByDefault // REQUIRES: executable_test // REQUIRES: concurrency diff --git a/test/Concurrency/Runtime/actor_init.swift b/test/Concurrency/Runtime/actor_init.swift index c40acc77dec4b..f1b5ce6134da5 100644 --- a/test/Concurrency/Runtime/actor_init.swift +++ b/test/Concurrency/Runtime/actor_init.swift @@ -1,4 +1,6 @@ // RUN: %target-run-simple-swift(%import-libdispatch -target %target-swift-5.1-abi-triple -parse-as-library) | %FileCheck %s +// RUN: %target-run-simple-swift(%import-libdispatch -target %target-swift-5.1-abi-triple -parse-as-library -swift-version 5 -strict-concurrency=complete -enable-upcoming-feature NonisolatedNonsendingByDefault) | %FileCheck %s +// REQUIRES: swift_feature_NonisolatedNonsendingByDefault // REQUIRES: executable_test // REQUIRES: concurrency diff --git a/test/Concurrency/Runtime/actor_keypaths.swift b/test/Concurrency/Runtime/actor_keypaths.swift index dcf601158760c..be64cfa2513e1 100644 --- a/test/Concurrency/Runtime/actor_keypaths.swift +++ b/test/Concurrency/Runtime/actor_keypaths.swift @@ -1,4 +1,6 @@ // RUN: %target-run-simple-swift( -target %target-swift-5.1-abi-triple) +// RUN: %target-run-simple-swift( -target %target-swift-5.1-abi-triple -swift-version 5 -strict-concurrency=complete -enable-upcoming-feature NonisolatedNonsendingByDefault) +// REQUIRES: swift_feature_NonisolatedNonsendingByDefault // REQUIRES: executable_test // REQUIRES: concurrency diff --git a/test/Concurrency/Runtime/actor_recursive_deinit.swift b/test/Concurrency/Runtime/actor_recursive_deinit.swift index 2a05c23a23894..bedad75ba3501 100644 --- a/test/Concurrency/Runtime/actor_recursive_deinit.swift +++ b/test/Concurrency/Runtime/actor_recursive_deinit.swift @@ -1,4 +1,6 @@ // RUN: %target-run-simple-swift(-target %target-future-triple -parse-stdlib -parse-as-library) | %FileCheck %s +// RUN: %target-run-simple-swift(-target %target-future-triple -parse-stdlib -parse-as-library -swift-version 5 -strict-concurrency=complete -enable-upcoming-feature NonisolatedNonsendingByDefault) | %FileCheck %s +// REQUIRES: swift_feature_NonisolatedNonsendingByDefault // REQUIRES: executable_test // REQUIRES: concurrency diff --git a/test/Concurrency/Runtime/async.swift b/test/Concurrency/Runtime/async.swift index 9360f32c392d1..741fc3419b5de 100644 --- a/test/Concurrency/Runtime/async.swift +++ b/test/Concurrency/Runtime/async.swift @@ -1,4 +1,6 @@ // RUN: %target-run-simple-swift( -target %target-swift-5.1-abi-triple %import-libdispatch) +// RUN: %target-run-simple-swift( -target %target-swift-5.1-abi-triple %import-libdispatch -swift-version 5 -strict-concurrency=complete -enable-upcoming-feature NonisolatedNonsendingByDefault) +// REQUIRES: swift_feature_NonisolatedNonsendingByDefault // REQUIRES: executable_test // REQUIRES: concurrency diff --git a/test/Concurrency/Runtime/async_initializer.swift b/test/Concurrency/Runtime/async_initializer.swift index 1e2596d169ac2..feb0c8b937a7b 100644 --- a/test/Concurrency/Runtime/async_initializer.swift +++ b/test/Concurrency/Runtime/async_initializer.swift @@ -1,4 +1,6 @@ // RUN: %target-run-simple-swift(-parse-as-library -target %target-swift-5.1-abi-triple) | %FileCheck %s +// RUN: %target-run-simple-swift(-parse-as-library -target %target-swift-5.1-abi-triple -swift-version 5 -strict-concurrency=complete -enable-upcoming-feature NonisolatedNonsendingByDefault) | %FileCheck %s +// REQUIRES: swift_feature_NonisolatedNonsendingByDefault // REQUIRES: executable_test // REQUIRES: concurrency diff --git a/test/Concurrency/Runtime/async_let_fibonacci.swift b/test/Concurrency/Runtime/async_let_fibonacci.swift index 10d6075ae1ad4..8e02cfd96aecd 100644 --- a/test/Concurrency/Runtime/async_let_fibonacci.swift +++ b/test/Concurrency/Runtime/async_let_fibonacci.swift @@ -1,4 +1,6 @@ // RUN: %target-run-simple-swift( -target %target-swift-5.1-abi-triple -parse-as-library) +// RUN: %target-run-simple-swift( -target %target-swift-5.1-abi-triple -parse-as-library -swift-version 5 -strict-concurrency=complete -enable-upcoming-feature NonisolatedNonsendingByDefault) +// REQUIRES: swift_feature_NonisolatedNonsendingByDefault // REQUIRES: executable_test // REQUIRES: concurrency diff --git a/test/Concurrency/Runtime/async_let_throw_completion_order.swift b/test/Concurrency/Runtime/async_let_throw_completion_order.swift index 504d3f69506e4..ff87dc71330b3 100644 --- a/test/Concurrency/Runtime/async_let_throw_completion_order.swift +++ b/test/Concurrency/Runtime/async_let_throw_completion_order.swift @@ -1,5 +1,7 @@ // rdar://81481317 // RUN: %target-run-simple-swift(-target %target-swift-5.1-abi-triple -parse-as-library) | %FileCheck %s +// RUN: %target-run-simple-swift(-target %target-swift-5.1-abi-triple -parse-as-library -swift-version 5 -strict-concurrency=complete -enable-upcoming-feature NonisolatedNonsendingByDefault) | %FileCheck %s +// REQUIRES: swift_feature_NonisolatedNonsendingByDefault // REQUIRES: executable_test // REQUIRES: concurrency diff --git a/test/Concurrency/Runtime/async_let_throws.swift b/test/Concurrency/Runtime/async_let_throws.swift index 21fb512b2f382..bd3089dcf271e 100644 --- a/test/Concurrency/Runtime/async_let_throws.swift +++ b/test/Concurrency/Runtime/async_let_throws.swift @@ -1,4 +1,6 @@ // RUN: %target-run-simple-swift( -target %target-swift-5.1-abi-triple -parse-as-library) | %FileCheck %s +// RUN: %target-run-simple-swift( -target %target-swift-5.1-abi-triple -parse-as-library -swift-version 5 -strict-concurrency=complete -enable-upcoming-feature NonisolatedNonsendingByDefault) | %FileCheck %s +// REQUIRES: swift_feature_NonisolatedNonsendingByDefault // REQUIRES: executable_test // REQUIRES: concurrency diff --git a/test/Concurrency/Runtime/async_parameter_pack.swift b/test/Concurrency/Runtime/async_parameter_pack.swift index bc6a82776178a..c024ef850e617 100644 --- a/test/Concurrency/Runtime/async_parameter_pack.swift +++ b/test/Concurrency/Runtime/async_parameter_pack.swift @@ -1,4 +1,6 @@ // RUN: %target-run-simple-swift( -target %target-swift-5.9-abi-triple) +// RUN: %target-run-simple-swift( -target %target-swift-5.9-abi-triple -swift-version 5 -strict-concurrency=complete -enable-upcoming-feature NonisolatedNonsendingByDefault) +// REQUIRES: swift_feature_NonisolatedNonsendingByDefault // REQUIRES: executable_test // REQUIRES: concurrency diff --git a/test/Concurrency/Runtime/async_properties_actor.swift b/test/Concurrency/Runtime/async_properties_actor.swift index 8e0419a81e0f9..ebb2f4809b839 100644 --- a/test/Concurrency/Runtime/async_properties_actor.swift +++ b/test/Concurrency/Runtime/async_properties_actor.swift @@ -1,4 +1,6 @@ // RUN: %target-run-simple-swift(-parse-as-library -Xfrontend -enable-copy-propagation -Xfrontend -enable-lexical-lifetimes=false -target %target-swift-5.1-abi-triple) | %FileCheck %s +// RUN: %target-run-simple-swift(-parse-as-library -Xfrontend -enable-copy-propagation -Xfrontend -enable-lexical-lifetimes=false -target %target-swift-5.1-abi-triple -swift-version 5 -strict-concurrency=complete -enable-upcoming-feature NonisolatedNonsendingByDefault) | %FileCheck %s +// REQUIRES: swift_feature_NonisolatedNonsendingByDefault // REQUIRES: executable_test // REQUIRES: concurrency diff --git a/test/Concurrency/Runtime/async_sequence.swift b/test/Concurrency/Runtime/async_sequence.swift index f358cb32956b8..b48898b6cb9fa 100644 --- a/test/Concurrency/Runtime/async_sequence.swift +++ b/test/Concurrency/Runtime/async_sequence.swift @@ -1,4 +1,6 @@ // RUN: %target-run-simple-swift( -target %target-swift-5.1-abi-triple -parse-as-library) +// RUN: %target-run-simple-swift( -target %target-swift-5.1-abi-triple -parse-as-library -swift-version 5 -strict-concurrency=complete -enable-upcoming-feature NonisolatedNonsendingByDefault) +// REQUIRES: swift_feature_NonisolatedNonsendingByDefault // REQUIRES: executable_test // REQUIRES: concurrency diff --git a/test/Concurrency/Runtime/async_stream.swift b/test/Concurrency/Runtime/async_stream.swift index 553d4d736bbd8..59976a67f19ad 100644 --- a/test/Concurrency/Runtime/async_stream.swift +++ b/test/Concurrency/Runtime/async_stream.swift @@ -1,5 +1,7 @@ // RUN: %target-typecheck-verify-swift -strict-concurrency=complete -disable-availability-checking -parse-as-library // RUN: %target-run-simple-swift( -Xfrontend -disable-availability-checking -parse-as-library) +// RUN: %target-run-simple-swift( -Xfrontend -disable-availability-checking -parse-as-library -swift-version 5 -strict-concurrency=complete -enable-upcoming-feature NonisolatedNonsendingByDefault) +// REQUIRES: swift_feature_NonisolatedNonsendingByDefault // REQUIRES: concurrency // REQUIRES: executable_test diff --git a/test/Concurrency/Runtime/async_task_async_let_child_cancel.swift b/test/Concurrency/Runtime/async_task_async_let_child_cancel.swift index 9afa4aa262507..a2362c7c5736f 100644 --- a/test/Concurrency/Runtime/async_task_async_let_child_cancel.swift +++ b/test/Concurrency/Runtime/async_task_async_let_child_cancel.swift @@ -1,4 +1,6 @@ // RUN: %target-run-simple-swift(-target %target-swift-5.1-abi-triple -parse-as-library) | %FileCheck %s --dump-input=always +// RUN: %target-run-simple-swift(-target %target-swift-5.1-abi-triple -parse-as-library -swift-version 5 -strict-concurrency=complete -enable-upcoming-feature NonisolatedNonsendingByDefault) | %FileCheck %s --dump-input=always +// REQUIRES: swift_feature_NonisolatedNonsendingByDefault // REQUIRES: executable_test // REQUIRES: concurrency diff --git a/test/Concurrency/Runtime/async_task_cancellation_early.swift b/test/Concurrency/Runtime/async_task_cancellation_early.swift index 88c626c962d7a..60d6ff6b68d74 100644 --- a/test/Concurrency/Runtime/async_task_cancellation_early.swift +++ b/test/Concurrency/Runtime/async_task_cancellation_early.swift @@ -1,4 +1,6 @@ // RUN: %target-run-simple-swift( -Xfrontend -disable-availability-checking %import-libdispatch -parse-as-library) | %FileCheck %s --dump-input=always +// RUN: %target-run-simple-swift( -Xfrontend -disable-availability-checking %import-libdispatch -parse-as-library -swift-version 5 -strict-concurrency=complete -enable-upcoming-feature NonisolatedNonsendingByDefault) | %FileCheck %s --dump-input=always +// REQUIRES: swift_feature_NonisolatedNonsendingByDefault // REQUIRES: executable_test // REQUIRES: concurrency diff --git a/test/Concurrency/Runtime/async_task_cancellation_taskGroup.swift b/test/Concurrency/Runtime/async_task_cancellation_taskGroup.swift index f78437db7884c..2eaeaced17994 100644 --- a/test/Concurrency/Runtime/async_task_cancellation_taskGroup.swift +++ b/test/Concurrency/Runtime/async_task_cancellation_taskGroup.swift @@ -1,4 +1,6 @@ // RUN: %target-run-simple-swift( -target %target-swift-5.1-abi-triple %import-libdispatch -parse-as-library) | %FileCheck %s --dump-input=always +// RUN: %target-run-simple-swift( -target %target-swift-5.1-abi-triple %import-libdispatch -parse-as-library -swift-version 5 -strict-concurrency=complete -enable-upcoming-feature NonisolatedNonsendingByDefault) | %FileCheck %s --dump-input=always +// REQUIRES: swift_feature_NonisolatedNonsendingByDefault // REQUIRES: executable_test // REQUIRES: concurrency diff --git a/test/Concurrency/Runtime/async_task_cancellation_while_running.swift b/test/Concurrency/Runtime/async_task_cancellation_while_running.swift index fd9da7e007dcd..c768fa3f7a51a 100644 --- a/test/Concurrency/Runtime/async_task_cancellation_while_running.swift +++ b/test/Concurrency/Runtime/async_task_cancellation_while_running.swift @@ -1,4 +1,6 @@ // RUN: %target-run-simple-swift( -target %target-swift-5.1-abi-triple %import-libdispatch -parse-as-library) | %FileCheck %s +// RUN: %target-run-simple-swift( -target %target-swift-5.1-abi-triple %import-libdispatch -parse-as-library -swift-version 5 -strict-concurrency=complete -enable-upcoming-feature NonisolatedNonsendingByDefault) | %FileCheck %s +// REQUIRES: swift_feature_NonisolatedNonsendingByDefault // REQUIRES: executable_test // REQUIRES: concurrency diff --git a/test/Concurrency/Runtime/async_task_detach.swift b/test/Concurrency/Runtime/async_task_detach.swift index 60262638a9824..0a951eab59fc4 100644 --- a/test/Concurrency/Runtime/async_task_detach.swift +++ b/test/Concurrency/Runtime/async_task_detach.swift @@ -1,4 +1,6 @@ // RUN: %target-run-simple-swift( -target %target-swift-5.1-abi-triple -parse-as-library) | %FileCheck %s +// RUN: %target-run-simple-swift( -target %target-swift-5.1-abi-triple -parse-as-library -swift-version 5 -strict-concurrency=complete -enable-upcoming-feature NonisolatedNonsendingByDefault) | %FileCheck %s +// REQUIRES: swift_feature_NonisolatedNonsendingByDefault // REQUIRES: executable_test // REQUIRES: concurrency diff --git a/test/Concurrency/Runtime/async_task_executor_default_actor_funcs.swift b/test/Concurrency/Runtime/async_task_executor_default_actor_funcs.swift index cb75f8ecb105b..73eb1d0644fd3 100644 --- a/test/Concurrency/Runtime/async_task_executor_default_actor_funcs.swift +++ b/test/Concurrency/Runtime/async_task_executor_default_actor_funcs.swift @@ -1,4 +1,6 @@ // RUN: %target-run-simple-swift( -Xfrontend -disable-availability-checking %import-libdispatch -parse-as-library ) +// RUN: %target-run-simple-swift( -Xfrontend -disable-availability-checking %import-libdispatch -parse-as-library -swift-version 5 -strict-concurrency=complete -enable-upcoming-feature NonisolatedNonsendingByDefault) +// REQUIRES: swift_feature_NonisolatedNonsendingByDefault // REQUIRES: executable_test // REQUIRES: concurrency diff --git a/test/Concurrency/Runtime/async_task_executor_nonisolated_async_func.swift b/test/Concurrency/Runtime/async_task_executor_nonisolated_async_func.swift index a5a0da5954030..e652914b4d3c9 100644 --- a/test/Concurrency/Runtime/async_task_executor_nonisolated_async_func.swift +++ b/test/Concurrency/Runtime/async_task_executor_nonisolated_async_func.swift @@ -1,4 +1,6 @@ // RUN: %target-run-simple-swift( -Xfrontend -disable-availability-checking %import-libdispatch -parse-as-library ) +// RUN: %target-run-simple-swift( -Xfrontend -disable-availability-checking %import-libdispatch -parse-as-library -swift-version 5 -strict-concurrency=complete -enable-upcoming-feature NonisolatedNonsendingByDefault) +// REQUIRES: swift_feature_NonisolatedNonsendingByDefault // REQUIRES: executable_test // REQUIRES: concurrency diff --git a/test/Concurrency/Runtime/async_task_executor_nsobject.swift b/test/Concurrency/Runtime/async_task_executor_nsobject.swift index d652f7d246f01..61a825e5f3e1b 100644 --- a/test/Concurrency/Runtime/async_task_executor_nsobject.swift +++ b/test/Concurrency/Runtime/async_task_executor_nsobject.swift @@ -1,4 +1,6 @@ // RUN: %target-run-simple-swift( -Xfrontend -disable-availability-checking %import-libdispatch -parse-as-library ) +// RUN: %target-run-simple-swift( -Xfrontend -disable-availability-checking %import-libdispatch -parse-as-library -swift-version 5 -strict-concurrency=complete -enable-upcoming-feature NonisolatedNonsendingByDefault) +// REQUIRES: swift_feature_NonisolatedNonsendingByDefault // REQUIRES: executable_test // REQUIRES: concurrency diff --git a/test/Concurrency/Runtime/async_task_executor_structured_concurrency.swift b/test/Concurrency/Runtime/async_task_executor_structured_concurrency.swift index 3d2805bf8274b..4a7967d189b3d 100644 --- a/test/Concurrency/Runtime/async_task_executor_structured_concurrency.swift +++ b/test/Concurrency/Runtime/async_task_executor_structured_concurrency.swift @@ -1,4 +1,6 @@ // RUN: %target-run-simple-swift( -Xfrontend -disable-availability-checking %import-libdispatch -parse-as-library ) +// RUN: %target-run-simple-swift( -Xfrontend -disable-availability-checking %import-libdispatch -parse-as-library -swift-version 5 -strict-concurrency=complete -enable-upcoming-feature NonisolatedNonsendingByDefault) +// REQUIRES: swift_feature_NonisolatedNonsendingByDefault // REQUIRES: executable_test // REQUIRES: concurrency diff --git a/test/Concurrency/Runtime/async_task_executor_unstructured_task_ownership.swift b/test/Concurrency/Runtime/async_task_executor_unstructured_task_ownership.swift index ae76d31dc55ee..85e939d8bf068 100644 --- a/test/Concurrency/Runtime/async_task_executor_unstructured_task_ownership.swift +++ b/test/Concurrency/Runtime/async_task_executor_unstructured_task_ownership.swift @@ -1,4 +1,6 @@ // RUN: %target-run-simple-swift( -Xfrontend -disable-availability-checking %import-libdispatch -parse-as-library ) | %FileCheck %s +// RUN: %target-run-simple-swift( -Xfrontend -disable-availability-checking %import-libdispatch -parse-as-library -swift-version 5 -strict-concurrency=complete -enable-upcoming-feature NonisolatedNonsendingByDefault) | %FileCheck %s +// REQUIRES: swift_feature_NonisolatedNonsendingByDefault // REQUIRES: executable_test // REQUIRES: concurrency diff --git a/test/Concurrency/Runtime/async_task_executor_withExecutor.swift b/test/Concurrency/Runtime/async_task_executor_withExecutor.swift index f714c2a9e2300..51bbc08ea1b8d 100644 --- a/test/Concurrency/Runtime/async_task_executor_withExecutor.swift +++ b/test/Concurrency/Runtime/async_task_executor_withExecutor.swift @@ -1,4 +1,6 @@ // RUN: %target-run-simple-swift( -Xfrontend -disable-availability-checking %import-libdispatch -parse-as-library ) +// RUN: %target-run-simple-swift( -Xfrontend -disable-availability-checking %import-libdispatch -parse-as-library -swift-version 5 -strict-concurrency=complete -enable-upcoming-feature NonisolatedNonsendingByDefault) +// REQUIRES: swift_feature_NonisolatedNonsendingByDefault // REQUIRES: executable_test // REQUIRES: concurrency diff --git a/test/Concurrency/Runtime/async_task_handle_cancellation.swift b/test/Concurrency/Runtime/async_task_handle_cancellation.swift index 822abd6c3278f..7ff6e6b3d1e73 100644 --- a/test/Concurrency/Runtime/async_task_handle_cancellation.swift +++ b/test/Concurrency/Runtime/async_task_handle_cancellation.swift @@ -1,4 +1,6 @@ // RUN: %target-run-simple-swift( -target %target-swift-5.1-abi-triple %import-libdispatch -parse-as-library) | %FileCheck %s --dump-input=always +// RUN: %target-run-simple-swift( -target %target-swift-5.1-abi-triple %import-libdispatch -parse-as-library -swift-version 5 -strict-concurrency=complete -enable-upcoming-feature NonisolatedNonsendingByDefault) | %FileCheck %s --dump-input=always +// REQUIRES: swift_feature_NonisolatedNonsendingByDefault // REQUIRES: executable_test // REQUIRES: concurrency diff --git a/test/Concurrency/Runtime/async_task_locals_async_let.swift b/test/Concurrency/Runtime/async_task_locals_async_let.swift index aa6b980d0e7e5..9089f85037bec 100644 --- a/test/Concurrency/Runtime/async_task_locals_async_let.swift +++ b/test/Concurrency/Runtime/async_task_locals_async_let.swift @@ -1,4 +1,6 @@ // RUN: %target-run-simple-swift( -plugin-path %swift-plugin-dir -target %target-swift-5.1-abi-triple -parse-as-library) | %FileCheck %s +// RUN: %target-run-simple-swift( -plugin-path %swift-plugin-dir -target %target-swift-5.1-abi-triple -parse-as-library -swift-version 5 -strict-concurrency=complete -enable-upcoming-feature NonisolatedNonsendingByDefault) | %FileCheck %s +// REQUIRES: swift_feature_NonisolatedNonsendingByDefault // REQUIRES: executable_test // REQUIRES: concurrency diff --git a/test/Concurrency/Runtime/async_task_locals_basic.swift b/test/Concurrency/Runtime/async_task_locals_basic.swift index b8cde99791d34..58af953c3868a 100644 --- a/test/Concurrency/Runtime/async_task_locals_basic.swift +++ b/test/Concurrency/Runtime/async_task_locals_basic.swift @@ -1,4 +1,6 @@ // RUN: %target-run-simple-swift( -plugin-path %swift-plugin-dir -parse-as-library %import-libdispatch) | %FileCheck %s +// RUN: %target-run-simple-swift( -plugin-path %swift-plugin-dir -parse-as-library %import-libdispatch -swift-version 5 -strict-concurrency=complete -enable-upcoming-feature NonisolatedNonsendingByDefault) | %FileCheck %s +// REQUIRES: swift_feature_NonisolatedNonsendingByDefault // REQUIRES: executable_test // REQUIRES: concurrency diff --git a/test/Concurrency/Runtime/async_task_locals_copy_to_async.swift b/test/Concurrency/Runtime/async_task_locals_copy_to_async.swift index bb9aaae6b8538..fb97b9ab1abcd 100644 --- a/test/Concurrency/Runtime/async_task_locals_copy_to_async.swift +++ b/test/Concurrency/Runtime/async_task_locals_copy_to_async.swift @@ -1,5 +1,7 @@ // REQUIRES: rdar80824152 // RUN: %target-run-simple-swift( -plugin-path %swift-plugin-dir -target %target-swift-5.1-abi-triple -parse-as-library %import-libdispatch) | %FileCheck %s +// RUN: %target-run-simple-swift( -plugin-path %swift-plugin-dir -target %target-swift-5.1-abi-triple -parse-as-library %import-libdispatch -swift-version 5 -strict-concurrency=complete -enable-upcoming-feature NonisolatedNonsendingByDefault) | %FileCheck %s +// REQUIRES: swift_feature_NonisolatedNonsendingByDefault // REQUIRES: executable_test // REQUIRES: concurrency diff --git a/test/Concurrency/Runtime/async_task_locals_copy_to_sync.swift b/test/Concurrency/Runtime/async_task_locals_copy_to_sync.swift index 9ebaf08c40916..301f07c49f265 100644 --- a/test/Concurrency/Runtime/async_task_locals_copy_to_sync.swift +++ b/test/Concurrency/Runtime/async_task_locals_copy_to_sync.swift @@ -1,4 +1,6 @@ // RUN: %target-run-simple-swift( -plugin-path %swift-plugin-dir -target %target-swift-5.1-abi-triple -parse-as-library %import-libdispatch) | %FileCheck %s +// RUN: %target-run-simple-swift( -plugin-path %swift-plugin-dir -target %target-swift-5.1-abi-triple -parse-as-library %import-libdispatch -swift-version 5 -strict-concurrency=complete -enable-upcoming-feature NonisolatedNonsendingByDefault) | %FileCheck %s +// REQUIRES: swift_feature_NonisolatedNonsendingByDefault // REQUIRES: executable_test // REQUIRES: concurrency diff --git a/test/Concurrency/Runtime/async_task_locals_groups.swift b/test/Concurrency/Runtime/async_task_locals_groups.swift index 02ee42b2f855e..d4ff7ae92950e 100644 --- a/test/Concurrency/Runtime/async_task_locals_groups.swift +++ b/test/Concurrency/Runtime/async_task_locals_groups.swift @@ -1,4 +1,6 @@ // RUN: %target-run-simple-swift( -plugin-path %swift-plugin-dir -target %target-swift-5.1-abi-triple -parse-as-library %import-libdispatch) | %FileCheck %s +// RUN: %target-run-simple-swift( -plugin-path %swift-plugin-dir -target %target-swift-5.1-abi-triple -parse-as-library %import-libdispatch -swift-version 5 -strict-concurrency=complete -enable-upcoming-feature NonisolatedNonsendingByDefault) | %FileCheck %s +// REQUIRES: swift_feature_NonisolatedNonsendingByDefault // REQUIRES: executable_test // REQUIRES: concurrency diff --git a/test/Concurrency/Runtime/async_task_locals_in_task_group_may_need_to_copy.swift b/test/Concurrency/Runtime/async_task_locals_in_task_group_may_need_to_copy.swift index 896c7bc7f2ac8..4e4c752ea0a88 100644 --- a/test/Concurrency/Runtime/async_task_locals_in_task_group_may_need_to_copy.swift +++ b/test/Concurrency/Runtime/async_task_locals_in_task_group_may_need_to_copy.swift @@ -1,4 +1,6 @@ // RUN: %target-run-simple-swift( -plugin-path %swift-plugin-dir -Xfrontend -strict-concurrency=complete -target %target-swift-5.1-abi-triple -parse-as-library %import-libdispatch) | %FileCheck %s --dump-input=always +// RUN: %target-run-simple-swift( -plugin-path %swift-plugin-dir -Xfrontend -strict-concurrency=complete -target %target-swift-5.1-abi-triple -parse-as-library %import-libdispatch -swift-version 5 -strict-concurrency=complete -enable-upcoming-feature NonisolatedNonsendingByDefault) | %FileCheck %s --dump-input=always +// REQUIRES: swift_feature_NonisolatedNonsendingByDefault // REQUIRES: executable_test // REQUIRES: concurrency diff --git a/test/Concurrency/Runtime/async_task_locals_prevent_illegal_use_but_specific_case_is_ok.swift b/test/Concurrency/Runtime/async_task_locals_prevent_illegal_use_but_specific_case_is_ok.swift index 1944c168542f0..04b83fd1d225a 100644 --- a/test/Concurrency/Runtime/async_task_locals_prevent_illegal_use_but_specific_case_is_ok.swift +++ b/test/Concurrency/Runtime/async_task_locals_prevent_illegal_use_but_specific_case_is_ok.swift @@ -1,4 +1,6 @@ // RUN: %target-run-simple-swift( -plugin-path %swift-plugin-dir -target %target-swift-5.1-abi-triple -parse-as-library %import-libdispatch) | %FileCheck %s --dump-input=always +// RUN: %target-run-simple-swift( -plugin-path %swift-plugin-dir -target %target-swift-5.1-abi-triple -parse-as-library %import-libdispatch -swift-version 5 -strict-concurrency=complete -enable-upcoming-feature NonisolatedNonsendingByDefault) | %FileCheck %s --dump-input=always +// REQUIRES: swift_feature_NonisolatedNonsendingByDefault // REQUIRES: executable_test // REQUIRES: concurrency diff --git a/test/Concurrency/Runtime/async_task_locals_synchronous_bind.swift b/test/Concurrency/Runtime/async_task_locals_synchronous_bind.swift index b5f181c49ae95..1ea38a65b000b 100644 --- a/test/Concurrency/Runtime/async_task_locals_synchronous_bind.swift +++ b/test/Concurrency/Runtime/async_task_locals_synchronous_bind.swift @@ -1,4 +1,6 @@ // RUN: %target-run-simple-swift( -plugin-path %swift-plugin-dir -target %target-swift-5.1-abi-triple -parse-as-library) | %FileCheck %s +// RUN: %target-run-simple-swift( -plugin-path %swift-plugin-dir -target %target-swift-5.1-abi-triple -parse-as-library -swift-version 5 -strict-concurrency=complete -enable-upcoming-feature NonisolatedNonsendingByDefault) | %FileCheck %s +// REQUIRES: swift_feature_NonisolatedNonsendingByDefault // REQUIRES: executable_test // REQUIRES: concurrency diff --git a/test/Concurrency/Runtime/async_task_locals_wrapper.swift b/test/Concurrency/Runtime/async_task_locals_wrapper.swift index 7d70843920795..d407efca6d18e 100644 --- a/test/Concurrency/Runtime/async_task_locals_wrapper.swift +++ b/test/Concurrency/Runtime/async_task_locals_wrapper.swift @@ -1,4 +1,6 @@ // RUN: %target-run-simple-swift( -plugin-path %swift-plugin-dir -target %target-swift-5.1-abi-triple -parse-as-library) | %FileCheck %s +// RUN: %target-run-simple-swift( -plugin-path %swift-plugin-dir -target %target-swift-5.1-abi-triple -parse-as-library -swift-version 5 -strict-concurrency=complete -enable-upcoming-feature NonisolatedNonsendingByDefault) | %FileCheck %s +// REQUIRES: swift_feature_NonisolatedNonsendingByDefault // REQUIRES: executable_test // REQUIRES: concurrency diff --git a/test/Concurrency/Runtime/async_task_naming.swift b/test/Concurrency/Runtime/async_task_naming.swift index 7b597a1271dd6..5dd33fdb919a5 100644 --- a/test/Concurrency/Runtime/async_task_naming.swift +++ b/test/Concurrency/Runtime/async_task_naming.swift @@ -1,4 +1,6 @@ // RUN: %target-run-simple-swift( -Xfrontend -disable-availability-checking) | %FileCheck %s +// RUN: %target-run-simple-swift( -Xfrontend -disable-availability-checking -swift-version 5 -strict-concurrency=complete -enable-upcoming-feature NonisolatedNonsendingByDefault) | %FileCheck %s +// REQUIRES: swift_feature_NonisolatedNonsendingByDefault // REQUIRES: executable_test // REQUIRES: concurrency diff --git a/test/Concurrency/Runtime/async_task_priority_current.swift b/test/Concurrency/Runtime/async_task_priority_current.swift index 58b0f6fc40967..cae419fcf5753 100644 --- a/test/Concurrency/Runtime/async_task_priority_current.swift +++ b/test/Concurrency/Runtime/async_task_priority_current.swift @@ -1,4 +1,6 @@ // RUN: %target-run-simple-swift( -target %target-swift-5.1-abi-triple %import-libdispatch -parse-as-library) | %FileCheck --dump-input=always %s +// RUN: %target-run-simple-swift( -target %target-swift-5.1-abi-triple %import-libdispatch -parse-as-library -swift-version 5 -strict-concurrency=complete -enable-upcoming-feature NonisolatedNonsendingByDefault) | %FileCheck --dump-input=always %s +// REQUIRES: swift_feature_NonisolatedNonsendingByDefault // REQUIRES: executable_test // REQUIRES: concurrency diff --git a/test/Concurrency/Runtime/async_task_sleep.swift b/test/Concurrency/Runtime/async_task_sleep.swift index a08429c4502f0..926fae5aa0626 100644 --- a/test/Concurrency/Runtime/async_task_sleep.swift +++ b/test/Concurrency/Runtime/async_task_sleep.swift @@ -1,4 +1,6 @@ // RUN: %target-run-simple-swift( -target %target-swift-5.1-abi-triple %import-libdispatch -parse-as-library) | %FileCheck %s --dump-input always +// RUN: %target-run-simple-swift( -target %target-swift-5.1-abi-triple %import-libdispatch -parse-as-library -swift-version 5 -strict-concurrency=complete -enable-upcoming-feature NonisolatedNonsendingByDefault) | %FileCheck %s --dump-input always +// REQUIRES: swift_feature_NonisolatedNonsendingByDefault // REQUIRES: executable_test // REQUIRES: concurrency // REQUIRES: libdispatch diff --git a/test/Concurrency/Runtime/async_task_sleep_cancel.swift b/test/Concurrency/Runtime/async_task_sleep_cancel.swift index 245f960f792f1..03429ad31caec 100644 --- a/test/Concurrency/Runtime/async_task_sleep_cancel.swift +++ b/test/Concurrency/Runtime/async_task_sleep_cancel.swift @@ -1,4 +1,6 @@ // RUN: %target-run-simple-swift( -target %target-swift-5.1-abi-triple %import-libdispatch -parse-as-library) | %FileCheck %s --dump-input always +// RUN: %target-run-simple-swift( -target %target-swift-5.1-abi-triple %import-libdispatch -parse-as-library -swift-version 5 -strict-concurrency=complete -enable-upcoming-feature NonisolatedNonsendingByDefault) | %FileCheck %s --dump-input always +// REQUIRES: swift_feature_NonisolatedNonsendingByDefault // REQUIRES: executable_test // REQUIRES: concurrency // REQUIRES: libdispatch diff --git a/test/Concurrency/Runtime/async_task_withUnsafeCurrentTask.swift b/test/Concurrency/Runtime/async_task_withUnsafeCurrentTask.swift index 5aa0983468caf..5547e4d95e8b5 100644 --- a/test/Concurrency/Runtime/async_task_withUnsafeCurrentTask.swift +++ b/test/Concurrency/Runtime/async_task_withUnsafeCurrentTask.swift @@ -1,4 +1,6 @@ // RUN: %target-run-simple-swift( -target %target-swift-5.1-abi-triple -parse-as-library) 2>&1 | %FileCheck %s --dump-input=always +// RUN: %target-run-simple-swift( -target %target-swift-5.1-abi-triple -parse-as-library -swift-version 5 -strict-concurrency=complete -enable-upcoming-feature NonisolatedNonsendingByDefault) 2>&1 | %FileCheck %s --dump-input=always +// REQUIRES: swift_feature_NonisolatedNonsendingByDefault // REQUIRES: executable_test // REQUIRES: concurrency // REQUIRES: swift_task_debug_log diff --git a/test/Concurrency/Runtime/async_task_yield.swift b/test/Concurrency/Runtime/async_task_yield.swift index 07110f890ad94..34ae1e2db00b4 100644 --- a/test/Concurrency/Runtime/async_task_yield.swift +++ b/test/Concurrency/Runtime/async_task_yield.swift @@ -1,4 +1,6 @@ // RUN: %target-run-simple-swift(-target %target-swift-5.1-abi-triple -parse-as-library) +// RUN: %target-run-simple-swift(-target %target-swift-5.1-abi-triple -parse-as-library -swift-version 5 -strict-concurrency=complete -enable-upcoming-feature NonisolatedNonsendingByDefault) +// REQUIRES: swift_feature_NonisolatedNonsendingByDefault // REQUIRES: executable_test // REQUIRES: concurrency diff --git a/test/Concurrency/Runtime/async_taskgroup_addUnlessCancelled.swift b/test/Concurrency/Runtime/async_taskgroup_addUnlessCancelled.swift index 12bfa0abc2641..da68ea317426e 100644 --- a/test/Concurrency/Runtime/async_taskgroup_addUnlessCancelled.swift +++ b/test/Concurrency/Runtime/async_taskgroup_addUnlessCancelled.swift @@ -1,4 +1,6 @@ // RUN: %target-run-simple-swift( -target %target-swift-5.1-abi-triple -parse-as-library) | %FileCheck %s +// RUN: %target-run-simple-swift( -target %target-swift-5.1-abi-triple -parse-as-library -swift-version 5 -strict-concurrency=complete -enable-upcoming-feature NonisolatedNonsendingByDefault) | %FileCheck %s +// REQUIRES: swift_feature_NonisolatedNonsendingByDefault // REQUIRES: executable_test // REQUIRES: concurrency diff --git a/test/Concurrency/Runtime/async_taskgroup_asynciterator_semantics.swift b/test/Concurrency/Runtime/async_taskgroup_asynciterator_semantics.swift index 9abefe8417a59..616e7e790d6fd 100644 --- a/test/Concurrency/Runtime/async_taskgroup_asynciterator_semantics.swift +++ b/test/Concurrency/Runtime/async_taskgroup_asynciterator_semantics.swift @@ -1,4 +1,6 @@ // RUN: %target-run-simple-swift( -target %target-swift-5.1-abi-triple -parse-as-library) | %FileCheck %s --dump-input=always +// RUN: %target-run-simple-swift( -target %target-swift-5.1-abi-triple -parse-as-library -swift-version 5 -strict-concurrency=complete -enable-upcoming-feature NonisolatedNonsendingByDefault) | %FileCheck %s --dump-input=always +// REQUIRES: swift_feature_NonisolatedNonsendingByDefault // REQUIRES: executable_test // REQUIRES: concurrency diff --git a/test/Concurrency/Runtime/async_taskgroup_cancelAll_only_specific_group.swift b/test/Concurrency/Runtime/async_taskgroup_cancelAll_only_specific_group.swift index 1ed9c55d0d84a..9c8895ec1802c 100644 --- a/test/Concurrency/Runtime/async_taskgroup_cancelAll_only_specific_group.swift +++ b/test/Concurrency/Runtime/async_taskgroup_cancelAll_only_specific_group.swift @@ -1,4 +1,6 @@ // RUN: %target-run-simple-swift( -target %target-swift-5.1-abi-triple %import-libdispatch -parse-as-library) | %FileCheck %s --dump-input always +// RUN: %target-run-simple-swift( -target %target-swift-5.1-abi-triple %import-libdispatch -parse-as-library -swift-version 5 -strict-concurrency=complete -enable-upcoming-feature NonisolatedNonsendingByDefault) | %FileCheck %s --dump-input always +// REQUIRES: swift_feature_NonisolatedNonsendingByDefault // REQUIRES: executable_test // REQUIRES: concurrency diff --git a/test/Concurrency/Runtime/async_taskgroup_cancel_parent_affects_group.swift b/test/Concurrency/Runtime/async_taskgroup_cancel_parent_affects_group.swift index 4699feb3726ad..267572f167334 100644 --- a/test/Concurrency/Runtime/async_taskgroup_cancel_parent_affects_group.swift +++ b/test/Concurrency/Runtime/async_taskgroup_cancel_parent_affects_group.swift @@ -1,4 +1,6 @@ // RUN: %target-run-simple-swift( -target %target-swift-5.1-abi-triple %import-libdispatch -parse-as-library) | %FileCheck %s --dump-input always +// RUN: %target-run-simple-swift( -target %target-swift-5.1-abi-triple %import-libdispatch -parse-as-library -swift-version 5 -strict-concurrency=complete -enable-upcoming-feature NonisolatedNonsendingByDefault) | %FileCheck %s --dump-input always +// REQUIRES: swift_feature_NonisolatedNonsendingByDefault // REQUIRES: executable_test // REQUIRES: concurrency diff --git a/test/Concurrency/Runtime/async_taskgroup_cancel_then_completions.swift b/test/Concurrency/Runtime/async_taskgroup_cancel_then_completions.swift index 640155502d2b8..18ef79a1a1d06 100644 --- a/test/Concurrency/Runtime/async_taskgroup_cancel_then_completions.swift +++ b/test/Concurrency/Runtime/async_taskgroup_cancel_then_completions.swift @@ -1,4 +1,6 @@ // RUN: %target-run-simple-swift( -target %target-swift-5.1-abi-triple %import-libdispatch -parse-as-library) | %FileCheck %s --dump-input always +// RUN: %target-run-simple-swift( -target %target-swift-5.1-abi-triple %import-libdispatch -parse-as-library -swift-version 5 -strict-concurrency=complete -enable-upcoming-feature NonisolatedNonsendingByDefault) | %FileCheck %s --dump-input always +// REQUIRES: swift_feature_NonisolatedNonsendingByDefault // REQUIRES: executable_test // REQUIRES: concurrency diff --git a/test/Concurrency/Runtime/async_taskgroup_cancel_then_spawn.swift b/test/Concurrency/Runtime/async_taskgroup_cancel_then_spawn.swift index d97d5330ea0f2..c313a37c56cd1 100644 --- a/test/Concurrency/Runtime/async_taskgroup_cancel_then_spawn.swift +++ b/test/Concurrency/Runtime/async_taskgroup_cancel_then_spawn.swift @@ -1,4 +1,6 @@ // RUN: %target-run-simple-swift( -target %target-swift-5.1-abi-triple %import-libdispatch -parse-as-library) | %FileCheck %s --dump-input always +// RUN: %target-run-simple-swift( -target %target-swift-5.1-abi-triple %import-libdispatch -parse-as-library -swift-version 5 -strict-concurrency=complete -enable-upcoming-feature NonisolatedNonsendingByDefault) | %FileCheck %s --dump-input always +// REQUIRES: swift_feature_NonisolatedNonsendingByDefault // REQUIRES: executable_test // REQUIRES: concurrency diff --git a/test/Concurrency/Runtime/async_taskgroup_discarding.swift b/test/Concurrency/Runtime/async_taskgroup_discarding.swift index 7bb390ae0bcce..9684d834a7496 100644 --- a/test/Concurrency/Runtime/async_taskgroup_discarding.swift +++ b/test/Concurrency/Runtime/async_taskgroup_discarding.swift @@ -1,4 +1,6 @@ // RUN: %target-run-simple-swift( -Xfrontend -disable-availability-checking -parse-as-library) | %FileCheck %s +// RUN: %target-run-simple-swift( -Xfrontend -disable-availability-checking -parse-as-library -swift-version 5 -strict-concurrency=complete -enable-upcoming-feature NonisolatedNonsendingByDefault) | %FileCheck %s +// REQUIRES: swift_feature_NonisolatedNonsendingByDefault // TODO: move to target-run-simple-leaks-swift once CI is using at least Xcode 14.3 // REQUIRES: concurrency diff --git a/test/Concurrency/Runtime/async_taskgroup_discarding_dontLeak.swift b/test/Concurrency/Runtime/async_taskgroup_discarding_dontLeak.swift index fe185503dbbbd..cdc4dc8a2bd40 100644 --- a/test/Concurrency/Runtime/async_taskgroup_discarding_dontLeak.swift +++ b/test/Concurrency/Runtime/async_taskgroup_discarding_dontLeak.swift @@ -1,4 +1,6 @@ // RUN: %target-run-simple-swift( -Xfrontend -disable-availability-checking -parse-as-library) | %FileCheck %s --dump-input=always +// RUN: %target-run-simple-swift( -Xfrontend -disable-availability-checking -parse-as-library -swift-version 5 -strict-concurrency=complete -enable-upcoming-feature NonisolatedNonsendingByDefault) | %FileCheck %s --dump-input=always +// REQUIRES: swift_feature_NonisolatedNonsendingByDefault // TODO: move to target-run-simple-leaks-swift once CI is using at least Xcode 14.3 // REQUIRES: concurrency diff --git a/test/Concurrency/Runtime/async_taskgroup_discarding_dontLeak_class_error.swift b/test/Concurrency/Runtime/async_taskgroup_discarding_dontLeak_class_error.swift index 599ea8455f1c4..566ab948654d8 100644 --- a/test/Concurrency/Runtime/async_taskgroup_discarding_dontLeak_class_error.swift +++ b/test/Concurrency/Runtime/async_taskgroup_discarding_dontLeak_class_error.swift @@ -1,4 +1,6 @@ // RUN: %target-run-simple-swift( -Xfrontend -disable-availability-checking -parse-as-library) | %FileCheck %s --dump-input=always +// RUN: %target-run-simple-swift( -Xfrontend -disable-availability-checking -parse-as-library -swift-version 5 -strict-concurrency=complete -enable-upcoming-feature NonisolatedNonsendingByDefault) | %FileCheck %s --dump-input=always +// REQUIRES: swift_feature_NonisolatedNonsendingByDefault // REQUIRES: concurrency // REQUIRES: executable_test diff --git a/test/Concurrency/Runtime/async_taskgroup_discarding_neverConsumingTasks.swift b/test/Concurrency/Runtime/async_taskgroup_discarding_neverConsumingTasks.swift index f9f15389482b7..e3f850073327a 100644 --- a/test/Concurrency/Runtime/async_taskgroup_discarding_neverConsumingTasks.swift +++ b/test/Concurrency/Runtime/async_taskgroup_discarding_neverConsumingTasks.swift @@ -1,4 +1,6 @@ // RUN: %target-run-simple-swift( -Xfrontend -disable-availability-checking -parse-as-library) | %FileCheck %s --dump-input=always +// RUN: %target-run-simple-swift( -Xfrontend -disable-availability-checking -parse-as-library -swift-version 5 -strict-concurrency=complete -enable-upcoming-feature NonisolatedNonsendingByDefault) | %FileCheck %s --dump-input=always +// REQUIRES: swift_feature_NonisolatedNonsendingByDefault // REQUIRES: executable_test // REQUIRES: concurrency // REQUIRES: concurrency_runtime diff --git a/test/Concurrency/Runtime/async_taskgroup_dontLeakTasks.swift b/test/Concurrency/Runtime/async_taskgroup_dontLeakTasks.swift index 4ae3cf7bd8990..ef6cbfa3d00d1 100644 --- a/test/Concurrency/Runtime/async_taskgroup_dontLeakTasks.swift +++ b/test/Concurrency/Runtime/async_taskgroup_dontLeakTasks.swift @@ -1,4 +1,6 @@ // RUN: %target-run-simple-swift( -target %target-swift-5.1-abi-triple -parse-as-library) | %FileCheck %s +// RUN: %target-run-simple-swift( -target %target-swift-5.1-abi-triple -parse-as-library -swift-version 5 -strict-concurrency=complete -enable-upcoming-feature NonisolatedNonsendingByDefault) | %FileCheck %s +// REQUIRES: swift_feature_NonisolatedNonsendingByDefault // TODO: move to target-run-simple-leaks-swift once CI is using at least Xcode 14.3 // Task group addTask is not supported in freestanding mode diff --git a/test/Concurrency/Runtime/async_taskgroup_is_asyncsequence.swift b/test/Concurrency/Runtime/async_taskgroup_is_asyncsequence.swift index 5ad856a840f90..b5112153de790 100644 --- a/test/Concurrency/Runtime/async_taskgroup_is_asyncsequence.swift +++ b/test/Concurrency/Runtime/async_taskgroup_is_asyncsequence.swift @@ -1,4 +1,6 @@ // RUN: %target-run-simple-swift( -target %target-swift-5.1-abi-triple -parse-as-library) | %FileCheck %s --dump-input=always +// RUN: %target-run-simple-swift( -target %target-swift-5.1-abi-triple -parse-as-library -swift-version 5 -strict-concurrency=complete -enable-upcoming-feature NonisolatedNonsendingByDefault) | %FileCheck %s --dump-input=always +// REQUIRES: swift_feature_NonisolatedNonsendingByDefault // REQUIRES: executable_test // REQUIRES: concurrency diff --git a/test/Concurrency/Runtime/async_taskgroup_is_empty.swift b/test/Concurrency/Runtime/async_taskgroup_is_empty.swift index 63d426c55d546..4621e0b5db2c6 100644 --- a/test/Concurrency/Runtime/async_taskgroup_is_empty.swift +++ b/test/Concurrency/Runtime/async_taskgroup_is_empty.swift @@ -1,4 +1,6 @@ // RUN: %target-run-simple-swift( -target %target-swift-5.1-abi-triple %import-libdispatch -parse-as-library) | %FileCheck %s +// RUN: %target-run-simple-swift( -target %target-swift-5.1-abi-triple %import-libdispatch -parse-as-library -swift-version 5 -strict-concurrency=complete -enable-upcoming-feature NonisolatedNonsendingByDefault) | %FileCheck %s +// REQUIRES: swift_feature_NonisolatedNonsendingByDefault // REQUIRES: executable_test // REQUIRES: concurrency diff --git a/test/Concurrency/Runtime/async_taskgroup_next_not_invoked_cancelAll.swift b/test/Concurrency/Runtime/async_taskgroup_next_not_invoked_cancelAll.swift index a6323369c9fd7..99fafc55a45ed 100644 --- a/test/Concurrency/Runtime/async_taskgroup_next_not_invoked_cancelAll.swift +++ b/test/Concurrency/Runtime/async_taskgroup_next_not_invoked_cancelAll.swift @@ -1,4 +1,6 @@ // RUN: %target-run-simple-swift( -target %target-swift-5.1-abi-triple %import-libdispatch -parse-as-library) | %FileCheck %s --dump-input=always +// RUN: %target-run-simple-swift( -target %target-swift-5.1-abi-triple %import-libdispatch -parse-as-library -swift-version 5 -strict-concurrency=complete -enable-upcoming-feature NonisolatedNonsendingByDefault) | %FileCheck %s --dump-input=always +// REQUIRES: swift_feature_NonisolatedNonsendingByDefault // REQUIRES: executable_test // REQUIRES: concurrency diff --git a/test/Concurrency/Runtime/async_taskgroup_next_not_invoked_without_cancelAll.swift b/test/Concurrency/Runtime/async_taskgroup_next_not_invoked_without_cancelAll.swift index b6375965d06c3..22062f13b0a18 100644 --- a/test/Concurrency/Runtime/async_taskgroup_next_not_invoked_without_cancelAll.swift +++ b/test/Concurrency/Runtime/async_taskgroup_next_not_invoked_without_cancelAll.swift @@ -1,4 +1,6 @@ // RUN: %target-run-simple-swift( -target %target-swift-5.1-abi-triple %import-libdispatch -parse-as-library) | %FileCheck %s --dump-input=always +// RUN: %target-run-simple-swift( -target %target-swift-5.1-abi-triple %import-libdispatch -parse-as-library -swift-version 5 -strict-concurrency=complete -enable-upcoming-feature NonisolatedNonsendingByDefault) | %FileCheck %s --dump-input=always +// REQUIRES: swift_feature_NonisolatedNonsendingByDefault // REQUIRES: executable_test // REQUIRES: concurrency diff --git a/test/Concurrency/Runtime/async_taskgroup_next_on_completed.swift b/test/Concurrency/Runtime/async_taskgroup_next_on_completed.swift index fcf7206a0654a..f9df0697a7e97 100644 --- a/test/Concurrency/Runtime/async_taskgroup_next_on_completed.swift +++ b/test/Concurrency/Runtime/async_taskgroup_next_on_completed.swift @@ -1,4 +1,6 @@ // RUN: %target-run-simple-swift( -target %target-swift-5.1-abi-triple %import-libdispatch -parse-as-library) | %FileCheck %s --dump-input=always +// RUN: %target-run-simple-swift( -target %target-swift-5.1-abi-triple %import-libdispatch -parse-as-library -swift-version 5 -strict-concurrency=complete -enable-upcoming-feature NonisolatedNonsendingByDefault) | %FileCheck %s --dump-input=always +// REQUIRES: swift_feature_NonisolatedNonsendingByDefault // REQUIRES: executable_test // REQUIRES: concurrency diff --git a/test/Concurrency/Runtime/async_taskgroup_next_on_pending.swift b/test/Concurrency/Runtime/async_taskgroup_next_on_pending.swift index 18fdb7191dbac..a79899e36bf34 100644 --- a/test/Concurrency/Runtime/async_taskgroup_next_on_pending.swift +++ b/test/Concurrency/Runtime/async_taskgroup_next_on_pending.swift @@ -1,4 +1,6 @@ // RUN: %target-run-simple-swift( -Xfrontend -disable-availability-checking %import-libdispatch -parse-as-library) | %FileCheck %s --dump-input=always +// RUN: %target-run-simple-swift( -Xfrontend -disable-availability-checking %import-libdispatch -parse-as-library -swift-version 5 -strict-concurrency=complete -enable-upcoming-feature NonisolatedNonsendingByDefault) | %FileCheck %s --dump-input=always +// REQUIRES: swift_feature_NonisolatedNonsendingByDefault // REQUIRES: executable_test // REQUIRES: concurrency diff --git a/test/Concurrency/Runtime/async_taskgroup_throw_recover.swift b/test/Concurrency/Runtime/async_taskgroup_throw_recover.swift index a6225ab24a4b9..8c0534c078c3a 100644 --- a/test/Concurrency/Runtime/async_taskgroup_throw_recover.swift +++ b/test/Concurrency/Runtime/async_taskgroup_throw_recover.swift @@ -1,4 +1,6 @@ // RUN: %target-run-simple-swift( -target %target-swift-5.1-abi-triple -parse-as-library) | %FileCheck %s +// RUN: %target-run-simple-swift( -target %target-swift-5.1-abi-triple -parse-as-library -swift-version 5 -strict-concurrency=complete -enable-upcoming-feature NonisolatedNonsendingByDefault) | %FileCheck %s +// REQUIRES: swift_feature_NonisolatedNonsendingByDefault // REQUIRES: executable_test // REQUIRES: concurrency diff --git a/test/Concurrency/Runtime/async_taskgroup_throw_rethrow.swift b/test/Concurrency/Runtime/async_taskgroup_throw_rethrow.swift index 82fad46a9b81d..76f0ca7c0f822 100644 --- a/test/Concurrency/Runtime/async_taskgroup_throw_rethrow.swift +++ b/test/Concurrency/Runtime/async_taskgroup_throw_rethrow.swift @@ -1,4 +1,6 @@ // RUN: %target-run-simple-swift( -Xfrontend -disable-availability-checking -parse-as-library) | %FileCheck %s --dump-input=always +// RUN: %target-run-simple-swift( -Xfrontend -disable-availability-checking -parse-as-library -swift-version 5 -strict-concurrency=complete -enable-upcoming-feature NonisolatedNonsendingByDefault) | %FileCheck %s --dump-input=always +// REQUIRES: swift_feature_NonisolatedNonsendingByDefault // REQUIRES: executable_test // REQUIRES: concurrency diff --git a/test/Concurrency/Runtime/basic_future.swift b/test/Concurrency/Runtime/basic_future.swift index 71cef47fc60a1..a48939b8b2157 100644 --- a/test/Concurrency/Runtime/basic_future.swift +++ b/test/Concurrency/Runtime/basic_future.swift @@ -1,4 +1,6 @@ // RUN: %target-run-simple-swift( -target %target-swift-5.1-abi-triple %import-libdispatch -parse-as-library) +// RUN: %target-run-simple-swift( -target %target-swift-5.1-abi-triple %import-libdispatch -parse-as-library -swift-version 5 -strict-concurrency=complete -enable-upcoming-feature NonisolatedNonsendingByDefault) +// REQUIRES: swift_feature_NonisolatedNonsendingByDefault // REQUIRES: executable_test // REQUIRES: concurrency diff --git a/test/Concurrency/Runtime/cancellation_handler.swift b/test/Concurrency/Runtime/cancellation_handler.swift index f21ed50b754b7..aa4534758087f 100644 --- a/test/Concurrency/Runtime/cancellation_handler.swift +++ b/test/Concurrency/Runtime/cancellation_handler.swift @@ -1,4 +1,6 @@ // RUN: %target-run-simple-swift( -target %target-swift-5.1-abi-triple %import-libdispatch) +// RUN: %target-run-simple-swift( -target %target-swift-5.1-abi-triple %import-libdispatch -swift-version 5 -strict-concurrency=complete -enable-upcoming-feature NonisolatedNonsendingByDefault) +// REQUIRES: swift_feature_NonisolatedNonsendingByDefault // REQUIRES: concurrency // REQUIRES: executable_test diff --git a/test/Concurrency/Runtime/cancellation_handler_concurrent.swift b/test/Concurrency/Runtime/cancellation_handler_concurrent.swift index 70615cad0b47c..3579459b2cc4a 100644 --- a/test/Concurrency/Runtime/cancellation_handler_concurrent.swift +++ b/test/Concurrency/Runtime/cancellation_handler_concurrent.swift @@ -1,4 +1,6 @@ // RUN: %target-run-simple-swift( -target %target-swift-5.1-abi-triple %import-libdispatch) +// RUN: %target-run-simple-swift( -target %target-swift-5.1-abi-triple %import-libdispatch -swift-version 5 -strict-concurrency=complete -enable-upcoming-feature NonisolatedNonsendingByDefault) +// REQUIRES: swift_feature_NonisolatedNonsendingByDefault // REQUIRES: concurrency // REQUIRES: executable_test diff --git a/test/Concurrency/Runtime/cancellation_handler_only_once.swift b/test/Concurrency/Runtime/cancellation_handler_only_once.swift index b188b1f0c02b0..d1f825b0d7dfb 100644 --- a/test/Concurrency/Runtime/cancellation_handler_only_once.swift +++ b/test/Concurrency/Runtime/cancellation_handler_only_once.swift @@ -1,4 +1,6 @@ // RUN: %target-run-simple-swift( -Xfrontend -disable-availability-checking -target %target-swift-5.1-abi-triple %import-libdispatch) | %FileCheck %s +// RUN: %target-run-simple-swift( -Xfrontend -disable-availability-checking -target %target-swift-5.1-abi-triple %import-libdispatch -swift-version 5 -strict-concurrency=complete -enable-upcoming-feature NonisolatedNonsendingByDefault) | %FileCheck %s +// REQUIRES: swift_feature_NonisolatedNonsendingByDefault // REQUIRES: concurrency // REQUIRES: executable_test diff --git a/test/Concurrency/Runtime/checked_continuation.swift b/test/Concurrency/Runtime/checked_continuation.swift index e2ef84d38bfd9..bdddfc15ee8d5 100644 --- a/test/Concurrency/Runtime/checked_continuation.swift +++ b/test/Concurrency/Runtime/checked_continuation.swift @@ -1,4 +1,6 @@ // RUN: %target-run-simple-swift( -target %target-swift-5.1-abi-triple -parse-as-library) +// RUN: %target-run-simple-swift( -target %target-swift-5.1-abi-triple -parse-as-library -swift-version 5 -strict-concurrency=complete -enable-upcoming-feature NonisolatedNonsendingByDefault) +// REQUIRES: swift_feature_NonisolatedNonsendingByDefault // REQUIRES: executable_test // REQUIRES: concurrency diff --git a/test/Concurrency/Runtime/clock.swift b/test/Concurrency/Runtime/clock.swift index bd97898a3e95e..8f876105bcd8e 100644 --- a/test/Concurrency/Runtime/clock.swift +++ b/test/Concurrency/Runtime/clock.swift @@ -1,5 +1,7 @@ // RUN: %target-typecheck-verify-swift -strict-concurrency=complete -disable-availability-checking -parse-as-library // RUN: %target-run-simple-swift( -Xfrontend -disable-availability-checking -parse-as-library) +// RUN: %target-run-simple-swift( -Xfrontend -disable-availability-checking -parse-as-library -swift-version 5 -strict-concurrency=complete -enable-upcoming-feature NonisolatedNonsendingByDefault) +// REQUIRES: swift_feature_NonisolatedNonsendingByDefault // REQUIRES: concurrency // REQUIRES: executable_test diff --git a/test/Concurrency/Runtime/clocks.swift b/test/Concurrency/Runtime/clocks.swift index 731cda3503d42..45083e7ea610c 100644 --- a/test/Concurrency/Runtime/clocks.swift +++ b/test/Concurrency/Runtime/clocks.swift @@ -1,4 +1,6 @@ // RUN: %target-run-simple-swift(%import-libdispatch -parse-as-library) +// RUN: %target-run-simple-swift(%import-libdispatch -parse-as-library -swift-version 5 -strict-concurrency=complete -enable-upcoming-feature NonisolatedNonsendingByDefault) +// REQUIRES: swift_feature_NonisolatedNonsendingByDefault // REQUIRES: concurrency // REQUIRES: executable_test diff --git a/test/Concurrency/Runtime/custom_executors.swift b/test/Concurrency/Runtime/custom_executors.swift index 87bc68da3999e..6d3fe695cd54d 100644 --- a/test/Concurrency/Runtime/custom_executors.swift +++ b/test/Concurrency/Runtime/custom_executors.swift @@ -1,4 +1,6 @@ // RUN: %target-run-simple-swift( -target %target-swift-5.1-abi-triple %import-libdispatch -parse-as-library) | %FileCheck %s --dump-input=always +// RUN: %target-run-simple-swift( -target %target-swift-5.1-abi-triple %import-libdispatch -parse-as-library -swift-version 5 -strict-concurrency=complete -enable-upcoming-feature NonisolatedNonsendingByDefault) | %FileCheck %s --dump-input=always +// REQUIRES: swift_feature_NonisolatedNonsendingByDefault // REQUIRES: concurrency // REQUIRES: executable_test diff --git a/test/Concurrency/Runtime/custom_executors_complex_equality.swift b/test/Concurrency/Runtime/custom_executors_complex_equality.swift index 78342138f7abf..b07ab1cab8fe1 100644 --- a/test/Concurrency/Runtime/custom_executors_complex_equality.swift +++ b/test/Concurrency/Runtime/custom_executors_complex_equality.swift @@ -1,4 +1,6 @@ // RUN: %target-run-simple-swift( -Xfrontend -enable-experimental-move-only -Xfrontend -disable-availability-checking %import-libdispatch -parse-as-library) | %FileCheck %s +// RUN: %target-run-simple-swift( -Xfrontend -enable-experimental-move-only -Xfrontend -disable-availability-checking %import-libdispatch -parse-as-library -swift-version 5 -strict-concurrency=complete -enable-upcoming-feature NonisolatedNonsendingByDefault) | %FileCheck %s +// REQUIRES: swift_feature_NonisolatedNonsendingByDefault // REQUIRES: concurrency // REQUIRES: executable_test diff --git a/test/Concurrency/Runtime/custom_executors_complex_equality_subclass.swift b/test/Concurrency/Runtime/custom_executors_complex_equality_subclass.swift index 1a4b8bb5218fc..a378c10af68db 100644 --- a/test/Concurrency/Runtime/custom_executors_complex_equality_subclass.swift +++ b/test/Concurrency/Runtime/custom_executors_complex_equality_subclass.swift @@ -1,4 +1,6 @@ // RUN: %target-run-simple-swift( -Xfrontend -enable-experimental-move-only -Xfrontend -disable-availability-checking %import-libdispatch -parse-as-library) | %FileCheck %s +// RUN: %target-run-simple-swift( -Xfrontend -enable-experimental-move-only -Xfrontend -disable-availability-checking %import-libdispatch -parse-as-library -swift-version 5 -strict-concurrency=complete -enable-upcoming-feature NonisolatedNonsendingByDefault) | %FileCheck %s +// REQUIRES: swift_feature_NonisolatedNonsendingByDefault // REQUIRES: concurrency // REQUIRES: executable_test diff --git a/test/Concurrency/Runtime/custom_executors_default.swift b/test/Concurrency/Runtime/custom_executors_default.swift index 1d4f9bb841aa4..4b41ce16fa549 100644 --- a/test/Concurrency/Runtime/custom_executors_default.swift +++ b/test/Concurrency/Runtime/custom_executors_default.swift @@ -1,4 +1,6 @@ // RUN: %target-run-simple-swift( -target %target-swift-5.1-abi-triple %import-libdispatch -parse-as-library) | %FileCheck %s +// RUN: %target-run-simple-swift( -target %target-swift-5.1-abi-triple %import-libdispatch -parse-as-library -swift-version 5 -strict-concurrency=complete -enable-upcoming-feature NonisolatedNonsendingByDefault) | %FileCheck %s +// REQUIRES: swift_feature_NonisolatedNonsendingByDefault // REQUIRES: concurrency // REQUIRES: executable_test diff --git a/test/Concurrency/Runtime/custom_executors_globalActor.swift b/test/Concurrency/Runtime/custom_executors_globalActor.swift index 8342a70799c4e..5fde3591e6bef 100644 --- a/test/Concurrency/Runtime/custom_executors_globalActor.swift +++ b/test/Concurrency/Runtime/custom_executors_globalActor.swift @@ -1,4 +1,6 @@ // RUN: %target-run-simple-swift( %import-libdispatch -strict-concurrency=complete -parse-as-library) | %FileCheck %s +// RUN: %target-run-simple-swift( %import-libdispatch -strict-concurrency=complete -parse-as-library -swift-version 5 -strict-concurrency=complete -enable-upcoming-feature NonisolatedNonsendingByDefault) | %FileCheck %s +// REQUIRES: swift_feature_NonisolatedNonsendingByDefault // REQUIRES: concurrency // REQUIRES: executable_test diff --git a/test/Concurrency/Runtime/custom_executors_moveOnly_job.swift b/test/Concurrency/Runtime/custom_executors_moveOnly_job.swift index 4f4423a27e6ca..5f892f7b45c56 100644 --- a/test/Concurrency/Runtime/custom_executors_moveOnly_job.swift +++ b/test/Concurrency/Runtime/custom_executors_moveOnly_job.swift @@ -1,4 +1,6 @@ // RUN: %target-run-simple-swift( -Xfrontend -disable-availability-checking %import-libdispatch -parse-as-library) | %FileCheck %s +// RUN: %target-run-simple-swift( -Xfrontend -disable-availability-checking %import-libdispatch -parse-as-library -swift-version 5 -strict-concurrency=complete -enable-upcoming-feature NonisolatedNonsendingByDefault) | %FileCheck %s +// REQUIRES: swift_feature_NonisolatedNonsendingByDefault // REQUIRES: concurrency // REQUIRES: executable_test diff --git a/test/Concurrency/Runtime/custom_executors_priority.swift b/test/Concurrency/Runtime/custom_executors_priority.swift index 99f7fc21d0e03..aa5090f2aeb66 100644 --- a/test/Concurrency/Runtime/custom_executors_priority.swift +++ b/test/Concurrency/Runtime/custom_executors_priority.swift @@ -1,4 +1,6 @@ // RUN: %target-run-simple-swift( -Xfrontend -disable-availability-checking %import-libdispatch -parse-as-library) | %FileCheck %s --dump-input=always +// RUN: %target-run-simple-swift( -Xfrontend -disable-availability-checking %import-libdispatch -parse-as-library -swift-version 5 -strict-concurrency=complete -enable-upcoming-feature NonisolatedNonsendingByDefault) | %FileCheck %s --dump-input=always +// REQUIRES: swift_feature_NonisolatedNonsendingByDefault // REQUIRES: concurrency // REQUIRES: executable_test diff --git a/test/Concurrency/Runtime/custom_executors_protocol.swift b/test/Concurrency/Runtime/custom_executors_protocol.swift index 0a4d23683110a..c9ebd2f10bbf7 100644 --- a/test/Concurrency/Runtime/custom_executors_protocol.swift +++ b/test/Concurrency/Runtime/custom_executors_protocol.swift @@ -1,4 +1,6 @@ // RUN: %target-run-simple-swift( -Xfrontend -enable-experimental-move-only -Xfrontend -disable-availability-checking %import-libdispatch -parse-as-library) | %FileCheck %s +// RUN: %target-run-simple-swift( -Xfrontend -enable-experimental-move-only -Xfrontend -disable-availability-checking %import-libdispatch -parse-as-library -swift-version 5 -strict-concurrency=complete -enable-upcoming-feature NonisolatedNonsendingByDefault) | %FileCheck %s +// REQUIRES: swift_feature_NonisolatedNonsendingByDefault // REQUIRES: concurrency // REQUIRES: executable_test diff --git a/test/Concurrency/Runtime/custom_main_executor.swift b/test/Concurrency/Runtime/custom_main_executor.swift index 08e9b8f7ce64e..cea9b4d04a0e6 100644 --- a/test/Concurrency/Runtime/custom_main_executor.swift +++ b/test/Concurrency/Runtime/custom_main_executor.swift @@ -1,4 +1,6 @@ // RUN: %target-run-simple-swift(-Xfrontend -disable-availability-checking -g %import-libdispatch -parse-as-library) | %FileCheck %s +// RUN: %target-run-simple-swift(-Xfrontend -disable-availability-checking -g %import-libdispatch -parse-as-library -swift-version 5 -strict-concurrency=complete -enable-upcoming-feature NonisolatedNonsendingByDefault) | %FileCheck %s +// REQUIRES: swift_feature_NonisolatedNonsendingByDefault // REQUIRES: concurrency // REQUIRES: executable_test @@ -70,7 +72,7 @@ final class SimpleTaskExecutor: TaskExecutor, @unchecked Sendable { } } -func myAsyncFunction() async { +@concurrent func myAsyncFunction() async { print("Hello World") } diff --git a/test/Concurrency/Runtime/effectful_properties.swift b/test/Concurrency/Runtime/effectful_properties.swift index 1489261e26ce1..f00e1183cdc25 100644 --- a/test/Concurrency/Runtime/effectful_properties.swift +++ b/test/Concurrency/Runtime/effectful_properties.swift @@ -1,5 +1,12 @@ // RUN: %target-run-simple-swift(-parse-as-library -target %target-swift-5.1-abi-triple) | %FileCheck %s +// Enable this for nonisolated nonsending by default rdar://157226022 is +// fixed. The test will fail otherwise since we hit an error due to inferring +// nonisolated(nonsending) on the non-async property name. + +// XUN: %target-run-simple-swift(-parse-as-library -target %target-swift-5.1-abi-triple -swift-version 5 -strict-concurrency=complete -enable-upcoming-feature NonisolatedNonsendingByDefault) | %FileCheck %s +// XEQUIRES: swift_feature_NonisolatedNonsendingByDefault + // REQUIRES: executable_test // REQUIRES: concurrency // UNSUPPORTED: freestanding diff --git a/test/Concurrency/Runtime/exclusivity.swift b/test/Concurrency/Runtime/exclusivity.swift index cca10356dabb3..f217e2db37253 100644 --- a/test/Concurrency/Runtime/exclusivity.swift +++ b/test/Concurrency/Runtime/exclusivity.swift @@ -1,4 +1,6 @@ // RUN: %target-run-simple-swift(-target %target-swift-5.1-abi-triple -parse-as-library) +// RUN: %target-run-simple-swift(-target %target-swift-5.1-abi-triple -parse-as-library -swift-version 5 -strict-concurrency=complete -enable-upcoming-feature NonisolatedNonsendingByDefault) +// REQUIRES: swift_feature_NonisolatedNonsendingByDefault // REQUIRES: executable_test // REQUIRES: concurrency diff --git a/test/Concurrency/Runtime/exclusivity_custom_executors.swift b/test/Concurrency/Runtime/exclusivity_custom_executors.swift index 1d452da1edfbb..09f40a10196d5 100644 --- a/test/Concurrency/Runtime/exclusivity_custom_executors.swift +++ b/test/Concurrency/Runtime/exclusivity_custom_executors.swift @@ -1,4 +1,6 @@ // RUN: %target-run-simple-swift(-target %target-swift-5.1-abi-triple -parse-as-library) +// RUN: %target-run-simple-swift(-target %target-swift-5.1-abi-triple -parse-as-library -swift-version 5 -strict-concurrency=complete -enable-upcoming-feature NonisolatedNonsendingByDefault) +// REQUIRES: swift_feature_NonisolatedNonsendingByDefault // REQUIRES: concurrency // REQUIRES: executable_test diff --git a/test/Concurrency/Runtime/executor_deinit1.swift b/test/Concurrency/Runtime/executor_deinit1.swift index 73e56543429fa..862e7854f1c48 100644 --- a/test/Concurrency/Runtime/executor_deinit1.swift +++ b/test/Concurrency/Runtime/executor_deinit1.swift @@ -1,4 +1,6 @@ // RUN: %target-run-simple-swift(-parse-as-library -target %target-swift-5.1-abi-triple %import-libdispatch) | %FileCheck %s +// RUN: %target-run-simple-swift(-parse-as-library -target %target-swift-5.1-abi-triple %import-libdispatch -swift-version 5 -strict-concurrency=complete -enable-upcoming-feature NonisolatedNonsendingByDefault) | %FileCheck %s +// REQUIRES: swift_feature_NonisolatedNonsendingByDefault // REQUIRES: executable_test // REQUIRES: concurrency diff --git a/test/Concurrency/Runtime/executor_deinit2.swift b/test/Concurrency/Runtime/executor_deinit2.swift index a50bf58887f69..c444e0460d1d0 100644 --- a/test/Concurrency/Runtime/executor_deinit2.swift +++ b/test/Concurrency/Runtime/executor_deinit2.swift @@ -1,4 +1,6 @@ // RUN: %target-run-simple-swift(-parse-as-library -target %target-swift-5.1-abi-triple) | %FileCheck %s +// RUN: %target-run-simple-swift(-parse-as-library -target %target-swift-5.1-abi-triple -swift-version 5 -strict-concurrency=complete -enable-upcoming-feature NonisolatedNonsendingByDefault) | %FileCheck %s +// REQUIRES: swift_feature_NonisolatedNonsendingByDefault // REQUIRES: executable_test // REQUIRES: concurrency diff --git a/test/Concurrency/Runtime/executor_deinit3.swift b/test/Concurrency/Runtime/executor_deinit3.swift index ef638cf957ff6..2e3ab21476057 100644 --- a/test/Concurrency/Runtime/executor_deinit3.swift +++ b/test/Concurrency/Runtime/executor_deinit3.swift @@ -1,4 +1,6 @@ // RUN: %target-run-simple-swift(-parse-as-library -target %target-swift-5.1-abi-triple %import-libdispatch) | %FileCheck %s +// RUN: %target-run-simple-swift(-parse-as-library -target %target-swift-5.1-abi-triple %import-libdispatch -swift-version 5 -strict-concurrency=complete -enable-upcoming-feature NonisolatedNonsendingByDefault) | %FileCheck %s +// REQUIRES: swift_feature_NonisolatedNonsendingByDefault // REQUIRES: executable_test // REQUIRES: concurrency diff --git a/test/Concurrency/Runtime/future_fibonacci.swift b/test/Concurrency/Runtime/future_fibonacci.swift index b62c5316090f6..75a85d3c0910b 100644 --- a/test/Concurrency/Runtime/future_fibonacci.swift +++ b/test/Concurrency/Runtime/future_fibonacci.swift @@ -1,4 +1,6 @@ // RUN: %target-run-simple-swift( -target %target-swift-5.1-abi-triple %import-libdispatch -parse-as-library) +// RUN: %target-run-simple-swift( -target %target-swift-5.1-abi-triple %import-libdispatch -parse-as-library -swift-version 5 -strict-concurrency=complete -enable-upcoming-feature NonisolatedNonsendingByDefault) +// REQUIRES: swift_feature_NonisolatedNonsendingByDefault // REQUIRES: executable_test // REQUIRES: concurrency diff --git a/test/Concurrency/Runtime/isolated_conformance.swift b/test/Concurrency/Runtime/isolated_conformance.swift index c3c4e1e968f78..609bd3a8c2272 100644 --- a/test/Concurrency/Runtime/isolated_conformance.swift +++ b/test/Concurrency/Runtime/isolated_conformance.swift @@ -1,4 +1,6 @@ // RUN: %target-run-simple-swift(-target %target-swift-5.1-abi-triple) | %FileCheck %s +// RUN: %target-run-simple-swift(-target %target-swift-5.1-abi-triple -swift-version 5 -strict-concurrency=complete -enable-upcoming-feature NonisolatedNonsendingByDefault) | %FileCheck %s +// REQUIRES: swift_feature_NonisolatedNonsendingByDefault // REQUIRES: executable_test // REQUIRES: concurrency diff --git a/test/Concurrency/Runtime/isolated_macro_in_nonisolated_nonsending_func.swift b/test/Concurrency/Runtime/isolated_macro_in_nonisolated_nonsending_func.swift index 0365c6df828dd..06789bb3a2971 100644 --- a/test/Concurrency/Runtime/isolated_macro_in_nonisolated_nonsending_func.swift +++ b/test/Concurrency/Runtime/isolated_macro_in_nonisolated_nonsending_func.swift @@ -1,4 +1,6 @@ // RUN: %target-run-simple-swift( -Xfrontend -disable-availability-checking -parse-as-library) | %FileCheck %s --dump-input=always +// RUN: %target-run-simple-swift( -Xfrontend -disable-availability-checking -parse-as-library -swift-version 5 -strict-concurrency=complete -enable-upcoming-feature NonisolatedNonsendingByDefault) | %FileCheck %s --dump-input=always +// REQUIRES: swift_feature_NonisolatedNonsendingByDefault // REQUIRES: concurrency // REQUIRES: executable_test diff --git a/test/Concurrency/Runtime/mainactor.swift b/test/Concurrency/Runtime/mainactor.swift index f2be405fd3152..3a2ffe6f4936b 100644 --- a/test/Concurrency/Runtime/mainactor.swift +++ b/test/Concurrency/Runtime/mainactor.swift @@ -1,4 +1,6 @@ // RUN: %target-run-simple-swift(-parse-as-library -g -target %target-swift-5.1-abi-triple %import-libdispatch) | %FileCheck %s +// RUN: %target-run-simple-swift(-parse-as-library -g -target %target-swift-5.1-abi-triple %import-libdispatch -swift-version 5 -strict-concurrency=complete -enable-upcoming-feature NonisolatedNonsendingByDefault) | %FileCheck %s +// REQUIRES: swift_feature_NonisolatedNonsendingByDefault // REQUIRES: executable_test // REQUIRES: concurrency diff --git a/test/Concurrency/Runtime/nonisolated_inherits_isolation.swift b/test/Concurrency/Runtime/nonisolated_inherits_isolation.swift index e4b6ec5146d19..90bc2bcaa45ea 100644 --- a/test/Concurrency/Runtime/nonisolated_inherits_isolation.swift +++ b/test/Concurrency/Runtime/nonisolated_inherits_isolation.swift @@ -1,4 +1,6 @@ // RUN: %target-run-simple-swift( -swift-version 6 -g %import-libdispatch -import-objc-header %S/Inputs/RunOnMainActor.h -enable-upcoming-feature NonisolatedNonsendingByDefault ) +// RUN: %target-run-simple-swift( -swift-version 6 -g %import-libdispatch -import-objc-header %S/Inputs/RunOnMainActor.h -enable-upcoming-feature NonisolatedNonsendingByDefault -swift-version 5 -strict-concurrency=complete -enable-upcoming-feature NonisolatedNonsendingByDefault) +// REQUIRES: swift_feature_NonisolatedNonsendingByDefault // REQUIRES: executable_test // REQUIRES: concurrency diff --git a/test/Concurrency/Runtime/sleep_executor.swift b/test/Concurrency/Runtime/sleep_executor.swift index f4767e5a068b3..46809b5212e39 100644 --- a/test/Concurrency/Runtime/sleep_executor.swift +++ b/test/Concurrency/Runtime/sleep_executor.swift @@ -1,4 +1,6 @@ // RUN: %target-run-simple-swift(%import-libdispatch -parse-as-library) +// RUN: %target-run-simple-swift(%import-libdispatch -parse-as-library -swift-version 5 -strict-concurrency=complete -enable-upcoming-feature NonisolatedNonsendingByDefault) +// REQUIRES: swift_feature_NonisolatedNonsendingByDefault // REQUIRES: concurrency // REQUIRES: executable_test diff --git a/test/Concurrency/Runtime/task_creation.swift b/test/Concurrency/Runtime/task_creation.swift index 42cf3d773e5a3..b834bc61719cd 100644 --- a/test/Concurrency/Runtime/task_creation.swift +++ b/test/Concurrency/Runtime/task_creation.swift @@ -1,4 +1,6 @@ // RUN: %target-run-simple-swift( -target %target-swift-5.1-abi-triple -parse-as-library) +// RUN: %target-run-simple-swift( -target %target-swift-5.1-abi-triple -parse-as-library -swift-version 5 -strict-concurrency=complete -enable-upcoming-feature NonisolatedNonsendingByDefault) +// REQUIRES: swift_feature_NonisolatedNonsendingByDefault // REQUIRES: executable_test // REQUIRES: concurrency diff --git a/test/Concurrency/Runtime/task_destruction.swift b/test/Concurrency/Runtime/task_destruction.swift index f949727c6b789..20a026e584a57 100644 --- a/test/Concurrency/Runtime/task_destruction.swift +++ b/test/Concurrency/Runtime/task_destruction.swift @@ -1,4 +1,6 @@ // RUN: %target-run-simple-swift(-parse-as-library -target %target-swift-5.1-abi-triple) | %FileCheck %s +// RUN: %target-run-simple-swift(-parse-as-library -target %target-swift-5.1-abi-triple -swift-version 5 -strict-concurrency=complete -enable-upcoming-feature NonisolatedNonsendingByDefault) | %FileCheck %s +// REQUIRES: swift_feature_NonisolatedNonsendingByDefault // REQUIRES: executable_test // REQUIRES: concurrency // REQUIRES: concurrency_runtime diff --git a/test/Concurrency/Runtime/taskgroup_cancelAll_cancellationHandler.swift b/test/Concurrency/Runtime/taskgroup_cancelAll_cancellationHandler.swift index d242a15908c58..3249c2781f232 100644 --- a/test/Concurrency/Runtime/taskgroup_cancelAll_cancellationHandler.swift +++ b/test/Concurrency/Runtime/taskgroup_cancelAll_cancellationHandler.swift @@ -1,4 +1,6 @@ // RUN: %target-run-simple-swift( -target %target-swift-5.1-abi-triple %import-libdispatch -parse-as-library) | %FileCheck %s +// RUN: %target-run-simple-swift( -target %target-swift-5.1-abi-triple %import-libdispatch -parse-as-library -swift-version 5 -strict-concurrency=complete -enable-upcoming-feature NonisolatedNonsendingByDefault) | %FileCheck %s +// REQUIRES: swift_feature_NonisolatedNonsendingByDefault // REQUIRES: executable_test // REQUIRES: concurrency diff --git a/test/Concurrency/Runtime/unspecified_is_main_actor.swift b/test/Concurrency/Runtime/unspecified_is_main_actor.swift index 51c3a732079c2..18f389c0b3570 100644 --- a/test/Concurrency/Runtime/unspecified_is_main_actor.swift +++ b/test/Concurrency/Runtime/unspecified_is_main_actor.swift @@ -1,4 +1,6 @@ // RUN: %target-run-simple-swift( -Xfrontend -disable-availability-checking -swift-version 6 -g -import-objc-header %S/Inputs/RunOnMainActor.h %import-libdispatch -Xfrontend -default-isolation=MainActor ) +// RUN: %target-run-simple-swift( -Xfrontend -disable-availability-checking -swift-version 6 -g -import-objc-header %S/Inputs/RunOnMainActor.h %import-libdispatch -Xfrontend -default-isolation=MainActor -swift-version 5 -strict-concurrency=complete -enable-upcoming-feature NonisolatedNonsendingByDefault) +// REQUIRES: swift_feature_NonisolatedNonsendingByDefault // REQUIRES: executable_test // REQUIRES: concurrency diff --git a/test/Concurrency/attr_execution/conversions_silgen.swift b/test/Concurrency/attr_execution/conversions_silgen.swift index 0ecacaa916f91..8544d2e5f5458 100644 --- a/test/Concurrency/attr_execution/conversions_silgen.swift +++ b/test/Concurrency/attr_execution/conversions_silgen.swift @@ -152,6 +152,8 @@ public func testCallerToCaller(_ x: nonisolated(nonsending) @escaping () async - // CHECK-LABEL: sil [ossa] @$s21attr_execution_silgen24testCallerLocalVariablesyyyyYaYCcYaF : $@convention(thin) @async (@guaranteed @async @callee_guaranteed (@sil_isolated @sil_implicit_leading_param @guaranteed Optional) -> ()) -> () { // CHECK: bb0([[PARAM:%.*]] : @guaranteed $@async @callee_guaranteed (@sil_isolated @sil_implicit_leading_param @guaranteed Optional) -> ()): +// CHECK: [[ACTOR:%.*]] = enum $Optional, #Optional.none!enumelt +// CHECK: hop_to_executor [[ACTOR]] // CHECK: [[PARAM_COPY:%.*]] = copy_value [[PARAM]] // CHECK: [[Y:%.*]] = move_value [lexical] [var_decl] [[PARAM_COPY]] // CHECK: [[Y_B:%.*]] = begin_borrow [[Y]] @@ -159,7 +161,6 @@ public func testCallerToCaller(_ x: nonisolated(nonsending) @escaping () async - // CHECK: [[Y2:%.*]] = move_value [lexical] [var_decl] [[Y_B_C]] // CHECK: [[Y2_B:%.*]] = begin_borrow [[Y2]] // CHECK: [[Y2_B_C:%.*]] = copy_value [[Y2_B]] -// CHECK: [[ACTOR:%.*]] = enum $Optional, #Optional.none!enumelt // CHECK: [[Y2_B_C_B:%.*]] = begin_borrow [[Y2_B_C]] // CHECK: apply [[Y2_B_C_B]]([[ACTOR]]) // CHECK: } // end sil function '$s21attr_execution_silgen24testCallerLocalVariablesyyyyYaYCcYaF' @@ -522,7 +523,7 @@ func testThatClosuresAssumeIsolation(fn: inout nonisolated(nonsending) (Int) asy testParam { 42 } // CHECK-LABEL: sil private [ossa] @$s21attr_execution_silgen31testThatClosuresAssumeIsolation2fnyySiYaYCcz_tFyyYaXEfU1_ : $@convention(thin) @async () -> () - // CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional, #Optional.none!enumelt + // CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional, #Optional.none!enumelt // CHECK: hop_to_executor [[GENERIC_EXECUTOR]] testParam { @concurrent in 42 } @@ -538,7 +539,7 @@ func testThatClosuresAssumeIsolation(fn: inout nonisolated(nonsending) (Int) asy fn = { _ in } // CHECK-LABEL: sil private [ossa] @$s21attr_execution_silgen31testThatClosuresAssumeIsolation2fnyySiYaYCcz_tFySiYacfU3_ : $@convention(thin) @async (Int) -> () - // CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional, #Optional.none!enumelt + // CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional, #Optional.none!enumelt // CHECK: hop_to_executor [[GENERIC_EXECUTOR]] // CHECK: } // end sil function '$s21attr_execution_silgen31testThatClosuresAssumeIsolation2fnyySiYaYCcz_tFySiYacfU3_' @@ -557,7 +558,7 @@ func testNoIsolationTransfer() { func testErasure(@_inheritActorContext _: @escaping @isolated(any) () async -> Void) {} // CHECK-LABEL: sil private [ossa] @$s21attr_execution_silgen23testNoIsolationTransferyyFyyYacfU_ : $@convention(thin) @async (@guaranteed Optional) -> () - // CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional, #Optional.none!enumelt + // CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional, #Optional.none!enumelt // CHECK: hop_to_executor [[GENERIC_EXECUTOR]] testErasure { @concurrent in } } @@ -566,7 +567,7 @@ func testClosuresDontAssumeGlobalActorWithMarkedAsConcurrent() { func test(_ fn: @MainActor () async -> Void) {} // CHECK-LABEL: sil private [ossa] @$s21attr_execution_silgen55testClosuresDontAssumeGlobalActorWithMarkedAsConcurrentyyFyyYaYbXEfU_ - // CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional, #Optional.none!enumelt + // CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional, #Optional.none!enumelt // CHECK-NEXT: hop_to_executor [[GENERIC_EXECUTOR]] // CHECK: } // end sil function '$s21attr_execution_silgen55testClosuresDontAssumeGlobalActorWithMarkedAsConcurrentyyFyyYaYbXEfU_' test { @Sendable @concurrent in diff --git a/test/Concurrency/attr_execution/witnesses.swift b/test/Concurrency/attr_execution/witnesses.swift index 6b649f09ed8b8..197d504272f34 100644 --- a/test/Concurrency/attr_execution/witnesses.swift +++ b/test/Concurrency/attr_execution/witnesses.swift @@ -25,14 +25,16 @@ struct S: P { // CHECK-NEXT: [[MAIN_ACTOR_COPY:%.*]] = copy_value [[BORROWED_MAIN_ACTOR]] // CHECK-NEXT: [[ERASED_TO_ACTOR:%.*]] = init_existential_ref [[MAIN_ACTOR_COPY]] : $MainActor : $MainActor, $any Actor // CHECK-NEXT: [[CONTEXT_ISOLATION:%.*]] = enum $Optional, #Optional.some!enumelt, [[ERASED_TO_ACTOR]] +// CHECK-NEXT: [[CONTEXT_ISOLATION_B:%.*]] = begin_borrow [[CONTEXT_ISOLATION]] // CHECK-NEXT: [[PROP_WITNESS:%.*]] = witness_method $T, #P.prop!getter : (Self) -> () async -> String : $@convention(witness_method: P) @async <τ_0_0 where τ_0_0 : P> (@sil_isolated @sil_implicit_leading_param @guaranteed Optional, @in_guaranteed τ_0_0) -> @owned String -// CHECK-NEXT: {{.*}} = apply [[PROP_WITNESS]]([[CONTEXT_ISOLATION]], %0) : $@convention(witness_method: P) @async <τ_0_0 where τ_0_0 : P> (@sil_isolated @sil_implicit_leading_param @guaranteed Optional, @in_guaranteed τ_0_0) -> @owned String +// CHECK-NEXT: {{.*}} = apply [[PROP_WITNESS]]([[CONTEXT_ISOLATION_B]], %0) : $@convention(witness_method: P) @async <τ_0_0 where τ_0_0 : P> (@sil_isolated @sil_implicit_leading_param @guaranteed Optional, @in_guaranteed τ_0_0) -> @owned String // CHECK: hop_to_executor [[BORROWED_MAIN_ACTOR]] // CHECK: [[MAIN_ACTOR_COPY:%.*]] = copy_value [[BORROWED_MAIN_ACTOR]] // CHECK-NEXT: [[ERASED_TO_ACTOR:%.*]] = init_existential_ref [[MAIN_ACTOR_COPY]] : $MainActor : $MainActor, $any Actor // CHECK-NEXT: [[CONTEXT_ISOLATION:%.*]] = enum $Optional, #Optional.some!enumelt, [[ERASED_TO_ACTOR]] +// CHECK-NEXT: [[CONTEXT_ISOLATION_B:%.*]] = begin_borrow [[CONTEXT_ISOLATION]] // CHECK-NEXT: [[FN_WITNESS:%.*]] = witness_method $T, #P.fn : (Self) -> () async -> () : $@convention(witness_method: P) @async <τ_0_0 where τ_0_0 : P> (@sil_isolated @sil_implicit_leading_param @guaranteed Optional, @in_guaranteed τ_0_0) -> () -// CHECK-NEXT: {{.*}} = apply [[FN_WITNESS]]([[CONTEXT_ISOLATION]], %0) : $@convention(witness_method: P) @async <τ_0_0 where τ_0_0 : P> (@sil_isolated @sil_implicit_leading_param @guaranteed Optional, @in_guaranteed τ_0_0) -> () +// CHECK-NEXT: {{.*}} = apply [[FN_WITNESS]]([[CONTEXT_ISOLATION_B]], %0) : $@convention(witness_method: P) @async <τ_0_0 where τ_0_0 : P> (@sil_isolated @sil_implicit_leading_param @guaranteed Optional, @in_guaranteed τ_0_0) -> () // CHECK: } // end sil function '$s9witnesses21testMainActorDispatch1tyx_tYaAA1PRzlF' @MainActor func testMainActorDispatch(t: T) async { @@ -41,15 +43,13 @@ func testMainActorDispatch(t: T) async { } // CHECK-LABEL: sil hidden [ossa] @$s9witnesses19testGenericExecutor1tyx_tYaAA1PRzlF : $@convention(thin) @async (@in_guaranteed T) -> () -// CHECK: [[CONTEXT_ISOLATION:%.*]] = enum $Optional, #Optional.none!enumelt +// CHECK: [[CONTEXT_ISOLATION:%.*]] = enum $Optional, #Optional.none!enumelt // CHECK-NEXT: hop_to_executor [[CONTEXT_ISOLATION]] -// CHECK-NEXT: [[ISOLATION_ERASED_TO_ACTOR:%.*]] = enum $Optional, #Optional.none!enumelt // CHECK-NEXT: [[PROP_WITNESS:%.*]] = witness_method $T, #P.prop!getter : (Self) -> () async -> String : $@convention(witness_method: P) @async <τ_0_0 where τ_0_0 : P> (@sil_isolated @sil_implicit_leading_param @guaranteed Optional, @in_guaranteed τ_0_0) -> @owned String -// CHECK-NEXT: {{.*}} = apply [[PROP_WITNESS]]([[ISOLATION_ERASED_TO_ACTOR]], %0) : $@convention(witness_method: P) @async <τ_0_0 where τ_0_0 : P> (@sil_isolated @sil_implicit_leading_param @guaranteed Optional, @in_guaranteed τ_0_0) -> @owned String +// CHECK-NEXT: {{.*}} = apply [[PROP_WITNESS]]([[CONTEXT_ISOLATION]], %0) : $@convention(witness_method: P) @async <τ_0_0 where τ_0_0 : P> (@sil_isolated @sil_implicit_leading_param @guaranteed Optional, @in_guaranteed τ_0_0) -> @owned String // CHECK-NEXT: hop_to_executor [[CONTEXT_ISOLATION]] -// CHECK: [[ISOLATION_ERASED_TO_ACTOR:%.*]] = enum $Optional, #Optional.none!enumelt -// CHECK-NEXT: [[FN_WITNESS:%.*]] = witness_method $T, #P.fn : (Self) -> () async -> () : $@convention(witness_method: P) @async <τ_0_0 where τ_0_0 : P> (@sil_isolated @sil_implicit_leading_param @guaranteed Optional, @in_guaranteed τ_0_0) -> () -// CHECK-NEXT: {{.*}} = apply [[FN_WITNESS]]([[ISOLATION_ERASED_TO_ACTOR]], %0) : $@convention(witness_method: P) @async <τ_0_0 where τ_0_0 : P> (@sil_isolated @sil_implicit_leading_param @guaranteed Optional, @in_guaranteed τ_0_0) -> () +// CHECK: [[FN_WITNESS:%.*]] = witness_method $T, #P.fn : (Self) -> () async -> () : $@convention(witness_method: P) @async <τ_0_0 where τ_0_0 : P> (@sil_isolated @sil_implicit_leading_param @guaranteed Optional, @in_guaranteed τ_0_0) -> () +// CHECK-NEXT: {{.*}} = apply [[FN_WITNESS]]([[CONTEXT_ISOLATION]], %0) : $@convention(witness_method: P) @async <τ_0_0 where τ_0_0 : P> (@sil_isolated @sil_implicit_leading_param @guaranteed Optional, @in_guaranteed τ_0_0) -> () // CHECK: } // end sil function '$s9witnesses19testGenericExecutor1tyx_tYaAA1PRzlF' func testGenericExecutor(t: T) async { _ = await t.prop @@ -63,14 +63,16 @@ actor Test { // CHECK-NEXT: [[ACTOR_COPY:%.*]] = copy_value [[ACTOR]] // CHECK-NEXT: [[ERASED_TO_ACTOR:%.*]] = init_existential_ref [[ACTOR_COPY]] : $Test : $Test, $any Actor // CHECK-NEXT: [[CONTEXT_ISOLATION:%.*]] = enum $Optional, #Optional.some!enumelt, [[ERASED_TO_ACTOR]] + // CHECK-NEXT: [[CONTEXT_ISOLATION_B:%.*]] = begin_borrow [[CONTEXT_ISOLATION]] // CHECK-NEXT: [[PROP_WITNESS:%.*]] = witness_method $T, #P.prop!getter : (Self) -> () async -> String : $@convention(witness_method: P) @async <τ_0_0 where τ_0_0 : P> (@sil_isolated @sil_implicit_leading_param @guaranteed Optional, @in_guaranteed τ_0_0) -> @owned String - // CHECK-NEXT: {{.*}} = apply [[PROP_WITNESS]]([[CONTEXT_ISOLATION]], %0) : $@convention(witness_method: P) @async <τ_0_0 where τ_0_0 : P> (@sil_isolated @sil_implicit_leading_param @guaranteed Optional, @in_guaranteed τ_0_0) -> @owned String + // CHECK-NEXT: {{.*}} = apply [[PROP_WITNESS]]([[CONTEXT_ISOLATION_B]], %0) : $@convention(witness_method: P) @async <τ_0_0 where τ_0_0 : P> (@sil_isolated @sil_implicit_leading_param @guaranteed Optional, @in_guaranteed τ_0_0) -> @owned String // CHECK: hop_to_executor [[ACTOR]] // CHECK: [[ACTOR_COPY:%.*]] = copy_value [[ACTOR]] // CHECK-NEXT: [[ERASED_TO_ACTOR:%.*]] = init_existential_ref [[ACTOR_COPY]] : $Test : $Test, $any Actor // CHECK-NEXT: [[CONTEXT_ISOLATION:%.*]] = enum $Optional, #Optional.some!enumelt, [[ERASED_TO_ACTOR]] + // CHECK-NEXT: [[CONTEXT_ISOLATION_B:%.*]] = begin_borrow [[CONTEXT_ISOLATION]] // CHECK-NEXT: [[FN_WITNESS:%.*]] = witness_method $T, #P.fn : (Self) -> () async -> () : $@convention(witness_method: P) @async <τ_0_0 where τ_0_0 : P> (@sil_isolated @sil_implicit_leading_param @guaranteed Optional, @in_guaranteed τ_0_0) -> () - // CHECK-NEXT: {{.*}} = apply [[FN_WITNESS]]([[CONTEXT_ISOLATION]], %0) : $@convention(witness_method: P) @async <τ_0_0 where τ_0_0 : P> (@sil_isolated @sil_implicit_leading_param @guaranteed Optional, @in_guaranteed τ_0_0) -> () + // CHECK-NEXT: {{.*}} = apply [[FN_WITNESS]]([[CONTEXT_ISOLATION_B]], %0) : $@convention(witness_method: P) @async <τ_0_0 where τ_0_0 : P> (@sil_isolated @sil_implicit_leading_param @guaranteed Optional, @in_guaranteed τ_0_0) -> () // CHECK: } // end sil function '$s9witnesses4TestC4test1tyx_tYaAA1PRzlF' func test(t: T) async { _ = await t.prop @@ -86,14 +88,16 @@ actor Test { // CHECK-NEXT: [[MAIN_ACTOR_COPY:%.*]] = copy_value [[BORROWED_MAIN_ACTOR]] // CHECK-NEXT: [[ERASED_TO_ACTOR:%.*]] = init_existential_ref [[MAIN_ACTOR_COPY]] : $MainActor : $MainActor, $any Actor // CHECK-NEXT: [[CONTEXT_ISOLATION:%.*]] = enum $Optional, #Optional.some!enumelt, [[ERASED_TO_ACTOR]] +// CHECK-NEXT: [[CONTEXT_ISOLATION_B:%.*]] = begin_borrow [[CONTEXT_ISOLATION]] // CHECK: [[PROP_REF:%.*]] = function_ref @$s9witnesses1SV4propSSvg : $@convention(method) @async (@sil_isolated @sil_implicit_leading_param @guaranteed Optional, S) -> @owned String -// CHECK-NEXT: {{.*}} = apply [[PROP_REF]]([[CONTEXT_ISOLATION]], %0) : $@convention(method) @async (@sil_isolated @sil_implicit_leading_param @guaranteed Optional, S) -> @owned String +// CHECK-NEXT: {{.*}} = apply [[PROP_REF]]([[CONTEXT_ISOLATION_B]], %0) : $@convention(method) @async (@sil_isolated @sil_implicit_leading_param @guaranteed Optional, S) -> @owned String // CHECK: hop_to_executor [[BORROWED_MAIN_ACTOR]] // CHECK: [[MAIN_ACTOR_COPY:%.*]] = copy_value [[BORROWED_MAIN_ACTOR]] // CHECK-NEXT: [[ERASED_TO_ACTOR:%.*]] = init_existential_ref [[MAIN_ACTOR_COPY]] : $MainActor : $MainActor, $any Actor // CHECK-NEXT: [[CONTEXT_ISOLATION:%.*]] = enum $Optional, #Optional.some!enumelt, [[ERASED_TO_ACTOR]] +// CHECK-NEXT: [[CONTEXT_ISOLATION_B:%.*]] = begin_borrow [[CONTEXT_ISOLATION]] // CHECK: [[FN_REF:%.*]] = function_ref @$s9witnesses1SV2fnyyYaF : $@convention(method) @async (@sil_isolated @sil_implicit_leading_param @guaranteed Optional, S) -> () -// CHECK-NEXT: {{.*}} = apply [[FN_REF]]([[CONTEXT_ISOLATION]], %0) : $@convention(method) @async (@sil_isolated @sil_implicit_leading_param @guaranteed Optional, S) -> () +// CHECK-NEXT: {{.*}} = apply [[FN_REF]]([[CONTEXT_ISOLATION_B]], %0) : $@convention(method) @async (@sil_isolated @sil_implicit_leading_param @guaranteed Optional, S) -> () // CHECK: } // end sil function '$s9witnesses14testDirectCall1syAA1SV_tYaF' @MainActor func testDirectCall(s: S) async { diff --git a/test/Concurrency/cross_module_let_sil.swift b/test/Concurrency/cross_module_let_sil.swift index 216d1939a8db9..22cf8b4a6af47 100644 --- a/test/Concurrency/cross_module_let_sil.swift +++ b/test/Concurrency/cross_module_let_sil.swift @@ -7,12 +7,12 @@ import OtherActors // CHECK-LABEL: sil hidden [ossa] @$s4test6check1ySi11OtherActors0C11ModuleActorCYaF : $@convention(thin) @async (@guaranteed OtherModuleActor) -> Int { // CHECK: bb0([[SELF:%[0-9]+]] : @guaranteed $OtherModuleActor): -// CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none -// CHECK-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional +// CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none +// CHECK-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional // CHECK: [[REF:%[0-9]+]] = ref_element_addr [[SELF]] : $OtherModuleActor, #OtherModuleActor.a // CHECK: hop_to_executor [[SELF]] : $OtherModuleActor // CHECK-NEXT: load [trivial] [[REF]] -// CHECK-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional +// CHECK-NEXT: hop_to_executor [[GENERIC_EXEC]] // CHECK: } // end sil function '$s4test6check1ySi11OtherActors0C11ModuleActorCYaF' func check1(_ actor: OtherModuleActor) async -> Int { return await actor.a @@ -24,23 +24,23 @@ func check2(_ actor: isolated OtherModuleActor) -> Int { // CHECK-LABEL: sil hidden [ossa] @$s4test6check3ySi11OtherActors0C11ModuleActorCYaF : $@convention(thin) @async (@guaranteed OtherModuleActor) -> Int { // CHECK: bb0([[SELF:%[0-9]+]] : @guaranteed $OtherModuleActor): -// CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none -// CHECK-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional +// CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none +// CHECK-NEXT: hop_to_executor [[GENERIC_EXEC]] func check3(_ actor: OtherModuleActor) async -> Int { return actor.b } // CHECK-LABEL: sil hidden [ossa] @$s4test6check4y11OtherActors17SomeSendableClassCSgAC0C11ModuleActorCSgYaF : $@convention(thin) @async (@guaranteed Optional) -> @owned Optional { // CHECK: bb0({{%[0-9]+}} : @guaranteed $Optional): -// CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none -// CHECK-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional +// CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none +// CHECK-NEXT: hop_to_executor [[GENERIC_EXEC]] // CHECK: switch_enum {{%[0-9]+}} : $Optional, case #Optional.some!enumelt: [[SOME:bb[0-9]+]], case #Optional.none!enumelt: {{bb[0-9]+}} // CHECK: [[SOME]]({{%[0-9]+}} : @owned $OtherModuleActor): // CHECK: [[REF:%[0-9]+]] = ref_element_addr {{%[0-9]+}} : $OtherModuleActor, #OtherModuleActor.d // CHECK: hop_to_executor {{%[0-9]+}} : $OtherModuleActor // CHECK-NEXT: load [copy] [[REF]] -// CHECK: hop_to_executor [[GENERIC_EXEC]] : $Optional +// CHECK: hop_to_executor [[GENERIC_EXEC]] // CHECK: } // end sil function '$s4test6check4y11OtherActors17SomeSendableClassCSgAC0C11ModuleActorCSgYaF' func check4(_ actor: OtherModuleActor?) async -> SomeSendableClass? { return await actor?.d diff --git a/test/Concurrency/isolated_default_argument_eval.swift b/test/Concurrency/isolated_default_argument_eval.swift index fa7debb221549..2d2e1d0c7b870 100644 --- a/test/Concurrency/isolated_default_argument_eval.swift +++ b/test/Concurrency/isolated_default_argument_eval.swift @@ -27,11 +27,11 @@ func mainActorMultiDefaultArg(x: Int = requiresMainActor(), // CHECK-LABEL: sil hidden [ossa] @$s30isolated_default_argument_eval22nonisolatedAsyncCalleryyYaF func nonisolatedAsyncCaller() async { - // CHECK: hop_to_executor {{.*}} : $Optional + // CHECK: hop_to_executor {{.*}} // CHECK: hop_to_executor {{.*}} : $MainActor // CHECK: [[GET_VALUE:%[0-9]+]] = function_ref @$s30isolated_default_argument_eval19mainActorDefaultArg5valueS2i_tFfA_ // CHECK-NEXT: apply [[GET_VALUE]]() - // CHECK: hop_to_executor {{.*}} : $Optional + // CHECK: hop_to_executor {{.*}} await mainActorDefaultArg() // CHECK: hop_to_executor {{.*}} : $MainActor @@ -46,7 +46,7 @@ func nonisolatedAsyncCaller() async { // CHECK-NOT: hop_to_executor // CHECK: [[GET_Z:%[0-9]+]] = function_ref @$s30isolated_default_argument_eval24mainActorMultiDefaultArg1x1y5tuple1zySi_S2i_SitSitFfA2_ // CHECK-NEXT: apply [[GET_Z]]() - // CHECK: hop_to_executor {{.*}} : $Optional + // CHECK: hop_to_executor {{.*}} await mainActorMultiDefaultArg() } @@ -57,7 +57,7 @@ var argValue: Int { 0 } // CHECK-LABEL: sil hidden [ossa] @$s30isolated_default_argument_eval20passInoutWithDefaultyyYaF func passInoutWithDefault() async { - // CHECK: hop_to_executor {{.*}} : $Optional + // CHECK: hop_to_executor {{.*}} var x = 0 @@ -69,7 +69,7 @@ func passInoutWithDefault() async { // CHECK-NEXT: [[Z:%[0-9]+]] = apply [[GET_Z]]() // CHECK: [[FN:%[0-9]+]] = function_ref @$s30isolated_default_argument_eval0A15DefaultInoutMix1x1y1zySiz_S2itF : $@convention(thin) (@inout Int, Int, Int) -> () // CHECK: apply [[FN]]([[INOUT_X]], [[ARG_VALUE]], [[Z]]) - // CHECK: hop_to_executor {{.*}} : $Optional + // CHECK: hop_to_executor {{.*}} await isolatedDefaultInoutMix(x: &x, y: argValue) } diff --git a/test/Concurrency/isolated_nonsending_isolation_macro_ir_64.swift b/test/Concurrency/isolated_nonsending_isolation_macro_ir_64.swift new file mode 100644 index 0000000000000..97a5d71e9b758 --- /dev/null +++ b/test/Concurrency/isolated_nonsending_isolation_macro_ir_64.swift @@ -0,0 +1,47 @@ +// RUN: %target-swift-frontend -parse-as-library -Xllvm -aarch64-use-tbi -emit-ir -disable-llvm-merge-functions-pass %s | %FileCheck %s + +// This test makes sure that we can properly fold the mask for the witness table +// when we have a #isolation. + +// REQUIRES: concurrency +// REQUIRES: CODEGENERATOR=AArch64 +// REQUIRES: PTRSIZE=64 +// REQUIRES: OS=macosx || OS=ios +// REQUIRES: CPU=arm64 + +@inline(never) +func useActor(iso: (any Actor)?) { + print(iso!.unownedExecutor) +} + +@inline(never) +func implicitParam(_ x: (any Actor)? = #isolation) { + print(x!.unownedExecutor) +} + +// #isolation via direct usage +// +// CHECK-LABEL: define internal swifttailcc void @"$s41isolated_nonsending_isolation_macro_ir_6446nonisolatedNonsendingUsePoundIsolationDirectlyyyYaFTY0_"( +// CHECK: [[MASK:%.*]] = and i64 {{%.*}}, -3458764513820540929 +// CHECK: [[MEM_ADJUSTED:%.*]] = getelementptr inbounds <{ i64, i64 }>, ptr [[MEM:%.*]], i32 0, i32 1 +// CHECK: store i64 [[MASK]], ptr [[MEM_ADJUSTED]] +// CHECK: [[MEM_ADJUSTED_2:%.*]] = getelementptr inbounds { i64, i64 }, ptr [[MEM]], i32 0, i32 1 +// CHECK: [[MEM_LOAD:%.*]] = load i64, ptr [[MEM_ADJUSTED_2]] +// CHECK: call swiftcc void @"$s41isolated_nonsending_isolation_macro_ir_648useActor3isoyScA_pSg_tF"(i64 {{%.*}}, i64 [[MEM_LOAD]]) +public nonisolated(nonsending) func nonisolatedNonsendingUsePoundIsolationDirectly() async { + let iso = #isolation + useActor(iso: iso) +} + +// #isolation via default arg +// +// CHECK-LABEL: define internal swifttailcc void @"$s41isolated_nonsending_isolation_macro_ir_6445nonisolatedNonsendingPoundIsolationDefaultArgyyYaFTY0_"( +// CHECK: [[MASK:%.*]] = and i64 {{%.*}}, -3458764513820540929 +// CHECK: [[MEM_ADJUSTED:%.*]] = getelementptr inbounds <{ i64, i64 }>, ptr [[MEM:%.*]], i32 0, i32 1 +// CHECK: store i64 [[MASK]], ptr [[MEM_ADJUSTED]] +// CHECK: [[MEM_ADJUSTED_2:%.*]] = getelementptr inbounds { i64, i64 }, ptr [[MEM]], i32 0, i32 1 +// CHECK: [[MEM_LOAD:%.*]] = load i64, ptr [[MEM_ADJUSTED_2]] +// CHECK: call swiftcc void @"$s41isolated_nonsending_isolation_macro_ir_6413implicitParamyyScA_pSgF"(i64 {{%.*}}, i64 [[MEM_LOAD]]) +public nonisolated(nonsending) func nonisolatedNonsendingPoundIsolationDefaultArg() async { + implicitParam() +} diff --git a/test/Concurrency/isolated_nonsending_isolation_macro_sil.swift b/test/Concurrency/isolated_nonsending_isolation_macro_sil.swift index 718706d5dc8e1..5d45f9e9192ec 100644 --- a/test/Concurrency/isolated_nonsending_isolation_macro_sil.swift +++ b/test/Concurrency/isolated_nonsending_isolation_macro_sil.swift @@ -1,25 +1,108 @@ -// RUN: %target-swift-frontend -parse-as-library -emit-sil %s | %FileCheck %s +// RUN: %target-swift-frontend -parse-as-library -emit-silgen -Xllvm -aarch64-use-tbi %s | %FileCheck -check-prefix=CHECK -check-prefix=TBI %s +// RUN: %target-swift-frontend -parse-as-library -emit-silgen %s -enable-experimental-feature NonisolatedNonsendingDynamicHopElim | %FileCheck -check-prefix=CHECK -check-prefix=TAG %s +// RUN: %target-swift-frontend -parse-as-library -emit-silgen %s | %FileCheck -check-prefix=NO-TBI %s +// REQUIRES: swift_feature_NonisolatedNonsendingDynamicHopElim // REQUIRES: concurrency +// REQUIRES: CODEGENERATOR=AArch64 +// REQUIRES: PTRSIZE=64 +// REQUIRES: OS=macosx || OS=ios +// REQUIRES: CPU=arm64 +// REQUIRES: asserts -nonisolated(nonsending) func nonisolatedNonsending() async { +func useActor(iso: (any Actor)?) {} +func implicitParam(_ x: (any Actor)? = #isolation) {} + +// CHECK-LABEL: sil hidden [ossa] @$s39isolated_nonsending_isolation_macro_sil46nonisolatedNonsendingUsePoundIsolationDirectlyyyYaF : $@convention(thin) @async (@sil_isolated @sil_implicit_leading_param @guaranteed Optional) -> () { +// CHECK: bb0([[ACTOR:%.*]] : @guaranteed $Optional): +// +// #isolation without default arg +// CHECK: hop_to_executor [[ACTOR]] +// CHECK: [[CAST_TUPLE:%.*]] = unchecked_trivial_bit_cast [[ACTOR]] to $(Builtin.Word, Builtin.Word) +// CHECK: ([[POINTER:%.*]], [[WITNESS:%.*]]) = destructure_tuple [[CAST_TUPLE]] + +// MASK = (0x3 << (((sizeof(Word) - 1) << 3) + 4)) ^ -1 +// TBI: [[INT_NEG:%.*]] = integer_literal $Builtin.Word, -1 +// TBI: [[WORD_SIZE:%.*]] = builtin "sizeof"( +// TBI: [[INT_ONE:%.*]] = integer_literal $Builtin.Word, 1 +// TBI: [[INT_THREE:%.*]] = integer_literal $Builtin.Word, 3 +// TBI: [[INT_FOUR:%.*]] = integer_literal $Builtin.Word, 4 +// TBI: [[INT_THREE_2:%.*]] = integer_literal $Builtin.Word, 3 +// TBI: [[WORD_MINUS_ONE:%.*]] = builtin "sub_Word"([[WORD_SIZE]], [[INT_ONE]]) +// TBI: [[INNER_SHIFT:%.*]] = builtin "shl_Word"([[WORD_MINUS_ONE]], [[INT_THREE]]) +// TBI: [[INNER_SHIFT_ADD:%.*]] = builtin "add_Word"([[INNER_SHIFT]], [[INT_FOUR]]) +// TBI: [[OUTER_SHIFT:%.*]] = builtin "shl_Word"([[INT_THREE_2]], [[INNER_SHIFT_ADD]]) +// TBI: [[MASK:%.*]] = builtin "xor_Word"([[OUTER_SHIFT]], [[INT_NEG]]) + +// TAG: [[MASK:%.*]] = integer_literal $Builtin.Word, -4 + +// CHECK: [[MASKED_WITNESS:%.*]] = builtin "and_Word"([[WITNESS]], [[MASK]]) +// CHECK: [[REFORMED_TUPLE:%.*]] = tuple ([[POINTER]], [[MASKED_WITNESS]]) +// CHECK: [[CAST_BACK:%.*]] = unchecked_bitwise_cast [[REFORMED_TUPLE]] to $Optional +// CHECK: [[CAST_BACK_G:%.*]] = unchecked_ownership_conversion [[CAST_BACK]], @unowned to @guaranteed +// CHECK: [[MARK_DEP:%.*]] = mark_dependence [nonescaping] [[CAST_BACK_G]] on [[ACTOR]] +// CHECK: [[MARK_DEP_C:%.*]] = copy_value [[MARK_DEP]] +// CHECK: [[ISO:%.*]] = move_value [lexical] [var_decl] [[MARK_DEP_C]] +// CHECK: debug_value [[ISO]], let, name "iso" +// CHECK: [[ISO_B:%.*]] = begin_borrow [[ISO]] +// CHECK: [[FUNC:%.*]] = function_ref @$s39isolated_nonsending_isolation_macro_sil8useActor3isoyScA_pSg_tF : $@convention(thin) (@guaranteed Optional) -> () +// CHECK: apply [[FUNC]]([[ISO_B]]) : $@convention(thin) (@guaranteed Optional) -> () +// CHECK: end_borrow [[ISO_B]] +// CHECK: destroy_value [[ISO]] +// CHECK: } // end sil function '$s39isolated_nonsending_isolation_macro_sil46nonisolatedNonsendingUsePoundIsolationDirectlyyyYaF' + +// NO-TBI-LABEL: sil hidden [ossa] @$s39isolated_nonsending_isolation_macro_sil46nonisolatedNonsendingUsePoundIsolationDirectlyyyYaF : $@convention(thin) @async (@sil_isolated @sil_implicit_leading_param @guaranteed Optional) -> () { +// NO-TBI: bb0([[ACTOR:%.*]] : @guaranteed $Optional): +// +// #isolation without default arg +// NO-TBI: hop_to_executor [[ACTOR]] +// NO-TBI: [[ACTOR_COPY:%.*]] = copy_value [[ACTOR]] +// NO-TBI: [[ISO:%.*]] = move_value [lexical] [var_decl] [[ACTOR_COPY]] +// NO-TBI: [[ISO_B:%.*]] = begin_borrow [[ISO]] +// NO-TBI: [[FUNC:%.*]] = function_ref @$s39isolated_nonsending_isolation_macro_sil8useActor3isoyScA_pSg_tF : $@convention(thin) (@guaranteed Optional) -> () +// NO-TBI: apply [[FUNC]]([[ISO_B]]) : $@convention(thin) (@guaranteed Optional) -> () +// NO-TBI: } // end sil function '$s39isolated_nonsending_isolation_macro_sil46nonisolatedNonsendingUsePoundIsolationDirectlyyyYaF' +nonisolated(nonsending) func nonisolatedNonsendingUsePoundIsolationDirectly() async { let iso = #isolation - take(iso: iso) + useActor(iso: iso) } -func take(iso: (any Actor)?) {} - -// CHECK-LABEL: // nonisolatedNonsending() -// CHECK-NEXT: // Isolation: caller_isolation_inheriting -// CHECK-NEXT: sil hidden @$s39isolated_nonsending_isolation_macro_sil21nonisolatedNonsendingyyYaF : $@convention(thin) @async (@sil_isolated @sil_implicit_leading_param @guaranteed Optional) -> () { -// CHECK: bb0(%0 : $Optional): -// CHECK-NEXT: hop_to_executor %0 // id: %1 -// CHECK-NEXT: retain_value %0 // id: %2 -// CHECK-NEXT: debug_value %0, let, name "iso" // id: %3 -// CHECK-NEXT: // function_ref take(iso:) -// CHECK-NEXT: %4 = function_ref @$s39isolated_nonsending_isolation_macro_sil4take3isoyScA_pSg_tF : $@convention(thin) (@guaranteed Optional) -> () // user: %5 -// CHECK-NEXT: %5 = apply %4(%0) : $@convention(thin) (@guaranteed Optional) -> () -// CHECK-NEXT: release_value %0 // id: %6 -// CHECK-NEXT: %7 = tuple () // user: %8 -// CHECK-NEXT: return %7 // id: %8 -// CHECK-NEXT: } // end sil function '$s39isolated_nonsending_isolation_macro_sil21nonisolatedNonsendingyyYaF' \ No newline at end of file +// #isolation via default arg +// +// CHECK-LABEL: sil hidden [ossa] @$s39isolated_nonsending_isolation_macro_sil45nonisolatedNonsendingPoundIsolationDefaultArgyyYaF : $@convention(thin) @async (@sil_isolated @sil_implicit_leading_param @guaranteed Optional) -> () { +// CHECK: bb0([[ACTOR:%.*]] : @guaranteed $Optional): +// CHECK: [[CAST_PTR:%.*]] = unchecked_trivial_bit_cast [[ACTOR]] to $(Builtin.Word, Builtin.Word) +// CHECK: ([[POINTER:%.*]], [[WITNESS:%.*]]) = destructure_tuple [[CAST_PTR]] + +// MASK = (1 << (((sizeof(Word) - 1) << 3) + 4)) ^ -1 +// TBI: [[INT_NEG:%.*]] = integer_literal $Builtin.Word, -1 +// TBI: [[WORD_SIZE:%.*]] = builtin "sizeof"( +// TBI: [[INT_ONE:%.*]] = integer_literal $Builtin.Word, 1 +// TBI: [[INT_THREE:%.*]] = integer_literal $Builtin.Word, 3 +// TBI: [[INT_FOUR:%.*]] = integer_literal $Builtin.Word, 4 +// TBI: [[INT_THREE_2:%.*]] = integer_literal $Builtin.Word, 3 +// TBI: [[WORD_MINUS_ONE:%.*]] = builtin "sub_Word"([[WORD_SIZE]], [[INT_ONE]]) +// TBI: [[INNER_SHIFT:%.*]] = builtin "shl_Word"([[WORD_MINUS_ONE]], [[INT_THREE]]) +// TBI: [[INNER_SHIFT_ADD:%.*]] = builtin "add_Word"([[INNER_SHIFT]], [[INT_FOUR]]) +// TBI: [[OUTER_SHIFT:%.*]] = builtin "shl_Word"([[INT_THREE_2]], [[INNER_SHIFT_ADD]]) +// TBI: [[MASK:%.*]] = builtin "xor_Word"([[OUTER_SHIFT]], [[INT_NEG]]) + +// TAG: [[MASK:%.*]] = integer_literal $Builtin.Word, -4 + +// CHECK: [[MASKED_WITNESS:%.*]] = builtin "and_Word"([[WITNESS]], [[MASK]]) +// CHECK: [[REFORMED_TUPLE:%.*]] = tuple ([[POINTER]], [[MASKED_WITNESS]]) +// CHECK: [[CAST_BACK:%.*]] = unchecked_bitwise_cast [[REFORMED_TUPLE]] to $Optional +// CHECK: [[CAST_BACK_G:%.*]] = unchecked_ownership_conversion [[CAST_BACK]], @unowned to @guaranteed +// CHECK: [[MARK_DEP:%.*]] = mark_dependence [nonescaping] [[CAST_BACK_G]] on [[ACTOR]] +// CHECK: [[FUNC:%.*]] = function_ref @$s39isolated_nonsending_isolation_macro_sil13implicitParamyyScA_pSgF : $@convention(thin) (@guaranteed Optional) -> () +// CHECK: apply [[FUNC]]([[MARK_DEP]]) : $@convention(thin) (@guaranteed Optional) -> () +// CHECK: } // end sil function '$s39isolated_nonsending_isolation_macro_sil45nonisolatedNonsendingPoundIsolationDefaultArgyyYaF' +// +// NO-TBI-LABEL: sil hidden [ossa] @$s39isolated_nonsending_isolation_macro_sil45nonisolatedNonsendingPoundIsolationDefaultArgyyYaF : $@convention(thin) @async (@sil_isolated @sil_implicit_leading_param @guaranteed Optional) -> () { +// NO-TBI: bb0([[ACTOR:%.*]] : @guaranteed $Optional): +// NO-TBI: [[FUNC:%.*]] = function_ref @$s39isolated_nonsending_isolation_macro_sil13implicitParamyyScA_pSgF : $@convention(thin) (@guaranteed Optional) -> () +// NO-TBI: apply [[FUNC]]([[ACTOR]]) : $@convention(thin) (@guaranteed Optional) -> () +// NO-TBI: } // end sil function '$s39isolated_nonsending_isolation_macro_sil45nonisolatedNonsendingPoundIsolationDefaultArgyyYaF' +nonisolated(nonsending) func nonisolatedNonsendingPoundIsolationDefaultArg() async { + implicitParam() +} diff --git a/test/IRGen/typed_throws_abi.swift b/test/IRGen/typed_throws_abi.swift index 78cad66d967b0..1637e2841d70b 100644 --- a/test/IRGen/typed_throws_abi.swift +++ b/test/IRGen/typed_throws_abi.swift @@ -3107,7 +3107,7 @@ func callNonMatching_f1(_ b: Bool) -> (Int, Float, Bool, Float) { // CHECK: [[SUCCESS]]: // CHECK: call i1 (ptr, i1, ...) @llvm.coro.end.async(ptr {{%.*}}, i1 false, ptr @"$s16typed_throws_abi20nonMatching_f0_asyncySf_SftSbYaAA7OneWordVYKF{{.*}}", ptr {{%.*}}, ptr {{%.*}}, float 1.000000e+00, float 2.000000e+00, i64 undef, ptr null) // CHECK: unreachable -// CHECK: 18: +// CHECK: [[ERROR]]: // CHECK: [[ERROR_X:%.*]] = call swiftcc i64 @"$s16typed_throws_abi7OneWordVACycfC"() // CHECK: [[ERROR_RET:%.*]] = insertvalue { float, float, i64 } undef, i64 [[ERROR_X]], 2 // CHECK: [[ERROR_RET0:%.*]] = extractvalue { float, float, i64 } [[ERROR_RET]], 0 diff --git a/test/SILGen/async_builtins.swift b/test/SILGen/async_builtins.swift index b7358581eea0b..702a71e32f996 100644 --- a/test/SILGen/async_builtins.swift +++ b/test/SILGen/async_builtins.swift @@ -2,6 +2,7 @@ // REQUIRES: concurrency import Swift +import _Concurrency public struct X { // CHECK-LABEL: sil hidden [ossa] @$s4test1XV14getCurrentTaskBoyYaF diff --git a/test/SILGen/async_initializer.swift b/test/SILGen/async_initializer.swift index 56b96e9ee70ed..c659f7453ce8e 100644 --- a/test/SILGen/async_initializer.swift +++ b/test/SILGen/async_initializer.swift @@ -64,7 +64,7 @@ actor MyActor { // CHECK-DAG: sil hidden [ossa] @$s12initializers7MyActorCACyYacfc : $@convention(method) @async (@sil_isolated @owned MyActor) -> @owned MyActor // CHECK: bb0(%0 : @owned $MyActor): // In the prologue, hop to the generic executor. - // CHECK-NEXT: [[NIL_EXECUTOR:%.*]] = enum $Optional, #Optional.none + // CHECK-NEXT: [[NIL_EXECUTOR:%.*]] = enum $Optional, #Optional.none // CHECK-NEXT: hop_to_executor [[NIL_EXECUTOR]] : // Later, when we return from an async call, hop to the // correct flow-sensitive value. @@ -73,9 +73,11 @@ actor MyActor { // NI-NEXT: apply [[FN]] // // NI-NS: [[ISOLATION_1:%.*]] = builtin "flowSensitiveSelfIsolation"({{%.*}}) + // NI-NS-NEXT: [[ISOLATION_1_B:%.*]] = begin_borrow [[ISOLATION_1]] // NI-NS-NEXT: // function_ref // NI-NS-NEXT: [[FN:%.*]] = function_ref @$s12initializers8MyStructVACyYacfC : - // NI-NS-NEXT: apply [[FN]]([[ISOLATION_1]] + // NI-NS-NEXT: apply [[FN]]([[ISOLATION_1_B]] + // NI-NS-NEXT: end_borrow [[ISOLATION_1_B]] // NI-NS-NEXT: destroy_value [[ISOLATION_1]] // CHECK-NEXT: [[ISOLATION_2:%.*]] = builtin "flowSensitiveSelfIsolation"({{%.*}}) // CHECK-NEXT: hop_to_executor [[ISOLATION_2]] @@ -127,6 +129,7 @@ class Cat { // CHECK: {{%[0-9]+}} = function_ref @$s12initializers11someAsyncFnyyYaF : // NI: {{%[0-9]+}} = apply {{%[0-9]+}}() : $@convention(thin) @async () -> () // NI-NS: {{%[0-9]+}} = apply {{%[0-9]+}}({{%.*}}) : $@convention(thin) @async (@sil_isolated @sil_implicit_leading_param @guaranteed Optional) -> () + // NI-NS-NEXT: end_borrow {{%.*}} // NI-NS-NEXT: destroy_value {{%.*}} // CHECK-NEXT: hop_to_executor {{%[0-9]+}} : $MainActor // CHECK: } // end sil function '$s12initializers3CatCACyYacfc' @@ -143,6 +146,7 @@ struct Dog { // CHECK: {{%[0-9]+}} = function_ref @$s12initializers11someAsyncFnyyYaF // NI: {{%[0-9]+}} = apply {{%[0-9]+}}() : $@convention(thin) @async () -> () // NI-NS: {{%[0-9]+}} = apply {{%[0-9]+}}({{%.*}}) : $@convention(thin) @async (@sil_isolated @sil_implicit_leading_param @guaranteed Optional) -> () + // NI-NS-NEXT: end_borrow {{%.*}} // NI-NS-NEXT: destroy_value {{%.*}} // CHECK-NEXT: hop_to_executor {{%[0-9]+}} : $MainActor // CHECK: } // end sil function '$s12initializers3DogVACyYacfC' @@ -169,12 +173,12 @@ enum Birb { } // NI-LABEL: sil hidden [ossa] @$s12initializers7makeCatyyYaF : $@convention(thin) @async () -> () { -// NI: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none -// NI-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional +// NI: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none +// NI-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional // NI: hop_to_executor [[BORROWED_EXECUTOR:%[0-9]+]] // NI: end_borrow [[BORROWED_EXECUTOR]] // NI-NEXT: {{%[0-9]+}} = apply {{%[0-9]+}}({{%[0-9]+}}, {{%[0-9]+}}) : $@convention(method) (@owned String, @thick Cat.Type) -> @owned Cat -// NI: hop_to_executor [[GENERIC_EXEC]] : $Optional +// NI: hop_to_executor [[GENERIC_EXEC]] : $Optional // NI: } // end sil function '$s12initializers7makeCatyyYaF' // NI-NS-LABEL: sil hidden [ossa] @$s12initializers7makeCatyyYaF : $@convention(thin) @async (@sil_isolated @sil_implicit_leading_param @guaranteed Optional) -> () { @@ -192,12 +196,12 @@ func makeCat() async { } // NI-LABEL: sil hidden [ossa] @$s12initializers7makeDogyyYaF : $@convention(thin) @async () -> () { -// NI: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none -// NI-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional +// NI: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none +// NI-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional // NI: hop_to_executor [[BORROWED_EXEC:%.*]] : // NI-NEXT: end_borrow [[BORROWED_EXEC]] // NI-NEXT: {{%[0-9]+}} = apply {{%[0-9]+}}({{%[0-9]+}}, {{%[0-9]+}}) : $@convention(method) (@owned String, @thin Dog.Type) -> Dog -// NI: hop_to_executor [[GENERIC_EXEC]] : $Optional +// NI: hop_to_executor [[GENERIC_EXEC]] : $Optional // NI: } // end sil function '$s12initializers7makeDogyyYaF' // NI-NS-LABEL: sil hidden [ossa] @$s12initializers7makeDogyyYaF : $@convention(thin) @async (@sil_isolated @sil_implicit_leading_param @guaranteed Optional) -> () { @@ -213,12 +217,12 @@ func makeDog() async { } // NI-LABEL: sil hidden [ossa] @$s12initializers8makeBirbyyYaF : $@convention(thin) @async () -> () { -// NI: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none -// NI-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional +// NI: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none +// NI-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional // NI: hop_to_executor [[BORROWED_EXEC:%.*]] : $MainActor // NI-NEXT: end_borrow [[BORROWED_EXEC]] // NI-NEXT: {{%[0-9]+}} = apply {{%[0-9]+}}({{%[0-9]+}}, {{%[0-9]+}}) : $@convention(method) (@owned String, @thin Birb.Type) -> Birb -// NI: hop_to_executor [[GENERIC_EXEC]] : $Optional +// NI: hop_to_executor [[GENERIC_EXEC]] : $Optional // NI: } // end sil function '$s12initializers8makeBirbyyYaF' // NI-NS-LABEL: sil hidden [ossa] @$s12initializers8makeBirbyyYaF : $@convention(thin) @async (@sil_isolated @sil_implicit_leading_param @guaranteed Optional) -> () { @@ -238,7 +242,7 @@ actor SomeActor { // CHECK-LABEL: sil hidden [ossa] @$s12initializers9SomeActorCACyYacfc : $@convention(method) @async (@sil_isolated @owned SomeActor) -> @owned SomeActor { // CHECK: bb0(%0 : - // CHECK-NEXT: [[NIL_EXECUTOR:%.*]] = enum $Optional, #Optional.none + // CHECK-NEXT: [[NIL_EXECUTOR:%.*]] = enum $Optional, #Optional.none // CHECK-NEXT: hop_to_executor [[NIL_EXECUTOR]] init() async {} @@ -260,10 +264,10 @@ func makeActor() async -> SomeActor { } // NI-LABEL: sil hidden [ossa] @$s12initializers20makeActorFromGenericAA04SomeC0CyYaF : $@convention(thin) @async () -> @owned SomeActor { -// NI: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none -// NI-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional +// NI: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none +// NI-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional // NI: apply -// NI-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional +// NI-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional // NI: } // end sil function '$s12initializers20makeActorFromGenericAA04SomeC0CyYaF' // NI-NS-LABEL: sil hidden [ossa] @$s12initializers20makeActorFromGenericAA04SomeC0CyYaF : $@convention(thin) @async (@sil_isolated @sil_implicit_leading_param @guaranteed Optional) -> @owned SomeActor { @@ -277,10 +281,10 @@ func makeActorFromGeneric() async -> SomeActor { } // NI-LABEL: sil hidden [ossa] @$s12initializers26callActorMethodFromGeneric1ayAA04SomeC0C_tYaF : -// NI: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none -// NI-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional +// NI: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none +// NI-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional // NI: apply -// NI-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional +// NI-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional // NI: } // end sil function '$s12initializers26callActorMethodFromGeneric1ayAA04SomeC0C_tYaF' // NI-NS-LABEL: sil hidden [ossa] @$s12initializers26callActorMethodFromGeneric1ayAA04SomeC0C_tYaF : $@convention(thin) @async (@sil_isolated @sil_implicit_leading_param @guaranteed Optional, @guaranteed SomeActor) -> () { @@ -295,8 +299,8 @@ func callActorMethodFromGeneric(a: SomeActor) async { } // NI-LABEL: sil hidden {{.*}} @$s12initializers15makeActorInTaskyyYaF : $@convention(thin) @async () -> () { -// NI: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none -// NI-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional +// NI: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none +// NI-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional // NI: apply // NI: } // end sil function '$s12initializers15makeActorInTaskyyYaF' @@ -307,17 +311,17 @@ func callActorMethodFromGeneric(a: SomeActor) async { // NI-NS: } // end sil function '$s12initializers15makeActorInTaskyyYaF' // NI-LABEL: sil private [ossa] @$s12initializers15makeActorInTaskyyYaFAA04SomeC0CyYacfU_ : $@convention(thin) @async @substituted <τ_0_0> (@guaranteed Optional) -> @out τ_0_0 for { -// NI: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none -// NI-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional +// NI: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none +// NI-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional // NI: apply -// NI-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional +// NI-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional // NI: } // end sil function '$s12initializers15makeActorInTaskyyYaFAA04SomeC0CyYacfU_' // NI-NS-LABEL: sil private [ossa] @$s12initializers15makeActorInTaskyyYaFAA04SomeC0CyYacfU_ : $@convention(thin) @async @substituted <τ_0_0> (@guaranteed Optional) -> @out τ_0_0 for { -// NI-NS: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none -// NI-NS-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional +// NI-NS: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none +// NI-NS-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional // NI-NS: apply -// NI-NS-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional +// NI-NS-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional // NI-NS: } // end sil function '$s12initializers15makeActorInTaskyyYaFAA04SomeC0CyYacfU_' @available(SwiftStdlib 5.1, *) func makeActorInTask() async { @@ -325,8 +329,8 @@ func makeActorInTask() async { } // NI-LABEL: sil hidden {{.*}} @$s12initializers21callActorMethodInTask1ayAA04SomeC0C_tYaF : $@convention(thin) @async (@guaranteed SomeActor) -> () { -// NI: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none -// NI-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional +// NI: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none +// NI-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional // NI: apply // NI: } // end sil function '$s12initializers21callActorMethodInTask1ayAA04SomeC0C_tYaF' @@ -336,10 +340,10 @@ func makeActorInTask() async { // NI-NS: } // end sil function '$s12initializers21callActorMethodInTask1ayAA04SomeC0C_tYaF' // CHECK-LABEL: sil private [ossa] @$s12initializers21callActorMethodInTask1ayAA04SomeC0C_tYaFyyYacfU_ : $@convention(thin) @async @substituted <τ_0_0> (@guaranteed Optional, @guaranteed SomeActor) -> @out τ_0_0 for <()> { -// CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none -// CHECK-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional +// CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none +// CHECK-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional // CHECK: apply -// CHECK-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional +// CHECK-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional @available(SwiftStdlib 5.1, *) func callActorMethodInTask(a: SomeActor) async { Task.detached { await a.someMethod() } diff --git a/test/SILGen/execution_attr.swift b/test/SILGen/execution_attr.swift index 63dc3f0aac675..dc56e051eb632 100644 --- a/test/SILGen/execution_attr.swift +++ b/test/SILGen/execution_attr.swift @@ -38,9 +38,10 @@ struct S { // DISABLED: sil hidden [ossa] @$s14execution_attr0A11CallerFieldyyAA1SVYaF : $@convention(thin) @async (@guaranteed S) -> () { // DISABLED: bb0([[ARG:%.*]] : @guaranteed $S): +// DISABLED: [[ACTOR_NONE:%.*]] = enum $Optional, #Optional.none!enumelt +// DISABLED: hop_to_executor [[ACTOR_NONE]] // DISABLED: [[FIELD:%.*]] = struct_extract [[ARG]] // DISABLED: [[FIELD_COPY:%.*]] = copy_value [[FIELD]] -// DISABLED: [[ACTOR_NONE:%.*]] = enum $Optional, #Optional.none!enumelt // DISABLED: [[BORROWED_FIELD:%.*]] = begin_borrow [[FIELD_COPY]] // DISABLED: apply [[BORROWED_FIELD]]([[ACTOR_NONE]]) // DISABLED: } // end sil function '$s14execution_attr0A11CallerFieldyyAA1SVYaF' @@ -65,7 +66,7 @@ extension S { // CHECK-LABEL: sil hidden [ossa] @$s14execution_attr24testWithDynamicIsolation2fnyyyYAXE_tYaF : $@convention(thin) @async (@guaranteed @isolated(any) @noescape @callee_guaranteed () -> ()) -> () { // CHECK: bb0([[PARAM_FN:%.*]] : @guaranteed $@isolated(any) @noescape @callee_guaranteed () -> ()): -// CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none!enumelt +// CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none!enumelt // CHECK-NEXT: hop_to_executor [[GENERIC_EXEC]] // CHECK-NEXT: [[FN:%.*]] = copy_value [[PARAM_FN]] // CHECK-NEXT: [[BORROWED_FN:%.*]] = begin_borrow [[FN]] diff --git a/test/SILGen/hop_to_executor.swift b/test/SILGen/hop_to_executor.swift index a1daf20bed2c5..27399f366e61f 100644 --- a/test/SILGen/hop_to_executor.swift +++ b/test/SILGen/hop_to_executor.swift @@ -3,7 +3,7 @@ // CHECK-LABEL: sil hidden [ossa] @$s4test16unspecifiedAsyncyyYaF : $@convention(thin) @async () -> () // CHECK: bb0: -// CHECK-NEXT: [[GENERIC:%[0-9]+]] = enum $Optional, #Optional.none!enumelt +// CHECK-NEXT: [[GENERIC:%[0-9]+]] = enum $Optional, #Optional.none!enumelt // CHECK-NEXT: hop_to_executor [[GENERIC]] // CHECK: } // end sil function '$s4test16unspecifiedAsyncyyYaF' func unspecifiedAsync() async {} @@ -13,7 +13,7 @@ actor MyActor { private var p: Int // CHECK-LABEL: sil hidden [ossa] @$s4test7MyActorC6calleeyySiYaF : $@convention(method) @async (Int, @guaranteed MyActor) -> () { - // CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none + // CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none // CHECK: hop_to_executor [[GENERIC_EXEC]] : // CHECK: } // end sil function '$s4test7MyActorC6calleeyySiYaF' nonisolated func callee(_ x: Int) async { @@ -21,7 +21,7 @@ actor MyActor { } // CHECK-LABEL: sil hidden [ossa] @$s4test7MyActorC14throwingCalleeyySiYaKF : $@convention(method) @async (Int, @guaranteed MyActor) -> @error any Error { - // CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none + // CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none // CHECK: hop_to_executor [[GENERIC_EXEC]] : // CHECK: } // end sil function '$s4test7MyActorC14throwingCalleeyySiYaKF' nonisolated func throwingCallee(_ x: Int) async throws { @@ -283,7 +283,7 @@ struct BlueActor { } // CHECK-LABEL: sil hidden [ossa] @$s4test20unspecifiedAsyncFuncyyYaF : $@convention(thin) @async () -> () { -// CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none +// CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none // CHECK-NEXT: hop_to_executor [[GENERIC_EXEC]] : // CHECK: [[BORROW:%[0-9]+]] = begin_borrow {{%[0-9]+}} : $RedActorImpl // CHECK-NEXT: hop_to_executor [[BORROW]] : $RedActorImpl @@ -298,7 +298,7 @@ func unspecifiedAsyncFunc() async { // CHECK-LABEL: sil hidden [ossa] @$s4test27anotherUnspecifiedAsyncFuncyyAA12RedActorImplCYaF : $@convention(thin) @async (@guaranteed RedActorImpl) -> () { // CHECK: bb0([[RED:%[0-9]+]] : @guaranteed $RedActorImpl): -// CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none +// CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none // CHECK-NEXT: hop_to_executor [[GENERIC_EXEC]] : // CHECK: [[INTARG:%[0-9]+]] = apply {{%[0-9]+}}({{%[0-9]+}}, {{%[0-9]+}}) : $@convention(method) (Builtin.IntLiteral, @thin Int.Type) -> Int // CHECK: [[METH:%[0-9]+]] = class_method [[RED]] : $RedActorImpl, #RedActorImpl.hello : (isolated RedActorImpl) -> (Int) -> (), $@convention(method) (Int, @sil_isolated @guaranteed RedActorImpl) -> () @@ -311,14 +311,14 @@ func anotherUnspecifiedAsyncFunc(_ red : RedActorImpl) async { } // CHECK-LABEL: sil hidden [ossa] @$s4test0A20GlobalActorFuncValueyyyyAA03RedC0VYcXEYaF -// CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none +// CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none // CHECK: hop_to_executor [[GENERIC_EXEC]] : // CHECK: function_ref @$s4test8RedActorV6sharedAA0bC4ImplCvgZ // CHECK: hop_to_executor [[RED:%[0-9]+]] : $RedActorImpl // CHECK-NEXT: end_borrow [[RED]] // CHECK-NEXT: begin_borrow // CHECK-NEXT: apply -// CHECK: hop_to_executor [[GENERIC_EXEC:%[0-9]+]] : $Optional +// CHECK: hop_to_executor [[GENERIC_EXEC:%[0-9]+]] : $Optional func testGlobalActorFuncValue(_ fn: @RedActor () -> Void) async { await fn() } @@ -482,18 +482,18 @@ extension MyActor { func testImplicitAsyncIsolatedParam( i: Int, d: Double, actor: MyActor, otherActor: MyActor ) async { - // CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none + // CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none // CHECK-NEXT: hop_to_executor [[GENERIC_EXEC]] : // CHECK: [[FN1:%.*]] = function_ref @$s4test19acceptIsolatedParamyySi_AA7MyActorCYiSdtF // CHECK-NEXT: hop_to_executor [[ACTOR:%.*]] : $MyActor // CHECK-NEXT: apply [[FN1]](%0, %2, %1) : $@convention(thin) (Int, @sil_isolated @guaranteed MyActor, Double) -> () - // CHECK-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional + // CHECK-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional await acceptIsolatedParam(i, actor, d) // CHECK: [[FN2:%.*]] = function_ref @$s4test7MyActorC13otherIsolatedyySi_ACYiSdtF : $@convention(method) (Int, @sil_isolated @guaranteed MyActor, Double, @guaranteed MyActor) -> () // CHECK-NEXT: hop_to_executor [[ACTOR:%.*]] : $MyActor // CHECK-NEXT: apply [[FN2]](%0, %2, %1, %3) : $@convention(method) (Int, @sil_isolated @guaranteed MyActor, Double, @guaranteed MyActor) -> () - // CHECK-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional + // CHECK-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional await otherActor.otherIsolated(i, actor, d) } diff --git a/test/SILGen/hop_to_executor_async_prop.swift b/test/SILGen/hop_to_executor_async_prop.swift index 979725b076998..b86bb550c1b98 100644 --- a/test/SILGen/hop_to_executor_async_prop.swift +++ b/test/SILGen/hop_to_executor_async_prop.swift @@ -81,7 +81,7 @@ struct GlobalCat { // CHECK-LABEL: sil hidden [ossa] @$s4test015accessSweaterOfC03catAA0C0VAA3CatC_tYaF : $@convention(thin) @async (@guaranteed Cat) -> @owned Sweater { // CHECK: bb0([[CAT:%[0-9]+]] : @guaranteed $Cat): -// CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none +// CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none // CHECK: hop_to_executor [[GENERIC_EXEC]] : // CHECK: [[CAT_GETTER:%[0-9]+]] = class_method [[CAT]] : $Cat, #Cat.computedSweater!getter : (isolated Cat) -> () -> Sweater, $@convention(method) (@sil_isolated @guaranteed Cat) -> @owned Sweater // CHECK: hop_to_executor [[CAT]] : $Cat @@ -110,7 +110,7 @@ func accessSweaterOfSweater(cat : Cat) async -> Sweater { // CHECK-LABEL: sil hidden [ossa] @$s4test26accessGlobalIsolatedMember3catSSAA3CatC_tYaF : $@convention(thin) @async (@guaranteed Cat) -> @owned String { // CHECK: bb0([[CAT:%[0-9]+]] : @guaranteed $Cat): -// CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none +// CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none // CHECK: hop_to_executor [[GENERIC_EXEC]] : // CHECK: [[GETTER:%[0-9]+]] = class_method [[CAT]] : $Cat, #Cat.leader!getter : (Cat) -> () -> String, $@convention(method) (@guaranteed Cat) -> @owned String @@ -443,21 +443,21 @@ struct Container { @GlobalCat var isoRef: CatBox = CatBox() // CHECK-LABEL: sil hidden [ossa] @$s4test9ContainerV12accessTuple1SfyYaF : $@convention(method) @async (@guaranteed Container) -> Float { - // CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none + // CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none // CHECK: hop_to_executor [[GENERIC_EXEC]] : // CHECK: hop_to_executor {{%[0-9]+}} : $MainActor // CHECK: [[ACCESS:%[0-9]+]] = begin_access [read] [dynamic] {{%[0-9]+}} : $*(Optional<(Int, Int)>, Float) // CHECK: [[ADDR:%[0-9]+]] = tuple_element_addr [[ACCESS]] : $*(Optional<(Int, Int)>, Float), 1 // CHECK: {{%[0-9]+}} = load [trivial] [[ADDR]] : $*Float // CHECK: end_access [[ACCESS]] : $*(Optional<(Int, Int)>, Float) - // CHECK: hop_to_executor [[GENERIC_EXEC]] : $Optional + // CHECK: hop_to_executor [[GENERIC_EXEC]] : $Optional // CHECK: } // end sil function '$s4test9ContainerV12accessTuple1SfyYaF' func accessTuple1() async -> Float { return await globalCircle.1 } // CHECK-LABEL: sil hidden [ossa] @$s4test9ContainerV12accessTuple2SiSgyYaFZ : $@convention(method) @async (@thin Container.Type) -> Optional { - // CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none + // CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none // CHECK: hop_to_executor [[GENERIC_EXEC]] : // CHECK: hop_to_executor {{%[0-9]+}} : $MainActor // CHECK: [[ACCESS:%[0-9]+]] = begin_access [read] [dynamic] {{%[0-9]+}} : $*(Optional<(Int, Int)>, Float) @@ -473,37 +473,37 @@ struct Container { // CHECK: [[ELM_ADDR:%[0-9]+]] = tuple_element_addr [[TUPLE_ADDR]] : $*(Int, Int), 0 // CHECK: {{%[0-9]+}} = load [trivial] [[ELM_ADDR]] : $*Int // CHECK: end_access [[ACCESS]] : $*(Optional<(Int, Int)>, Float) - // CHECK: hop_to_executor [[GENERIC_EXEC]] : $Optional + // CHECK: hop_to_executor [[GENERIC_EXEC]] : $Optional // CHECK: } // end sil function '$s4test9ContainerV12accessTuple2SiSgyYaFZ' static func accessTuple2() async -> Int? { return await globalCircle.0!.0 } // CHECK-LABEL: sil hidden [ossa] @$s4test9ContainerV12accessTuple3SfyYaF : $@convention(method) @async (@guaranteed Container) -> Float { - // CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none + // CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none // CHECK: hop_to_executor [[GENERIC_EXEC]] : // CHECK: [[ADDRESS_ACCESSOR:%[0-9]+]] = function_ref @$s4test9ContainerV12staticCircleSi_SitSg_Sftvau : $@convention(thin) () -> Builtin.RawPointer // CHECK: hop_to_executor {{%[0-9]+}} : $MainActor // CHECK: = apply [[ADDRESS_ACCESSOR]]() : $@convention(thin) () -> Builtin.RawPointer - // CHECK: hop_to_executor [[GENERIC_EXEC]] : $Optional + // CHECK: hop_to_executor [[GENERIC_EXEC]] : $Optional // CHECK: hop_to_executor {{%[0-9]+}} : $MainActor // CHECK: [[ACCESS:%[0-9]+]] = begin_access [read] [dynamic] {{%[0-9]+}} : $*(Optional<(Int, Int)>, Float) // CHECK: [[ADDR:%[0-9]+]] = tuple_element_addr [[ACCESS]] : $*(Optional<(Int, Int)>, Float), 1 // CHECK: {{%[0-9]+}} = load [trivial] [[ADDR]] : $*Float // CHECK: end_access [[ACCESS]] : $*(Optional<(Int, Int)>, Float) - // CHECK: hop_to_executor [[GENERIC_EXEC]] : $Optional + // CHECK: hop_to_executor [[GENERIC_EXEC]] : $Optional // CHECK: } // end sil function '$s4test9ContainerV12accessTuple3SfyYaF' func accessTuple3() async -> Float { return await Container.staticCircle.1 } // CHECK-LABEL: sil hidden [ossa] @$s4test9ContainerV12accessTuple4SiSgyYaFZ : $@convention(method) @async (@thin Container.Type) -> Optional { - // CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none + // CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none // CHECK: hop_to_executor [[GENERIC_EXEC]] : // CHECK: [[ADDRESS_ACCESSOR:%[0-9]+]] = function_ref @$s4test9ContainerV12staticCircleSi_SitSg_Sftvau : $@convention(thin) () -> Builtin.RawPointer // CHECK: hop_to_executor {{%[0-9]+}} : $MainActor // CHECK: = apply [[ADDRESS_ACCESSOR]]() : $@convention(thin) () -> Builtin.RawPointer - // CHECK: hop_to_executor [[GENERIC_EXEC]] : $Optional + // CHECK: hop_to_executor [[GENERIC_EXEC]] : $Optional // CHECK: hop_to_executor {{%[0-9]+}} : $MainActor // CHECK: [[ACCESS:%[0-9]+]] = begin_access [read] [dynamic] {{%[0-9]+}} : $*(Optional<(Int, Int)>, Float) // CHECK: [[ADDR:%[0-9]+]] = tuple_element_addr [[ACCESS]] : $*(Optional<(Int, Int)>, Float), 0 @@ -518,7 +518,7 @@ struct Container { // CHECK: [[ELM_ADDR:%[0-9]+]] = tuple_element_addr [[TUPLE_ADDR]] : $*(Int, Int), 0 // CHECK: {{%[0-9]+}} = load [trivial] [[ELM_ADDR]] : $*Int // CHECK: end_access [[ACCESS]] : $*(Optional<(Int, Int)>, Float) - // CHECK: hop_to_executor [[GENERIC_EXEC]] : $Optional + // CHECK: hop_to_executor [[GENERIC_EXEC]] : $Optional // CHECK: } // end sil function '$s4test9ContainerV12accessTuple4SiSgyYaFZ' static func accessTuple4() async -> Int? { return await Container.staticCircle.0!.0 @@ -526,16 +526,16 @@ struct Container { // CHECK-LABEL: sil hidden [ossa] @$s4test9ContainerV8getCountSiyYaFZ : $@convention(method) @async (@thin Container.Type) -> Int { - // CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none + // CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none // CHECK: hop_to_executor [[GENERIC_EXEC]] : // CHECK: [[ADDRESS_ACCESSOR:%[0-9]+]] = function_ref @$s4test9ContainerV7counterSivau : $@convention(thin) () -> Builtin.RawPointer // CHECK: hop_to_executor {{%[0-9]+}} : $MainActor // CHECK: = apply [[ADDRESS_ACCESSOR]]() : $@convention(thin) () -> Builtin.RawPointer - // CHECK: hop_to_executor [[GENERIC_EXEC]] : $Optional + // CHECK: hop_to_executor [[GENERIC_EXEC]] : $Optional // CHECK: hop_to_executor {{%[0-9]+}} : $MainActor // CHECK: {{%[0-9]+}} = begin_access [read] [dynamic] {{%[0-9]+}} : $*Int // CHECK: {{%[0-9]+}} = load [trivial] {{%[0-9]+}} : $*Int - // CHECK: hop_to_executor [[GENERIC_EXEC]] : $Optional + // CHECK: hop_to_executor [[GENERIC_EXEC]] : $Optional // CHECK: } // end sil function '$s4test9ContainerV8getCountSiyYaFZ' static func getCount() async -> Int { return await counter @@ -544,12 +544,12 @@ struct Container { // CHECK-LABEL: sil hidden [ossa] @$s4test9ContainerV8getValueSiSgyYaFZ : $@convention(method) @async (@thin Container.Type) -> Optional { // CHECK: bb0(%0 : $@thin Container.Type): - // CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none + // CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none // CHECK: hop_to_executor [[GENERIC_EXEC]] : // CHECK: [[ADDRESS_ACCESSOR:%[0-9]+]] = function_ref @$s4test9ContainerV4thisACSgvau : $@convention(thin) () -> Builtin.RawPointer // CHECK: hop_to_executor {{%[0-9]+}} : $MainActor // CHECK: = apply [[ADDRESS_ACCESSOR]]() : $@convention(thin) () -> Builtin.RawPointer - // CHECK: hop_to_executor {{%[0-9]+}} : $Optional + // CHECK: hop_to_executor {{%[0-9]+}} : $Optional // CHECK: [[MAIN:%[0-9]+]] = begin_borrow {{%[0-9]+}} : $MainActor // CHECK: hop_to_executor [[MAIN]] : $MainActor // CHECK: [[ACCESS:%[0-9]+]] = begin_access [read] [dynamic] {{%[0-9]+}} : $*Optional @@ -558,11 +558,11 @@ struct Container { // CHECK: [[TRUE_BB]]: // CHECK: {{%[0-9]+}} = load [trivial] {{%[0-9]+}} : $*Int // CHECK: end_access [[ACCESS]] : $*Optional - // CHECK: hop_to_executor [[GENERIC_EXEC]] : $Optional + // CHECK: hop_to_executor [[GENERIC_EXEC]] : $Optional // // CHECK: [[FALSE_BB]]: // CHECK: end_access [[ACCESS]] : $*Optional - // CHECK: hop_to_executor [[GENERIC_EXEC]] : $Optional + // CHECK: hop_to_executor [[GENERIC_EXEC]] : $Optional // // CHECK: } // end sil function '$s4test9ContainerV8getValueSiSgyYaFZ' static func getValue() async -> Int? { @@ -571,12 +571,12 @@ struct Container { // CHECK-LABEL: sil hidden [ossa] @$s4test9ContainerV10getOrCrashSfyYaFZ : $@convention(method) @async (@thin Container.Type) -> Float { // CHECK: bb0({{%[0-9]+}} : $@thin Container.Type): - // CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none + // CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none // CHECK: hop_to_executor [[GENERIC_EXEC]] : // CHECK: [[ADDRESS_ACCESSOR:%[0-9]+]] = function_ref @$s4test9ContainerV4thisACSgvau : $@convention(thin) () -> Builtin.RawPointer // CHECK: hop_to_executor {{%[0-9]+}} : $MainActor // CHECK: = apply [[ADDRESS_ACCESSOR]]() : $@convention(thin) () -> Builtin.RawPointer - // CHECK: hop_to_executor [[GENERIC_EXEC]] : $Optional + // CHECK: hop_to_executor [[GENERIC_EXEC]] : $Optional // CHECK: hop_to_executor {{%.*}} : $MainActor // CHECK: [[ACCESS:%[0-9]+]] = begin_access [read] [dynamic] {{%[0-9]+}} : $*Optional // CHECK: switch_enum_addr [[ACCESS]] : $*Optional, case #Optional.some!enumelt: [[SOME_BB:bb[0-9]+]], case #Optional.none!enumelt: [[CRASH_BB:bb[0-9]+]] @@ -597,12 +597,12 @@ struct Container { // CHECK-LABEL: sil hidden [ossa] @$s4test9ContainerV13getRefOrCrashAA6CatBoxCyYaFZ : $@convention(method) @async (@thin Container.Type) -> @owned CatBox { // CHECK: bb0({{%[0-9]+}} : $@thin Container.Type): - // CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none + // CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none // CHECK: hop_to_executor [[GENERIC_EXEC]] : // CHECK: [[ADDRESS_ACCESSOR:%[0-9]+]] = function_ref @$s4test9ContainerV4thisACSgvau : $@convention(thin) () -> Builtin.RawPointer // CHECK: hop_to_executor {{%[0-9]+}} : $MainActor // CHECK: = apply [[ADDRESS_ACCESSOR]]() : $@convention(thin) () -> Builtin.RawPointer - // CHECK: hop_to_executor [[GENERIC_EXEC]] : $Optional + // CHECK: hop_to_executor [[GENERIC_EXEC]] : $Optional // CHECK: hop_to_executor {{%.*}} : $MainActor // CHECK: [[ACCESS:%[0-9]+]] = begin_access [read] [dynamic] {{%[0-9]+}} : $*Optional // CHECK: switch_enum_addr [[ACCESS]] : $*Optional, case #Optional.some!enumelt: [[SOME_BB:bb[0-9]+]], case #Optional.none!enumelt: [[CRASH_BB:bb[0-9]+]] @@ -642,18 +642,18 @@ struct Blah { // closure #1 in Blah.test() // CHECK-LABEL: sil private [ossa] @$s4test4BlahVAAyyFyyYacfU_ : $@convention(thin) @async @substituted <τ_0_0> (@guaranteed Optional, Blah) -> @out τ_0_0 for <()> { - // CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none + // CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none // CHECK: hop_to_executor [[GENERIC_EXEC]] : // CHECK: hop_to_executor {{%[0-9]+}} : $MainActor // CHECK: [[ACTOR_OBJ_RAW:%[0-9]+]] = apply {{%[0-9]+}}({{%[0-9]+}}) : $@convention(method) (Blah) -> @owned Coordinator - // CHECK: hop_to_executor {{%[0-9]+}} : $Optional + // CHECK: hop_to_executor {{%[0-9]+}} : $Optional // CHECK: [[ACTOR_OBJ:%[0-9]+]] = begin_borrow [[ACTOR_OBJ_RAW]] : $Coordinator // CHECK: [[VAL:%[0-9]+]] = ref_element_addr [[ACTOR_OBJ]] : $Coordinator, #Coordinator.someValue // CHECK: hop_to_executor [[ACTOR_OBJ]] // CHECK: [[VAL_ACCESS:%[0-9]+]] = begin_access [read] [dynamic] [[VAL]] : $*Optional // CHECK: {{%[0-9]+}} = load [trivial] [[VAL_ACCESS]] : $*Optional // CHECK: end_access [[VAL_ACCESS]] : $*Optional - // CHECK: hop_to_executor [[GENERIC_EXEC]] : $Optional + // CHECK: hop_to_executor [[GENERIC_EXEC]] : $Optional // CHECK: } // end sil function '$s4test4BlahVAAyyFyyYacfU_' @available(SwiftStdlib 5.1, *) func test() { @@ -677,16 +677,16 @@ class Polar { // CHECK-LABEL: sil hidden{{.*}} @$s4test20accessStaticIsolatedSiyYaF : $@convention(thin) @async () -> Int { -// CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none +// CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none // CHECK: hop_to_executor [[GENERIC_EXEC]] : // CHECK: [[ADDRESSOR:%[0-9]+]] = function_ref @$s4test5PolarC11temperatureSivau : $@convention(thin) () -> Builtin.RawPointer // CHECK: hop_to_executor {{%.*}} : $MainActor // CHECK-NEXT: [[RAW_ADDR:%[0-9]+]] = apply [[ADDRESSOR]]() : $@convention(thin) () -> Builtin.RawPointer -// CHECK-NEXT: hop_to_executor {{%.*}} : $Optional +// CHECK-NEXT: hop_to_executor {{%.*}} : $Optional // CHECK: [[ADDR:%[0-9]+]] = pointer_to_address [[RAW_ADDR]] : $Builtin.RawPointer to [strict] $*Int // CHECK: hop_to_executor {{%.*}} : $MainActor // CHECK: {{%.*}} = load [trivial] {{%.*}} : $*Int -// CHECK: hop_to_executor [[GENERIC_EXEC]] : $Optional +// CHECK: hop_to_executor [[GENERIC_EXEC]] : $Optional func accessStaticIsolated() async -> Int { return await Polar.temperature } diff --git a/test/SILGen/isolated_any.swift b/test/SILGen/isolated_any.swift index 5956b01db67c6..cf4d42ce1cf8a 100644 --- a/test/SILGen/isolated_any.swift +++ b/test/SILGen/isolated_any.swift @@ -3,7 +3,7 @@ // REQUIRES: asserts // CHECK-LABEL: sil hidden [ossa] @$s4test8callSync2fnyyyYbYAXE_tYaF -// CHECK: [[NIL_EXECUTOR:%.*]] = enum $Optional, #Optional.none +// CHECK: [[NIL_EXECUTOR:%.*]] = enum $Optional, #Optional.none // CHECK-NEXT: hop_to_executor [[NIL_EXECUTOR]] // CHECK-NEXT: [[FN_COPY:%.*]] = copy_value %0 : $@isolated(any) @noescape @Sendable @callee_guaranteed () -> () // CHECK-NEXT: [[FN_BORROW1:%.*]] = begin_borrow [[FN_COPY]] : @@ -19,7 +19,7 @@ func callSync(fn: @isolated(any) @Sendable () -> ()) async { } // CHECK-LABEL: sil hidden [ossa] @$s4test9callAsync2fnyyyYaYbYAXE_tYaF -// CHECK: [[NIL_EXECUTOR:%.*]] = enum $Optional, #Optional.none +// CHECK: [[NIL_EXECUTOR:%.*]] = enum $Optional, #Optional.none // CHECK-NEXT: hop_to_executor [[NIL_EXECUTOR]] // CHECK-NEXT: [[FN_COPY:%.*]] = copy_value %0 : $@isolated(any) @noescape @Sendable @async @callee_guaranteed () -> () // CHECK-NEXT: [[FN_BORROW2:%.*]] = begin_borrow [[FN_COPY]] : diff --git a/test/SILGen/nonisolated_inherits_isolation.swift b/test/SILGen/nonisolated_inherits_isolation.swift index bb4c0a25fd939..d5e51e720dd70 100644 --- a/test/SILGen/nonisolated_inherits_isolation.swift +++ b/test/SILGen/nonisolated_inherits_isolation.swift @@ -142,7 +142,8 @@ class MainActorKlass { // CHECK: [[B_ACTOR_COPY:%.*]] = copy_value [[B_ACTOR]] // CHECK: [[B_ACTOR_COPY_EX:%.*]] = init_existential_ref [[B_ACTOR_COPY]] : $MainActor // CHECK: [[B_ACTOR_COPY_EX_OPT:%.*]] = enum $Optional, #Optional.some!enumelt, [[B_ACTOR_COPY_EX]] - // CHECK: apply {{%.*}}([[B_ACTOR_COPY_EX_OPT]], [[B_VAR_DECL_2]]) : $@convention(thin) @async (@sil_isolated @sil_implicit_leading_param @guaranteed Optional, @guaranteed NonSendableKlass) -> () + // CHECK: [[B_ACTOR_COPY_EX_OPT_B:%.*]] = begin_borrow [[B_ACTOR_COPY_EX_OPT]] + // CHECK: apply {{%.*}}([[B_ACTOR_COPY_EX_OPT_B]], [[B_VAR_DECL_2]]) : $@convention(thin) @async (@sil_isolated @sil_implicit_leading_param @guaranteed Optional, @guaranteed NonSendableKlass) -> () // CHECK: hop_to_executor [[B_ACTOR]] // CHECK: } // end sil function '$s30nonisolated_inherits_isolation14MainActorKlassC24callNonIsolatedWithParamyyYaF' func callNonIsolatedWithParam() async { diff --git a/test/SILGen/objc_async.swift b/test/SILGen/objc_async.swift index bf6eb7a038823..093aa80c646c7 100644 --- a/test/SILGen/objc_async.swift +++ b/test/SILGen/objc_async.swift @@ -255,7 +255,7 @@ func testThrowingMethodFromMain(slowServer: SlowServer) async -> String { // rdar://91502776 // CHECK-LABEL: sil hidden [ossa] @$s{{.*}}21checkCostcoMembershipSbyYaF : $@convention(thin) @async () -> Bool { // CHECK: bb0: -// CHECK: hop_to_executor {{%.*}} : $Optional +// CHECK: hop_to_executor {{%.*}} : $Optional // CHECK: [[FINAL_BUF:%.*]] = alloc_stack $Bool // CHECK: [[RESULT_BUF:%.*]] = alloc_stack $NSObject // CHECK: [[METH:%.*]] = objc_method {{%.*}} : $@objc_metatype Person.Type, #Person.asCustomer!foreign @@ -264,7 +264,7 @@ func testThrowingMethodFromMain(slowServer: SlowServer) async -> String { // CHECK: dealloc_stack {{%.*}} : $*@block_storage // CHECK: await_async_continuation {{%.*}} : $Builtin.RawUnsafeContinuation, resume bb1 // CHECK: bb1: -// CHECK: hop_to_executor {{%.*}} : $Optional +// CHECK: hop_to_executor {{%.*}} : $Optional // CHECK: [[RESULT:%.*]] = load [take] [[RESULT_BUF]] : $*NSObject // CHECK: objc_method {{%.*}} : $CostcoManager, #CostcoManager.isCustomerEnrolled!foreign // CHECK: get_async_continuation_addr Bool, [[FINAL_BUF]] : $*Bool @@ -275,7 +275,7 @@ func testThrowingMethodFromMain(slowServer: SlowServer) async -> String { // CHECK: dealloc_stack [[BLOCK_STORAGE]] : $*@block_storage // CHECK: await_async_continuation {{%.*}} : $Builtin.RawUnsafeContinuation, resume bb2 // CHECK: bb2: -// CHECK: hop_to_executor {{%.*}} : $Optional +// CHECK: hop_to_executor {{%.*}} : $Optional // CHECK: [[ANSWER:%.*]] = load [trivial] [[FINAL_BUF]] : $*Bool // CHECK: fix_lifetime [[EXTEND2]] : $CostcoManager // CHECK: destroy_value [[EXTEND2]] : $CostcoManager @@ -325,7 +325,7 @@ extension OptionalMemberLookups { // CHECK: destroy_value {{.*}} : $MainActor // CHECK: dealloc_stack {{.*}} : $*AutoreleasingUnsafeMutablePointer> // CHECK: dealloc_stack {{.*}} : $*@sil_unmanaged Optional -// CHECK: hop_to_executor {{.*}} : $Optional +// CHECK: hop_to_executor {{.*}} : $Optional // CHECK: switch_enum func checkHotdogs(_ v: some HotdogCompetitor, _ timeLimit: NSObject) async throws -> String? { return try await v.pileOfHotdogsToEat(withLimit: timeLimit) diff --git a/test/SILGen/objc_async_checked.swift b/test/SILGen/objc_async_checked.swift index d716256c1b974..ff491ef76f75c 100644 --- a/test/SILGen/objc_async_checked.swift +++ b/test/SILGen/objc_async_checked.swift @@ -306,7 +306,7 @@ func testThrowingMethodFromMain(slowServer: SlowServer) async -> String { // rdar://91502776 // CHECK-LABEL: sil hidden [ossa] @$s{{.*}}21checkCostcoMembershipSbyYaF : $@convention(thin) @async () -> Bool { // CHECK: bb0: -// CHECK: hop_to_executor {{%.*}} : $Optional +// CHECK: hop_to_executor {{%.*}} : $Optional // CHECK: [[FINAL_BUF:%.*]] = alloc_stack $Bool // CHECK: [[RESULT_BUF:%.*]] = alloc_stack $NSObject // CHECK: [[METH:%.*]] = objc_method {{%.*}} : $@objc_metatype Person.Type, #Person.asCustomer!foreign @@ -317,7 +317,7 @@ func testThrowingMethodFromMain(slowServer: SlowServer) async -> String { // CHECK: dealloc_stack {{%.*}} : $*@block_storage // CHECK: await_async_continuation {{%.*}} : $Builtin.RawUnsafeContinuation, resume bb1 // CHECK: bb1: -// CHECK: hop_to_executor {{%.*}} : $Optional +// CHECK: hop_to_executor {{%.*}} : $Optional // CHECK: [[RESULT:%.*]] = load [take] [[RESULT_BUF]] : $*NSObject // CHECK: objc_method {{%.*}} : $CostcoManager, #CostcoManager.isCustomerEnrolled!foreign // CHECK: get_async_continuation_addr Bool, [[FINAL_BUF]] : $*Bool @@ -328,7 +328,7 @@ func testThrowingMethodFromMain(slowServer: SlowServer) async -> String { // CHECK: dealloc_stack [[BLOCK_STORAGE]] : $*@block_storage // CHECK: await_async_continuation {{%.*}} : $Builtin.RawUnsafeContinuation, resume bb2 // CHECK: bb2: -// CHECK: hop_to_executor {{%.*}} : $Optional +// CHECK: hop_to_executor {{%.*}} : $Optional // CHECK: [[ANSWER:%.*]] = load [trivial] [[FINAL_BUF]] : $*Bool // CHECK: fix_lifetime [[EXTEND2]] : $CostcoManager // CHECK: destroy_value [[EXTEND2]] : $CostcoManager diff --git a/test/SILGen/objc_async_from_swift.swift b/test/SILGen/objc_async_from_swift.swift index 49bd3b9705fbb..04e1ed0113bd3 100644 --- a/test/SILGen/objc_async_from_swift.swift +++ b/test/SILGen/objc_async_from_swift.swift @@ -20,7 +20,7 @@ import ObjCConcurrency // CHECK-LABEL: sil {{.*}}@{{.*}}15testSlowServing func testSlowServing(p: SlowServing) async throws { // CHECK-NN: bb0([[HOP_TARGET:%.*]] : @guaranteed $Optional, - // CHECK-C: [[HOP_TARGET:%.*]] = enum $Optional, #Optional.none + // CHECK-C: [[HOP_TARGET:%.*]] = enum $Optional, #Optional.none // CHECK: hop_to_executor [[HOP_TARGET]] : // CHECK: objc_method {{.*}} $@convention(objc_method) <τ_0_0 where τ_0_0 : SlowServing> (@convention(block) (Int) -> (), τ_0_0) -> () // CHECK: hop_to_executor [[HOP_TARGET]] : @@ -44,7 +44,7 @@ func testSlowServing(p: SlowServing) async throws { // CHECK-LABEL: sil {{.*}}@{{.*}}20testSlowServingAgain func testSlowServingAgain(p: SlowServing) async throws { // CHECK-NN: bb0([[HOP_TARGET:%.*]] : @guaranteed $Optional, - // CHECK-C: [[HOP_TARGET:%.*]] = enum $Optional, #Optional.none + // CHECK-C: [[HOP_TARGET:%.*]] = enum $Optional, #Optional.none // CHECK: hop_to_executor [[HOP_TARGET]] : // CHECK: objc_method {{.*}} $@convention(objc_method) <τ_0_0 where τ_0_0 : SlowServing> (@convention(block) (Optional, Optional) -> (), τ_0_0) -> () // CHECK: hop_to_executor [[HOP_TARGET]] : @@ -56,7 +56,7 @@ func testSlowServingAgain(p: SlowServing) async throws { class SlowSwiftServer: NSObject, SlowServing { // CHECK-LABEL: sil {{.*}} @$s21objc_async_from_swift15SlowSwiftServerC10requestIntSiyYaF // CHECK-NN: bb0([[HOP_TARGET:%.*]] : @guaranteed $Optional, - // CHECK-C: [[HOP_TARGET:%.*]] = enum $Optional, #Optional.none + // CHECK-C: [[HOP_TARGET:%.*]] = enum $Optional, #Optional.none // CHECK: hop_to_executor [[HOP_TARGET]] : // CHECK: } // end sil function '$s21objc_async_from_swift15SlowSwiftServerC10requestIntSiyYaF{{.*}}' // CHECK-LABEL: sil private {{.*}} @${{.*}}10requestInt{{.*}}To : @@ -75,11 +75,11 @@ class SlowSwiftServer: NSObject, SlowServing { func requestString() async -> String { return "" } // CHECK-LABEL: sil {{.*}} @$s21objc_async_from_swift15SlowSwiftServerC13requestStringSSyYaF // CHECK-NN: bb0([[HOP_TARGET:%.*]] : @guaranteed $Optional, - // CHECK-C: [[HOP_TARGET:%.*]] = enum $Optional, #Optional.none + // CHECK-C: [[HOP_TARGET:%.*]] = enum $Optional, #Optional.none // CHECK: hop_to_executor [[HOP_TARGET]] : // CHECK-LABEL: sil {{.*}} @$s21objc_async_from_swift15SlowSwiftServerC16tryRequestStringSSyYaKF // CHECK-NN: bb0([[HOP_TARGET:%.*]] : @guaranteed $Optional, - // CHECK-C: [[HOP_TARGET:%.*]] = enum $Optional, #Optional.none + // CHECK-C: [[HOP_TARGET:%.*]] = enum $Optional, #Optional.none // CHECK: hop_to_executor [[HOP_TARGET]] : // CHECK-LABEL: sil shared {{.*}} @${{.*}}16tryRequestString{{.*}}U_To : // CHECK: [[BLOCK_COPY:%.*]] = copy_block %0 @@ -96,13 +96,13 @@ class SlowSwiftServer: NSObject, SlowServing { // CHECK-LABEL: sil {{.*}} @$s21objc_async_from_swift15SlowSwiftServerC19requestIntAndStringSi_SStyYaF // CHECK-NN: bb0([[HOP_TARGET:%.*]] : @guaranteed $Optional, - // CHECK-C: [[HOP_TARGET:%.*]] = enum $Optional, #Optional.none + // CHECK-C: [[HOP_TARGET:%.*]] = enum $Optional, #Optional.none // CHECK: hop_to_executor [[HOP_TARGET]] : func requestIntAndString() async -> (Int, String) { return (0, "") } // CHECK-LABEL: sil {{.*}} @$s21objc_async_from_swift15SlowSwiftServerC22tryRequestIntAndStringSi_SStyYaKF // CHECK-NN: bb0([[HOP_TARGET:%.*]] : @guaranteed $Optional, - // CHECK-C: [[HOP_TARGET:%.*]] = enum $Optional, #Optional.none + // CHECK-C: [[HOP_TARGET:%.*]] = enum $Optional, #Optional.none // CHECK: hop_to_executor [[HOP_TARGET]] : func tryRequestIntAndString() async throws -> (Int, String) { return (0, "") } } @@ -205,7 +205,7 @@ class SlowServerlet: SlowServer { // // CHECK-C-LABEL: sil hidden [ossa] @$s21objc_async_from_swift13SlowServerletC011doSomethingE8NullablyySiSSYaF : $@convention(method) @async (@guaranteed String, @guaranteed SlowServerlet) -> Int // CHECK-C-NOT: bb0([[ACTOR:%.*]] : @guaranteed $Optional - // CHECK-C: [[ACTOR:%.*]] = enum $Optional, #Optional.none!enumelt + // CHECK-C: [[ACTOR:%.*]] = enum $Optional, #Optional.none!enumelt // CHECK-C: hop_to_executor [[ACTOR]] // CHECK-C: // end sil function '$s21objc_async_from_swift13SlowServerletC011doSomethingE8NullablyySiSSYaF' @@ -236,7 +236,7 @@ class SlowServerlet: SlowServer { // // CHECK-C-LABEL: sil hidden [ossa] @$s21objc_async_from_swift13SlowServerletC18findAnswerNullablyyS2SYaF : $@convention(method) @async (@guaranteed String, @guaranteed SlowServerlet) -> @owned String // CHECK-C-NOT: bb0([[ACTOR:%.*]] : @guaranteed $Optional - // CHECK-C: [[ACTOR:%.*]] = enum $Optional, #Optional.none!enumelt + // CHECK-C: [[ACTOR:%.*]] = enum $Optional, #Optional.none!enumelt // CHECK-C-NEXT: hop_to_executor [[ACTOR]] // CHECK-C: } // end sil function '$s21objc_async_from_swift13SlowServerletC18findAnswerNullablyyS2SYaF' @@ -263,7 +263,7 @@ class SlowServerlet: SlowServer { // // CHECK-C-LABEL: sil hidden [ossa] @$s21objc_async_from_swift13SlowServerletC28doSomethingDangerousNullablyyS2SYaKF : $@convention(method) @async (@guaranteed String, @guaranteed SlowServerlet) -> (@owned String, @error any Error) // CHECK-C-NOT: bb0([[ACTOR:%.*]] : @guaranteed $Optional, - // CHECK-C: [[ACTOR:%.*]] = enum $Optional, #Optional.none!enumelt + // CHECK-C: [[ACTOR:%.*]] = enum $Optional, #Optional.none!enumelt // CHECK-C-NEXT: hop_to_executor [[ACTOR]] // CHECK-C: } // end sil function '$s21objc_async_from_swift13SlowServerletC28doSomethingDangerousNullablyyS2SYaKF' @@ -291,7 +291,7 @@ class SlowServerlet: SlowServer { // // CHECK-C-LABEL: sil hidden [ossa] @$s21objc_async_from_swift13SlowServerletC30doSomethingUnspecifiedNullablySSyYaKF : $@convention(method) @async (@guaranteed SlowServerlet) -> (@owned String, @error any Error) // CHECK-C-NOT: bb0([[ACTOR:%.*]] : @guaranteed $Optional, - // CHECK-C: [[ACTOR:%.*]] = enum $Optional, #Optional.none!enumelt + // CHECK-C: [[ACTOR:%.*]] = enum $Optional, #Optional.none!enumelt // CHECK-C-NEXT: hop_to_executor [[ACTOR]] // CHECK-C: } // end sil function '$s21objc_async_from_swift13SlowServerletC30doSomethingUnspecifiedNullablySSyYaKF' @@ -317,7 +317,7 @@ class SlowServerlet: SlowServer { // // CHECK-C-LABEL: sil hidden [ossa] @$s21objc_async_from_swift13SlowServerletC17doSomethingFlaggySSyYaKF : $@convention(method) @async (@guaranteed SlowServerlet) -> (@owned String, @error any Error) // CHECK-C-NOT: bb0([[ACTOR:%.*]] : @guaranteed $Optional, - // CHECK-C: [[ACTOR:%.*]] = enum $Optional, #Optional.none!enumelt + // CHECK-C: [[ACTOR:%.*]] = enum $Optional, #Optional.none!enumelt // CHECK-C-NEXT: hop_to_executor [[ACTOR]] // CHECK-C: } // end sil function '$s21objc_async_from_swift13SlowServerletC17doSomethingFlaggySSyYaKF' @@ -349,7 +349,7 @@ class SlowServerlet: SlowServer { // // CHECK-C-LABEL: sil hidden [ossa] @$s21objc_async_from_swift13SlowServerletC21doSomethingZeroFlaggySSyYaKF : $@convention(method) @async (@guaranteed SlowServerlet) -> (@owned String, @error any Error) // CHECK-C-NOT: bb0([[ACTOR:%.*]] : @guaranteed $Optional, - // CHECK-C: [[ACTOR:%.*]] = enum $Optional, #Optional.none!enumelt + // CHECK-C: [[ACTOR:%.*]] = enum $Optional, #Optional.none!enumelt // CHECK-C-NEXT: hop_to_executor [[ACTOR]] // CHECK-C: } // end sil function '$s21objc_async_from_swift13SlowServerletC21doSomethingZeroFlaggySSyYaKF' // @@ -380,7 +380,7 @@ class SlowServerlet: SlowServer { // // CHECK-C-LABEL: sil hidden [ossa] @$s21objc_async_from_swift13SlowServerletC28doSomethingMultiResultFlaggySS_SStyYaKF : $@convention(method) @async (@guaranteed SlowServerlet) -> (@owned String, @owned String, @error any Error) // CHECK-C-NOT: bb0([[ACTOR:%.*]] : @guaranteed $Optional, - // CHECK-C: [[ACTOR:%.*]] = enum $Optional, #Optional.none!enumelt + // CHECK-C: [[ACTOR:%.*]] = enum $Optional, #Optional.none!enumelt // CHECK-C-NEXT: hop_to_executor [[ACTOR]] // CHECK-C: } // end sil function '$s21objc_async_from_swift13SlowServerletC28doSomethingMultiResultFlaggySS_SStyYaKF' // @@ -561,7 +561,7 @@ func testAutoclosureInStaticMethod() { // // CHECK-C-LABEL: sil private [ossa] @$s21objc_async_from_swift29testAutoclosureInStaticMethodyyF9TestKlassL_C8getValue2id11valueForKeySSSgSS_S2SYaKXEtYaFZ : $@convention(method) @async (@guaranteed String, @guaranteed @noescape @async @callee_guaranteed (@guaranteed String) -> (@owned String, @error any Error), @thick TestKlass.Type) -> @owned Optional { // CHECK-C: bb0([[STRING:%.*]] : @guaranteed $String, [[COMPLETION:%.*]] : @guaranteed $@noescape @async @callee_guaranteed (@guaranteed String) -> (@owned String, @error any Error), [[METATYPE:%.*]] : $@thick TestKlass.Type) - // CHECK-C: [[EXEC_NONE:%.*]] = enum $Optional, #Optional.none!enumelt + // CHECK-C: [[EXEC_NONE:%.*]] = enum $Optional, #Optional.none!enumelt // CHECK-C: hop_to_executor [[EXEC_NONE]] // CHECK-C: hop_to_executor [[EXEC_NONE]] // CHECK-C: hop_to_executor [[EXEC_NONE]] @@ -693,7 +693,7 @@ func testAutoclosureInStaticMethod() { // // CHECK-C-LABEL: sil private [ossa] @$s21objc_async_from_swift29testAutoclosureInStaticMethodyyF9TestKlassL_C17getMainActorValue2id11valueForKeySSSgSS_S2SYaKXEtYaFZ : $@convention(method) @async (@guaranteed String, @guaranteed @noescape @async @callee_guaranteed (@guaranteed String) -> (@owned String, @error any Error), @thick TestKlass.Type) -> @owned Optional { // CHECK-C: bb0([[STRING:%.*]] : @guaranteed $String, [[COMPLETION:%.*]] : @guaranteed $@noescape @async @callee_guaranteed (@guaranteed String) -> (@owned String, @error any Error), [[METATYPE:%.*]] : $@thick TestKlass.Type) - // CHECK-C: [[EXEC_NONE:%.*]] = enum $Optional, #Optional.none!enumelt + // CHECK-C: [[EXEC_NONE:%.*]] = enum $Optional, #Optional.none!enumelt // CHECK-C: hop_to_executor [[EXEC_NONE]] // CHECK-C: hop_to_executor [[EXEC_NONE]] // CHECK-C: hop_to_executor [[EXEC_NONE]] diff --git a/test/SILGen/objc_effectful_properties.swift b/test/SILGen/objc_effectful_properties.swift index 24dba591ecfae..bca51d5ea6bc5 100644 --- a/test/SILGen/objc_effectful_properties.swift +++ b/test/SILGen/objc_effectful_properties.swift @@ -52,7 +52,7 @@ func testAsyncThrows(eff : EffProps) async { // CHECK-LABEL: sil {{.*}}@${{.*}}17testMainActorProp func testMainActorProp(eff : EffProps) async { - // CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none + // CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none // CHECK-NEXT: hop_to_executor [[GENERIC_EXEC]] : // CHECK: hop_to_executor [[GENERIC_EXEC]] : // CHECK: } // end sil function '${{.*}}17testMainActorProp @@ -61,7 +61,7 @@ func testMainActorProp(eff : EffProps) async { // CHECK-LABEL: sil {{.*}}@${{.*}}19testMainActorMethod func testMainActorMethod(eff : EffProps) async { - // CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none + // CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none // CHECK-NEXT: hop_to_executor [[GENERIC_EXEC]] : // CHECK: hop_to_executor [[GENERIC_EXEC]] : // CHECK: } // end sil function '${{.*}}19testMainActorMethod diff --git a/test/SILGen/objc_effectful_properties_checked.swift b/test/SILGen/objc_effectful_properties_checked.swift index 14f891b76b69c..31d34d40771d9 100644 --- a/test/SILGen/objc_effectful_properties_checked.swift +++ b/test/SILGen/objc_effectful_properties_checked.swift @@ -62,7 +62,7 @@ func testAsyncThrows(eff : EffProps) async { // CHECK-LABEL: sil {{.*}}@${{.*}}17testMainActorProp func testMainActorProp(eff : EffProps) async { - // CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none + // CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none // CHECK-NEXT: hop_to_executor [[GENERIC_EXEC]] : // CHECK: hop_to_executor [[GENERIC_EXEC]] : // CHECK: } // end sil function '${{.*}}17testMainActorProp @@ -71,7 +71,7 @@ func testMainActorProp(eff : EffProps) async { // CHECK-LABEL: sil {{.*}}@${{.*}}19testMainActorMethod func testMainActorMethod(eff : EffProps) async { - // CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none + // CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none // CHECK-NEXT: hop_to_executor [[GENERIC_EXEC]] : // CHECK: hop_to_executor [[GENERIC_EXEC]] : // CHECK: } // end sil function '${{.*}}19testMainActorMethod diff --git a/test/SILOptimizer/consuming_parameter.swift b/test/SILOptimizer/consuming_parameter.swift index 2fb0bd07d241a..bcf000d04bce2 100644 --- a/test/SILOptimizer/consuming_parameter.swift +++ b/test/SILOptimizer/consuming_parameter.swift @@ -5,7 +5,7 @@ // CHECK-LABEL: sil [ossa] @async_dead_arg_call : {{.*}} { // CHECK: {{bb[0-9]+}}([[INSTANCE:%[^,]+]] : @noImplicitCopy @_eagerMove @owned // CHECK: destroy_value [[INSTANCE]] -// CHECK: [[EXECUTOR:%[^,]+]] = enum $Optional, #Optional.none!enumelt +// CHECK: [[EXECUTOR:%[^,]+]] = enum $Optional, #Optional.none!enumelt // CHECK: [[CALLEE:%[^,]+]] = function_ref @async_callee // CHECK: apply [[CALLEE]]() // CHECK: hop_to_executor [[EXECUTOR]] @@ -18,7 +18,7 @@ public func async_dead_arg_call(o: consuming AnyObject) async { // CHECK-LABEL: sil [ossa] @async_dead_arg_call_lexical : {{.*}} { // CHECK: {{bb[0-9]+}}([[INSTANCE:%[^,]+]] : @noImplicitCopy @_lexical @owned -// CHECK: [[EXECUTOR:%[^,]+]] = enum $Optional, #Optional.none!enumelt +// CHECK: [[EXECUTOR:%[^,]+]] = enum $Optional, #Optional.none!enumelt // CHECK: [[CALLEE:%[^,]+]] = function_ref @async_callee // CHECK: apply [[CALLEE]]() // CHECK: hop_to_executor [[EXECUTOR]] @@ -47,7 +47,7 @@ public class C { // CHECK-LABEL: sil [ossa] @async_dead_arg_call_method : {{.*}} { // CHECK: {{bb[0-9]+}}([[INSTANCE:%[^,]+]] : @noImplicitCopy @_eagerMove @owned // CHECK: destroy_value [[INSTANCE]] - // CHECK: [[EXECUTOR:%[^,]+]] = enum $Optional, #Optional.none!enumelt + // CHECK: [[EXECUTOR:%[^,]+]] = enum $Optional, #Optional.none!enumelt // CHECK: [[CALLEE:%[^,]+]] = function_ref @async_callee : $@convention(thin) @async () -> () // CHECK: apply [[CALLEE]]() : $@convention(thin) @async () -> () // CHECK: hop_to_executor [[EXECUTOR]] diff --git a/test/SILOptimizer/definite_init_actor.swift b/test/SILOptimizer/definite_init_actor.swift index 33e48e2c07bf3..2666284c593bb 100644 --- a/test/SILOptimizer/definite_init_actor.swift +++ b/test/SILOptimizer/definite_init_actor.swift @@ -79,7 +79,7 @@ actor BoringActor { // CHECK: bb0([[SELF:%[0-9]+]] : $SingleVarActor): // TODO: We should be able to eliminate this by reasoning that the stores // are to local memory. - // CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional, #Optional.none + // CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional, #Optional.none // CHECK-NEXT: hop_to_executor [[GENERIC_EXECUTOR]] // CHECK: [[EI:%.*]] = end_init_let_ref [[SELF]] // CHECK: store {{%[0-9]+}} to [[ACCESS:%[0-9]+]] @@ -96,7 +96,7 @@ actor BoringActor { // CHECK: bb0({{%[0-9]+}} : $Int, [[SELF:%[0-9]+]] : $SingleVarActor): // TODO: We should be able to eliminate this by reasoning that the stores // are to local memory. - // CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional, #Optional.none + // CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional, #Optional.none // CHECK-NEXT: hop_to_executor [[GENERIC_EXECUTOR]] // CHECK: [[EI:%.*]] = end_init_let_ref [[SELF]] // CHECK: [[MYVAR_REF:%[0-9]+]] = ref_element_addr [[EI]] : $SingleVarActor, #SingleVarActor.myVar @@ -118,7 +118,7 @@ actor BoringActor { // TODO: We should be able to eliminate this by reasoning that the stores // are to local memory. - // CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional, #Optional.none + // CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional, #Optional.none // CHECK-NEXT: hop_to_executor [[GENERIC_EXECUTOR]] // CHECK: [[EI:%.*]] = end_init_let_ref [[SELF]] @@ -150,7 +150,7 @@ actor BoringActor { // TODO: We should be able to eliminate this by reasoning that the stores // are to local memory. - // CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional, #Optional.none + // CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional, #Optional.none // CHECK: hop_to_executor [[GENERIC_EXECUTOR]] // CHECK: cond_br {{%[0-9]+}}, [[SUCCESS_BB:bb[0-9]+]], {{bb[0-9]+}} @@ -170,7 +170,7 @@ actor BoringActor { // CHECK: [[SELF_ALLOC:%[0-9]+]] = alloc_stack [lexical] [var_decl] $SingleVarActor, let, name "self" // Initial hop to the generic executor. - // CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional, #Optional.none + // CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional, #Optional.none // CHECK-NEXT: hop_to_executor [[GENERIC_EXECUTOR]] // Hop immediately after the call to the synchronous init. @@ -219,7 +219,7 @@ actor DefaultInit { // CHECK: bb0([[SELF:%[0-9]+]] : $DefaultInit): // Initial hop to the generic executor. // TODO: This should be easy to remove. - // CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional, #Optional.none + // CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional, #Optional.none // CHECK-NEXT: hop_to_executor [[GENERIC_EXECUTOR]] // CHECK: [[EI:%.*]] = end_init_let_ref [[SELF]] // CHECK: store {{%[0-9]+}} to {{%[0-9]+}} : $*ActingError @@ -231,7 +231,7 @@ actor DefaultInit { // CHECK: bb0({{%[0-9]+}} : $Bool, [[SELF:%[0-9]+]] : $DefaultInit): // Initial hop to the generic executor. // TODO: This should be fairly easy to remove. - // CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional, #Optional.none + // CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional, #Optional.none // CHECK-NEXT: hop_to_executor [[GENERIC_EXECUTOR]] // CHECK: [[EI:%.*]] = end_init_let_ref [[SELF]] // CHECK: store {{%[0-9]+}} to {{%[0-9]+}} : $*ActingError @@ -253,7 +253,7 @@ actor MultiVarActor { // CHECK: bb0({{%[0-9]+}} : $Bool, [[SELF:%[0-9]+]] : $MultiVarActor): // Initial hop to the generic executor. // TODO: This should be easy to remove. - // CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional, #Optional.none + // CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional, #Optional.none // CHECK-NEXT: hop_to_executor [[GENERIC_EXECUTOR]] // CHECK: [[EI:%.*]] = end_init_let_ref [[SELF]] // CHECK: [[REF:%[0-9]+]] = ref_element_addr [[EI]] : $MultiVarActor, #MultiVarActor.firstVar @@ -271,7 +271,7 @@ actor MultiVarActor { // CHECK-LABEL: sil hidden @$s4test13MultiVarActorC10noSuccCaseACSb_tYacfc : $@convention(method) @async (Bool, @sil_isolated @owned MultiVarActor) -> @owned MultiVarActor { // Initial hop to the generic executor. // TODO: This should be easy to remove. - // CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional, #Optional.none + // CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional, #Optional.none // CHECK-NEXT: hop_to_executor [[GENERIC_EXECUTOR]] // CHECK: store {{%[0-9]+}} to [[A1:%[0-9]+]] : $*Int @@ -293,7 +293,7 @@ actor MultiVarActor { // CHECK-LABEL: sil hidden @$s4test13MultiVarActorC10noPredCaseACSb_tYacfc : $@convention(method) @async (Bool, @sil_isolated @owned MultiVarActor) -> @owned MultiVarActor { // Initial hop to the generic executor. // TODO: This should be easy to remove. - // CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional, #Optional.none + // CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional, #Optional.none // CHECK-NEXT: hop_to_executor [[GENERIC_EXECUTOR]] // CHECK: store {{%[0-9]+}} to [[ACCESS:%[0-9]+]] : $*Int @@ -316,7 +316,7 @@ actor MultiVarActor { // TODO: We should be able to remove this hop by proving that all the // stores before return are local. We don't really care about invalid // code, of course, but it should fall out. - // CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional, #Optional.none + // CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional, #Optional.none // CHECK-NEXT: hop_to_executor [[GENERIC_EXECUTOR]] init?(doesNotFullyInit1: Bool) async { firstVar = 1 @@ -324,7 +324,7 @@ actor MultiVarActor { } // CHECK-LABEL: sil hidden @$s4test13MultiVarActorC17doesNotFullyInit2ACSb_tYacfc - // CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional, #Optional.none + // CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional, #Optional.none // CHECK-NEXT: hop_to_executor [[GENERIC_EXECUTOR]] init(doesNotFullyInit2: Bool) async { firstVar = 1 @@ -332,7 +332,7 @@ actor MultiVarActor { } // CHECK-LABEL: sil hidden @$s4test13MultiVarActorC17doesNotFullyInit3ACSb_tYaKcfc - // CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional, #Optional.none + // CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional, #Optional.none // CHECK-NEXT: hop_to_executor [[GENERIC_EXECUTOR]] init(doesNotFullyInit3: Bool) async throws { firstVar = 1 @@ -340,7 +340,7 @@ actor MultiVarActor { } // CHECK-LABEL: sil hidden @$s4test13MultiVarActorC17doesNotFullyInit4ACSgSb_tYacfc - // CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional, #Optional.none + // CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional, #Optional.none // CHECK-NEXT: hop_to_executor [[GENERIC_EXECUTOR]] init?(doesNotFullyInit4: Bool) async { firstVar = 1 @@ -358,7 +358,7 @@ actor TaskMaster { // CHECK-LABEL: @$s4test10TaskMasterCACyYacfc : $@convention(method) @async (@sil_isolated @owned TaskMaster) -> @owned TaskMaster { // Initial hop to the generic executor. // TODO: This should be easy to remove. - // CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional, #Optional.none + // CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional, #Optional.none // CHECK-NEXT: hop_to_executor [[GENERIC_EXECUTOR]] // CHECK: [[ELM:%[0-9]+]] = ref_element_addr [[SELF:%[0-9]+]] : $TaskMaster, #TaskMaster.task @@ -382,7 +382,7 @@ actor SomeActor { // CHECK-LABEL: sil hidden @$s4test9SomeActorCACyYacfc : $@convention(method) @async (@sil_isolated @owned SomeActor) -> @owned SomeActor { // Initial hop to the generic executor. // TODO: This should be easy to remove. - // CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional, #Optional.none + // CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional, #Optional.none // CHECK-NEXT: hop_to_executor [[GENERIC_EXECUTOR]] // CHECK-NOT: begin_access @@ -397,7 +397,7 @@ actor Ahmad { // CHECK-LABEL: sil hidden @$s4test5AhmadCACyYacfc : $@convention(method) @async (@owned Ahmad) -> @owned Ahmad { // CHECK: bb0{{.*}}: - // CHECK-NEXT: [[GENERIC:%[0-9]+]] = enum $Optional, #Optional.none!enumelt + // CHECK-NEXT: [[GENERIC:%[0-9]+]] = enum $Optional, #Optional.none!enumelt // CHECK-NEXT: hop_to_executor [[GENERIC]] // CHECK: store {{%[0-9]+}} to {{%[0-9]+}} : $*Int // CHECK: } // end sil function '$s4test5AhmadCACyYacfc' @@ -412,7 +412,7 @@ actor Customer { // CHECK-LABEL: sil hidden @$s4test8CustomerCACyYaKcfc : init() async throws { - // CHECK: [[GENERIC:%[0-9]+]] = enum $Optional, #Optional.none!enumelt + // CHECK: [[GENERIC:%[0-9]+]] = enum $Optional, #Optional.none!enumelt // CHECK-NEXT: hop_to_executor [[GENERIC]] // CHECK: [[SELF:%.*]] = end_init_let_ref %0 : $Customer diff --git a/test/SILOptimizer/definite_init_flow_sensitive_distributed_actor_self.swift b/test/SILOptimizer/definite_init_flow_sensitive_distributed_actor_self.swift index 7aa74dc6a124f..d5085743272c1 100644 --- a/test/SILOptimizer/definite_init_flow_sensitive_distributed_actor_self.swift +++ b/test/SILOptimizer/definite_init_flow_sensitive_distributed_actor_self.swift @@ -13,6 +13,9 @@ distributed actor NotCodableDA // CHECK-LABEL: sil hidden{{.*}}@$s4test12NotCodableDAC11actorSystemACyxGx_tYacfc : $@convention(method) @async (@in ActorSystem, @sil_isolated @owned NotCodableDA) -> @owned NotCodableDA { init(actorSystem: ActorSystem) async { + // CHECK: [[ISOLATION:%.*]] = enum $Optional, #Optional.none!enumelt + // CHECK: hop_to_executor [[ISOLATION]] + self.actorSystem = actorSystem // First use of #isolation, which is replaced by 'nil'. diff --git a/test/embedded/concurrency-builtins.swift b/test/embedded/concurrency-builtins.swift index f5242f4631ffc..3797c37f60242 100644 --- a/test/embedded/concurrency-builtins.swift +++ b/test/embedded/concurrency-builtins.swift @@ -6,6 +6,7 @@ // REQUIRES: swift_feature_Embedded import Builtin +import _Concurrency public func test() async { _ = Builtin.createAsyncTask(0) { () async throws -> Int in diff --git a/tools/swift-ide-test/swift-ide-test.cpp b/tools/swift-ide-test/swift-ide-test.cpp index 8ea7ceaf6bc3a..8e72a4382a8ee 100644 --- a/tools/swift-ide-test/swift-ide-test.cpp +++ b/tools/swift-ide-test/swift-ide-test.cpp @@ -4614,6 +4614,8 @@ int main(int argc, char *argv[]) { InitInvok.computeCXXStdlibOptions(); } + InitInvok.computeAArch64TBIOptions(); + if (!options::InProcessPluginServerPath.empty()) { InitInvok.getSearchPathOptions().InProcessPluginServerPath = options::InProcessPluginServerPath;