File tree Expand file tree Collapse file tree 10 files changed +14
-21
lines changed
Expand file tree Collapse file tree 10 files changed +14
-21
lines changed Original file line number Diff line number Diff line change 1- // RUN: %target-swift-frontend -typecheck -target %target-swift-5.1-abi-triple -enable-experimental-async-top-level - swift-version 5 %s -verify
1+ // RUN: %target-swift-frontend -typecheck -target %target-swift-5.1-abi-triple -swift-version 5 %s -verify
22
3- // enable-experimental-async-top-level is passed and an await is used in the
4- // top-level, so the top-level code is a concurrent context. Variables are
5- // declared with `@_predatesConcurrency @MainActor`, and the top-level is run on
6- // the main actor.
3+ // An await is used in the top-level, so the top-level code is a concurrent
4+ // context. Variables are declared with `@_predatesConcurrency @MainActor`, and
5+ // the top-level is run on the main actor.
76
87var a = 10 // expected-note {{mutation of this var is only permitted within the actor}}
98
Original file line number Diff line number Diff line change 1- // RUN: %target-swift-frontend -typecheck -target %target-swift-5.1-abi-triple -enable-experimental-async-top-level - swift-version 6 %s -verify
1+ // RUN: %target-swift-frontend -typecheck -target %target-swift-5.1-abi-triple -swift-version 6 %s -verify
22
33var a = 10
44// expected-note@-1 2 {{var declared here}}
Original file line number Diff line number Diff line change 11// RUN: %empty-directory(%t)
22// RUN: split-file --leading-lines %s %t
33
4- // RUN: %target-swift-frontend -typecheck -verify %t/main.swift %t/foo.swift -enable-experimental-async-top-level - swift-version 6 -verify-additional-prefix swift6-
5- // RUN: %target-swift-frontend -typecheck -verify %t/main.swift %t/foo.swift -enable-experimental-async-top-level - swift-version 5 -verify-additional-prefix swift5-
4+ // RUN: %target-swift-frontend -typecheck -verify %t/main.swift %t/foo.swift -swift-version 6 -verify-additional-prefix swift6-
5+ // RUN: %target-swift-frontend -typecheck -verify %t/main.swift %t/foo.swift -swift-version 5 -verify-additional-prefix swift5-
66
77//--- foo.swift
88func foo( ) -> Int {
Original file line number Diff line number Diff line change 1- // RUN: %target-swift-frontend -typecheck -target %target-swift-5.1-abi-triple -enable-experimental-async-top-level -swift-version 5 %s -verify
21// RUN: %target-swift-frontend -typecheck -target %target-swift-5.1-abi-triple -swift-version 5 %s -verify
32
4- // Even though enable-experimental-async-top-level is enabled, there are no
5- // `await`s made from the top-level, so it is not an async context. `a` is just
6- // a normal top-level global variable with no actor isolation.
3+ // There are no `await`s made from the top-level, so it is not an async context.
4+ // `a` is just a normal top-level global variable with no actor isolation.
75
86var a = 10
97
Original file line number Diff line number Diff line change 11// RUN: %target-swift-frontend -typecheck -target %target-swift-5.1-abi-triple -swift-version 6 %s -verify
22
3- // Even though enable-experimental-async-top-level is enabled, there are no
4- // 'await's made from the top-level, thus the top-level is not an asynchronous
5- // context. `a` is just a normal top-level global variable with no actor
6- // isolation.
3+ // There are no 'await's made from the top-level, thus the top-level is not an
4+ // asynchronous context. `a` is just a normal top-level global variable with no
5+ // actor isolation.
76
87var a = 10 // expected-note 2 {{var declared here}}
98// expected-note@-1 2{{mutation of this var is only permitted within the actor}}
Original file line number Diff line number Diff line change 1- // RUN: %target-swift-frontend -target %target-swift-5.1-abi-triple -enable-experimental-async-top-level - strict-concurrency=complete -typecheck -verify %s
1+ // RUN: %target-swift-frontend -target %target-swift-5.1-abi-triple -strict-concurrency=complete -typecheck -verify %s
22
33var a = 10 // expected-note{{var declared here}}
44
Original file line number Diff line number Diff line change 11// RUN: %target-swift-frontend -emit-silgen %s | %FileCheck %s
2- // RUN: %target-swift-frontend -enable-experimental-async-top-level -emit-silgen %s | %FileCheck %s
32// RUN: %target-swift-frontend -experimental-skip-non-inlinable-function-bodies -experimental-skip-non-inlinable-function-bodies-without-types -emit-silgen %s | %FileCheck -check-prefix=SKIPPED-FUNC-EMITTED %s
43
54guard let x: Int = nil else { while true { } }
Original file line number Diff line number Diff line change 11// RUN: %target-swift-emit-silgen -Xllvm -sil-print-types -Xllvm -sil-full-demangle %s | %FileCheck %s
2- // RUN: %target-swift-emit-silgen -Xllvm -sil-print-types -Xllvm -sil-full-demangle -enable-experimental-async-top-level %s | %FileCheck %s
32
43func markUsed< T> ( _ t: T ) { }
54
Original file line number Diff line number Diff line change 11// RUN: %target-swift-emit-silgen -Xllvm -sil-print-types %s | %FileCheck %s
2- // RUN: %target-swift-emit-silgen -Xllvm -sil-print-types -enable-experimental-async-top-level %s | %FileCheck %s
32
43enum MyError : Error {
54 case A, B
Original file line number Diff line number Diff line change 1- // RUN: %target-swift-emit-silgen -Xllvm -sil-print-types -Xllvm -sil-full-demangle -target %target-swift-5.1-abi-triple -enable-experimental-async-top-level %s | %FileCheck %s
1+ // RUN: %target-swift-emit-silgen -Xllvm -sil-print-types -Xllvm -sil-full-demangle -target %target-swift-5.1-abi-triple %s | %FileCheck %s
22
33// a
44// CHECK-LABEL: sil_global hidden @$s24toplevel_globalactorvars1aSivp : $Int
You can’t perform that action at this time.
0 commit comments