Skip to content

Commit dd1be8f

Browse files
committed
[Frontend] Hide @execution attribute behind an experimental feature ExecutionAttribute
Since the proposal has not been approved yet we cannot expose `@execution` attribute.
1 parent e2ff330 commit dd1be8f

19 files changed

+144
-18
lines changed

include/swift/AST/DeclAttr.def

+1
Original file line numberDiff line numberDiff line change
@@ -545,6 +545,7 @@ DECL_ATTR_FEATURE_REQUIREMENT(ABI, ABIAttribute)
545545
DECL_ATTR(execution, Execution,
546546
OnFunc | ABIBreakingToAdd | ABIBreakingToRemove | APIBreakingToAdd | APIBreakingToRemove,
547547
166)
548+
DECL_ATTR_FEATURE_REQUIREMENT(Execution, ExecutionAttribute)
548549

549550
LAST_DECL_ATTR(Execution)
550551

include/swift/AST/PrintOptions.h

+3
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,9 @@ struct PrintOptions {
397397
/// Suppress modify/read accessors.
398398
bool SuppressCoroutineAccessors = false;
399399

400+
/// Suppress the @execution attribute
401+
bool SuppressExecutionAttribute = false;
402+
400403
/// List of attribute kinds that should not be printed.
401404
std::vector<AnyAttrKind> ExcludeAttrList = {
402405
DeclAttrKind::Transparent, DeclAttrKind::Effects,

include/swift/Basic/Features.def

+4
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,10 @@ SUPPRESSIBLE_EXPERIMENTAL_FEATURE(AddressableTypes, true)
436436
/// Allow the @abi attribute.
437437
SUPPRESSIBLE_EXPERIMENTAL_FEATURE(ABIAttribute, true)
438438

439+
/// Allow the @execution attribute. This is also connected to
440+
/// AsyncCallerExecution feature.
441+
SUPPRESSIBLE_EXPERIMENTAL_FEATURE(ExecutionAttribute, false)
442+
439443
/// Functions with nonisolated isolation inherit their isolation from the
440444
/// calling context.
441445
EXPERIMENTAL_FEATURE(AsyncCallerExecution, false)

lib/AST/ASTPrinter.cpp

+10-1
Original file line numberDiff line numberDiff line change
@@ -3251,6 +3251,14 @@ suppressingFeatureCustomAvailability(PrintOptions &options,
32513251
action();
32523252
}
32533253

3254+
static void
3255+
suppressingFeatureExecutionAttribute(PrintOptions &options,
3256+
llvm::function_ref<void()> action) {
3257+
llvm::SaveAndRestore<bool> scope1(options.SuppressExecutionAttribute, true);
3258+
ExcludeAttrRAII scope2(options.ExcludeAttrList, DeclAttrKind::Execution);
3259+
action();
3260+
}
3261+
32543262
/// Suppress the printing of a particular feature.
32553263
static void suppressingFeature(PrintOptions &options, Feature feature,
32563264
llvm::function_ref<void()> action) {
@@ -6423,7 +6431,8 @@ class TypePrinter : public TypeVisitor<TypePrinter> {
64236431
break;
64246432

64256433
case FunctionTypeIsolation::Kind::NonIsolatedCaller:
6426-
Printer << "@execution(caller) ";
6434+
if (!Options.SuppressExecutionAttribute)
6435+
Printer << "@execution(caller) ";
64276436
break;
64286437
}
64296438

lib/AST/Attr.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,9 @@ void IsolatedTypeAttr::printImpl(ASTPrinter &printer,
305305

306306
void ExecutionTypeAttr::printImpl(ASTPrinter &printer,
307307
const PrintOptions &options) const {
308+
if (options.SuppressExecutionAttribute)
309+
return;
310+
308311
printer.callPrintStructurePre(PrintStructureKind::BuiltinAttribute);
309312
printer.printAttrName("@execution");
310313
printer << "(";

lib/AST/FeatureSet.cpp

+39
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,45 @@ static bool usesFeatureBuiltinEmplaceTypedThrows(Decl *decl) {
416416
return false;
417417
}
418418

419+
static bool usesFeatureExecutionAttribute(Decl *decl) {
420+
if (decl->getAttrs().hasAttribute<ExecutionAttr>())
421+
return true;
422+
423+
auto VD = dyn_cast<ValueDecl>(decl);
424+
if (!VD)
425+
return false;
426+
427+
auto hasExecutionAttr = [](TypeRepr *R) {
428+
if (!R)
429+
return false;
430+
431+
return R->findIf([](TypeRepr *repr) {
432+
if (auto *AT = dyn_cast<AttributedTypeRepr>(repr)) {
433+
return llvm::any_of(AT->getAttrs(), [](TypeOrCustomAttr attr) {
434+
if (auto *TA = attr.dyn_cast<TypeAttribute *>()) {
435+
return isa<ExecutionTypeAttr>(TA);
436+
}
437+
return false;
438+
});
439+
}
440+
return false;
441+
});
442+
};
443+
444+
// Check if any parameters that have `@execution` attribute.
445+
if (auto *PL = getParameterList(VD)) {
446+
for (auto *P : *PL) {
447+
if (hasExecutionAttr(P->getTypeRepr()))
448+
return true;
449+
}
450+
}
451+
452+
if (hasExecutionAttr(VD->getResultTypeRepr()))
453+
return true;
454+
455+
return false;
456+
}
457+
419458
// ----------------------------------------------------------------------------
420459
// MARK: - FeatureSet
421460
// ----------------------------------------------------------------------------

lib/Parse/ParseDecl.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -4725,6 +4725,12 @@ ParserStatus Parser::parseTypeAttribute(TypeOrCustomAttr &result,
47254725
}
47264726

47274727
case TypeAttrKind::Execution: {
4728+
if (!Context.LangOpts.hasFeature(Feature::ExecutionAttribute)) {
4729+
diagnose(Tok, diag::requires_experimental_feature, "@execution", false,
4730+
getFeatureName(Feature::ExecutionAttribute));
4731+
return makeParserError();
4732+
}
4733+
47284734
SourceLoc lpLoc = Tok.getLoc(), behaviorLoc, rpLoc;
47294735
if (!consumeIfNotAtStartOfLine(tok::l_paren)) {
47304736
if (!justChecking) {

test/ASTGen/attrs.swift

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
// RUN: %target-swift-frontend-dump-parse \
44
// RUN: -enable-experimental-feature ABIAttribute \
5+
// RUN: -enable-experimental-feature ExecutionAttribute \
56
// RUN: -enable-experimental-feature Extern \
67
// RUN: -enable-experimental-feature LifetimeDependence \
78
// RUN: -enable-experimental-feature SymbolLinkageMarkers \
@@ -11,6 +12,7 @@
1112

1213
// RUN: %target-swift-frontend-dump-parse \
1314
// RUN: -enable-experimental-feature ABIAttribute \
15+
// RUN: -enable-experimental-feature ExecutionAttribute \
1416
// RUN: -enable-experimental-feature Extern \
1517
// RUN: -enable-experimental-feature LifetimeDependence \
1618
// RUN: -enable-experimental-feature SymbolLinkageMarkers \
@@ -23,6 +25,7 @@
2325
// RUN: -module-abi-name ASTGen \
2426
// RUN: -enable-experimental-feature ParserASTGen \
2527
// RUN: -enable-experimental-feature ABIAttribute \
28+
// RUN: -enable-experimental-feature ExecutionAttribute \
2629
// RUN: -enable-experimental-feature Extern \
2730
// RUN: -enable-experimental-feature LifetimeDependence \
2831
// RUN: -enable-experimental-feature SymbolLinkageMarkers \
@@ -32,6 +35,7 @@
3235
// REQUIRES: swift_swift_parser
3336
// REQUIRES: swift_feature_ParserASTGen
3437
// REQUIRES: swift_feature_ABIAttribute
38+
// REQUIRES: swift_feature_ExecutionAttribute
3539
// REQUIRES: swift_feature_Extern
3640
// REQUIRES: swift_feature_LifetimeDependence
3741
// REQUIRES: swift_feature_SymbolLinkageMarkers

test/Concurrency/Runtime/nonisolated_inherits_isolation.swift

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
// RUN: %target-run-simple-swift( -swift-version 6 -g %import-libdispatch -import-objc-header %S/Inputs/RunOnMainActor.h -enable-experimental-feature AsyncCallerExecution )
1+
// RUN: %target-run-simple-swift( -swift-version 6 -g %import-libdispatch -import-objc-header %S/Inputs/RunOnMainActor.h -enable-experimental-feature ExecutionAttribute -enable-experimental-feature AsyncCallerExecution )
22

33
// REQUIRES: executable_test
44
// REQUIRES: concurrency
55
// REQUIRES: concurrency_runtime
66
// REQUIRES: libdispatch
77
// REQUIRES: asserts
88

9+
// REQUIRES: swift_feature_ExecutionAttribute
910
// REQUIRES: swift_feature_AsyncCallerExecution
1011

1112
// UNSUPPORTED: freestanding

test/Concurrency/attr_execution.swift

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
// RUN: %target-swift-emit-silgen -enable-experimental-feature AsyncCallerExecution %s | %FileCheck %s
1+
// RUN: %target-swift-emit-silgen -enable-experimental-feature ExecutionAttribute -enable-experimental-feature AsyncCallerExecution %s | %FileCheck %s
22

33
// REQUIRES: asserts
4+
// REQUIRES: swift_feature_ExecutionAttribute
45
// REQUIRES: swift_feature_AsyncCallerExecution
56

67

test/Concurrency/attr_execution_conversions.swift

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
// RUN: %target-typecheck-verify-swift -target %target-swift-5.1-abi-triple
1+
// RUN: %target-typecheck-verify-swift -target %target-swift-5.1-abi-triple -enable-experimental-feature ExecutionAttribute
22

3+
// REQUIRES: asserts
34
// REQUIRES: concurrency
5+
// REQUIRES: swift_feature_ExecutionAttribute
46

57
@execution(concurrent)
68
func concurrentTest() async {

test/IDE/complete_decl_attribute.swift

-3
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,6 @@ struct _S {
251251
// ON_METHOD-DAG: Keyword/None: preconcurrency[#Func Attribute#]; name=preconcurrency
252252
// ON_METHOD-DAG: Keyword/None: backDeployed[#Func Attribute#]; name=backDeployed
253253
// ON_METHOD-DAG: Keyword/None: lifetime[#Func Attribute#]; name=lifetime
254-
// ON_METHOD-DAG: Keyword/None: execution[#Func Attribute#]; name=execution
255254
// ON_METHOD-NOT: Keyword
256255
// ON_METHOD-DAG: Decl[Struct]/CurrModule: MyStruct[#MyStruct#]; name=MyStruct
257256
// ON_METHOD-DAG: Decl[Struct]/CurrModule: MyPropertyWrapper[#Property Wrapper#]; name=MyPropertyWrapper
@@ -326,7 +325,6 @@ struct _S {
326325
// ON_MEMBER_LAST-DAG: Keyword/None: freestanding[#Declaration Attribute#]; name=freestanding
327326
// ON_MEMBER_LAST-DAG: Keyword/None: storageRestrictions[#Declaration Attribute#]; name=storageRestrictions
328327
// ON_MEMBER_LAST-DAG: Keyword/None: lifetime[#Declaration Attribute#]; name=lifetime
329-
// ON_MEMBER_LAST-DAG: Keyword/None: execution[#Declaration Attribute#]; name=execution
330328
// ON_MEMBER_LAST-NOT: Keyword
331329
// ON_MEMBER_LAST-DAG: Decl[Struct]/CurrModule: MyStruct[#MyStruct#]; name=MyStruct
332330
// ON_MEMBER_LAST-DAG: Decl[Struct]/CurrModule/TypeRelation[Convertible]: MyPropertyWrapper[#Property Wrapper#]; name=MyPropertyWrapper
@@ -399,7 +397,6 @@ func dummy2() {}
399397
// KEYWORD_LAST-DAG: Keyword/None: attached[#Declaration Attribute#]; name=attached
400398
// KEYWORD_LAST-DAG: Keyword/None: storageRestrictions[#Declaration Attribute#]; name=storageRestrictions
401399
// KEYWORD_LAST-DAG: Keyword/None: lifetime[#Declaration Attribute#]; name=lifetime
402-
// KEYWORD_LAST-DAG: Keyword/None: execution[#Declaration Attribute#]; name=execution
403400
// KEYWORD_LAST-NOT: Keyword
404401
// KEYWORD_LAST-DAG: Decl[Struct]/CurrModule: MyStruct[#MyStruct#]; name=MyStruct
405402
// KEYWORD_LAST-DAG: Decl[Struct]/CurrModule/TypeRelation[Convertible]: MyGenericPropertyWrapper[#Property Wrapper#]; name=MyGenericPropertyWrapper

test/IDE/complete_decl_attribute_feature_requirement.swift

+26-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77

88
// RUN: %batch-code-completion -filecheck-additional-suffix _DISABLED
99
// RUN: %batch-code-completion -filecheck-additional-suffix _ENABLED \
10-
// RUN: -enable-experimental-feature ABIAttribute
10+
// RUN: -enable-experimental-feature ABIAttribute \
11+
// RUN: -enable-experimental-feature ExecutionAttribute
1112

1213
// NOTE: Please do not include the ", N items" after "Begin completions". The
1314
// item count creates needless merge conflicts given that an "End completions"
@@ -17,14 +18,18 @@
1718

1819
// KEYWORD2: Begin completions
1920
// KEYWORD2_ENABLED-DAG: Keyword/None: abi[#Func Attribute#]; name=abi
21+
// KEYWORD2_ENABLED-DAG: Keyword/None: execution[#Func Attribute#]; name=execution
2022
// KEYWORD2_DISABLED-NOT: Keyword/None: abi[#{{.*}} Attribute#]; name=abi
23+
// KEYWORD2_DISABLED-NOT: Keyword/None: execution[#{{.*}} Attribute#]; name=execution
2124
// KEYWORD2: End completions
2225

2326
@#^KEYWORD3^# class C {}
2427

2528
// KEYWORD3: Begin completions
2629
// KEYWORD3_ENABLED-NOT: Keyword/None: abi[#{{.*}} Attribute#]; name=abi
30+
// KEYWORD3_ENABLED-NOT: Keyword/None: execution[#{{.*}} Attribute#]; name=execution
2731
// KEYWORD3_DISABLED-NOT: Keyword/None: abi[#{{.*}} Attribute#]; name=abi
32+
// KEYWORD3_DISABLED-NOT: Keyword/None: execution[#{{.*}} Attribute#]; name=execution
2833
// KEYWORD3: End completions
2934

3035
@#^KEYWORD3_2?check=KEYWORD3^#IB class C2 {}
@@ -33,46 +38,60 @@
3338
@#^KEYWORD4^# enum E {}
3439
// KEYWORD4: Begin completions
3540
// KEYWORD4_ENABLED-NOT: Keyword/None: abi[#{{.*}} Attribute#]; name=abi
41+
// KEYWORD4_ENABLED-NOT: Keyword/None: execution[#{{.*}} Attribute#]; name=execution
3642
// KEYWORD4_DISABLED-NOT: Keyword/None: abi[#{{.*}} Attribute#]; name=abi
43+
// KEYWORD4_DISABLED-NOT: Keyword/None: execution[#{{.*}} Attribute#]; name=execution
3744
// KEYWORD4: End completions
3845

3946
@#^KEYWORD5^# struct S{}
4047
// KEYWORD5: Begin completions
4148
// KEYWORD5_ENABLED-NOT: Keyword/None: abi[#{{.*}} Attribute#]; name=abi
49+
// KEYWORD5_ENABLED-NOT: Keyword/None: execution[#{{.*}} Attribute#]; name=execution
4250
// KEYWORD5_DISABLED-NOT: Keyword/None: abi[#{{.*}} Attribute#]; name=abi
51+
// KEYWORD5_DISABLED-NOT: Keyword/None: execution[#{{.*}} Attribute#]; name=execution
4352
// KEYWORD5: End completions
4453

4554
@#^ON_GLOBALVAR^# var globalVar
4655
// ON_GLOBALVAR: Begin completions
4756
// ON_GLOBALVAR_ENABLED-DAG: Keyword/None: abi[#Var Attribute#]; name=abi
57+
// ON_GLOBALVAR_ENABLED-NOT: Keyword/None: execution[#{{.*}} Attribute#]; name=execution
4858
// ON_GLOBALVAR_DISABLED-NOT: Keyword/None: abi[#{{.*}} Attribute#]; name=abi
59+
// ON_GLOBALVAR_DISABLED-NOT: Keyword/None: execution[#{{.*}} Attribute#]; name=execution
4960
// ON_GLOBALVAR: End completions
5061

5162
struct _S {
5263
@#^ON_INIT^# init()
5364
// ON_INIT: Begin completions
5465
// ON_INIT_ENABLED-DAG: Keyword/None: abi[#Constructor Attribute#]; name=abi
66+
// ON_INIT_ENABLED-NOT: Keyword/None: execution[#{{.*}} Attribute#]; name=execution
5567
// ON_INIT_DISABLED-NOT: Keyword/None: abi[#{{.*}} Attribute#]; name=abi
68+
// ON_INIT_DISABLED-NOT: Keyword/None: execution[#{{.*}} Attribute#]; name=execution
5669
// ON_INIT: End completions
5770

5871
@#^ON_PROPERTY^# var foo
5972
// ON_PROPERTY: Begin completions
6073
// ON_PROPERTY_ENABLED-DAG: Keyword/None: abi[#Var Attribute#]; name=abi
74+
// ON_PROPERTY_ENABLED-NOT: Keyword/None: execution[#{{.*}} Attribute#]; name=execution
6175
// ON_PROPERTY_DISABLED-NOT: Keyword/None: abi[#{{.*}} Attribute#]; name=abi
76+
// ON_PROPERTY_DISABLED-NOT: Keyword/None: execution[#{{.*}} Attribute#]; name=execution
6277
// ON_PROPERTY: End completions
6378

6479
@#^ON_METHOD^# private
6580
func foo()
6681
// ON_METHOD: Begin completions
6782
// ON_METHOD_ENABLED-DAG: Keyword/None: abi[#Func Attribute#]; name=abi
83+
// ON_METHOD_ENABLED-DAG: Keyword/None: execution[#Func Attribute#]; name=execution
6884
// ON_METHOD_DISABLED-NOT: Keyword/None: abi[#{{.*}} Attribute#]; name=abi
85+
// ON_METHOD_DISABLED-NOT: Keyword/None: execution[#{{.*}} Attribute#]; name=execution
6986
// ON_METHOD: End completions
7087

7188

7289
func bar(@#^ON_PARAM_1?check=ON_PARAM^#)
7390
// ON_PARAM: Begin completions
7491
// ON_PARAM_ENABLED-NOT: Keyword/None: abi[#{{.*}} Attribute#]; name=abi
92+
// ON_PARAM_ENABLED-NOT: Keyword/None: execution[#{{.*}} Attribute#]; name=execution
7593
// ON_PARAM_DISABLED-NOT: Keyword/None: abi[#{{.*}} Attribute#]; name=abi
94+
// ON_PARAM_DISABLED-NOT: Keyword/None: execution[#{{.*}} Attribute#]; name=execution
7695
// ON_PARAM: End completions
7796

7897
func bar(
@@ -95,7 +114,9 @@ struct _S {
95114
@#^ON_MEMBER_LAST^#
96115
// ON_MEMBER_LAST: Begin completions
97116
// ON_MEMBER_LAST_ENABLED-DAG: Keyword/None: abi[#Declaration Attribute#]; name=abi
117+
// ON_MEMBER_LAST_ENABLED-DAG: Keyword/None: execution[#Declaration Attribute#]; name=execution
98118
// ON_MEMBER_LAST_DISABLED-NOT: Keyword/None: abi[#{{.*}} Attribute#]; name=abi
119+
// ON_MEMBER_LAST_DISABLED-NOT: Keyword/None: execution[#{{.*}} Attribute#]; name=execution
99120
// ON_MEMBER_LAST: End completions
100121
}
101122

@@ -107,7 +128,9 @@ func takeClosure(_: () -> Void) {
107128
// IN_CLOSURE: Begin completions
108129
// FIXME: Not valid in this position (but CompletionLookup can't tell that)
109130
// IN_CLOSURE_ENABLED-DAG: Keyword/None: abi[#Declaration Attribute#]; name=abi
131+
// IN_CLOSURE_ENABLED-DAG: Keyword/None: execution[#Declaration Attribute#]; name=execution
110132
// IN_CLOSURE_DISABLED-NOT: Keyword/None: abi[#{{.*}} Attribute#]; name=abi
133+
// IN_CLOSURE_DISABLED-NOT: Keyword/None: execution[#{{.*}} Attribute#]; name=execution
111134
// IN_CLOSURE: End completions
112135

113136
@#^KEYWORD_INDEPENDENT_1?check=KEYWORD_LAST^#
@@ -123,5 +146,7 @@ func dummy2() {}
123146

124147
// KEYWORD_LAST: Begin completions
125148
// KEYWORD_LAST_ENABLED-DAG: Keyword/None: abi[#Declaration Attribute#]; name=abi
149+
// KEYWORD_LAST_ENABLED-DAG: Keyword/None: execution[#Declaration Attribute#]; name=execution
126150
// KEYWORD_LAST_DISABLED-NOT: Keyword/None: abi[#Declaration Attribute#]; name=abi
151+
// KEYWORD_LAST_DISABLED-NOT: Keyword/None: execution[#Declaration Attribute#]; name=execution
127152
// KEYWORD_LAST: End completions

test/ModuleInterface/attrs.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
// RUN: %target-swift-emit-module-interface(%t.swiftinterface) %s -module-name attrs \
22
// RUN: -enable-experimental-feature ABIAttribute \
3-
// RUN: -enable-experimental-feature AsyncCallerExecution
3+
// RUN: -enable-experimental-feature ExecutionAttribute
44

55
// RUN: %target-swift-typecheck-module-from-interface(%t.swiftinterface) -module-name attrs
66

77
// RUN: %FileCheck %s --input-file %t.swiftinterface
88

99
// REQUIRES: swift_feature_ABIAttribute
10-
// REQUIRES: swift_feature_AsyncCallerExecution
10+
// REQUIRES: swift_feature_ExecutionAttribute
1111

1212
// CHECK: @_transparent public func glass() -> Swift.Int { return 0 }{{$}}
1313
@_transparent public func glass() -> Int { return 0 }
+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// RUN: %target-swift-emit-module-interface(%t.swiftinterface) %s -module-name execution_attr -enable-experimental-feature ExecutionAttribute
2+
// RUN: %target-swift-typecheck-module-from-interface(%t.swiftinterface) -module-name execution_attr
3+
4+
// RUN: %FileCheck %s --input-file %t.swiftinterface
5+
6+
// REQUIRES: swift_feature_ExecutionAttribute
7+
8+
public struct Test {
9+
// CHECK: #if compiler(>=5.3) && $ExecutionAttribute
10+
// CHECK-NEXT: @execution(concurrent) public func test() async
11+
// CHECK-NEXT: #else
12+
// CHECK-NEXT: public func test() async
13+
// CHECK-NEXT: #endif
14+
@execution(concurrent)
15+
public func test() async {
16+
}
17+
18+
// CHECK: #if compiler(>=5.3) && $ExecutionAttribute
19+
// CHECK-NEXT: public func other(_: @execution(caller) () async -> Swift.Void)
20+
// CHECK-NEXT: #else
21+
// CHECK-NEXT: public func other(_: () async -> Swift.Void)
22+
// CHECK-NEXT: #endif
23+
public func other(_: @execution(caller) () async -> Void) {}
24+
}
25+

test/Parse/execution.swift

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
// RUN: %target-typecheck-verify-swift -disable-availability-checking
1+
// RUN: %target-typecheck-verify-swift -disable-availability-checking -enable-experimental-feature ExecutionAttribute
2+
3+
// REQUIRES: asserts
4+
// REQUIRES: concurrency
5+
// REQUIRES: swift_feature_ExecutionAttribute
26

37
typealias F = @execution(concurrent) () async -> Void
48

test/SILGen/execution_attr.swift

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
// RUN: %target-swift-emit-silgen %s | %FileCheck %s
2-
// RUN: %target-swift-emit-silgen %s -enable-experimental-feature AsyncCallerExecution | %FileCheck %s
1+
// RUN: %target-swift-emit-silgen %s -enable-experimental-feature ExecutionAttribute | %FileCheck %s
2+
// RUN: %target-swift-emit-silgen %s -enable-experimental-feature ExecutionAttribute -enable-experimental-feature AsyncCallerExecution | %FileCheck %s
33

44
// REQUIRES: concurrency
55
// REQUIRES: asserts
6+
// REQUIRES: swift_feature_ExecutionAttribute
67
// REQUIRES: swift_feature_AsyncCallerExecution
78

89
// Validate that both with and without the experimental flag we properly codegen

0 commit comments

Comments
 (0)