mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Type annotations for instruction operands are omitted, e.g. ``` %3 = struct $S(%1, %2) ``` Operand types are redundant anyway and were only used for sanity checking in the SIL parser. But: operand types _are_ printed if the definition of the operand value was not printed yet. This happens: * if the block with the definition appears after the block where the operand's instruction is located * if a block or instruction is printed in isolation, e.g. in a debugger The old behavior can be restored with `-Xllvm -sil-print-types`. This option is added to many existing test files which check for operand types in their check-lines.
23 lines
1.0 KiB
Swift
23 lines
1.0 KiB
Swift
// RUN: %target-swift-frontend -Xllvm -sil-print-types -emit-silgen %s -module-name test -swift-version 5 | %FileCheck --enable-var-scope %s --implicit-check-not 'hop_to_executor {{%[0-9]+}}'
|
|
// REQUIRES: concurrency
|
|
|
|
@available(SwiftStdlib 5.1, *)
|
|
protocol TestableAsync {
|
|
func test() async
|
|
}
|
|
|
|
@available(SwiftStdlib 5.1, *)
|
|
actor TestActor : TestableAsync {
|
|
// CHECK-LABEL: sil private [transparent] [thunk] [ossa] @$s4test9TestActorCAA13TestableAsyncA2aDPAAyyYaFTW : $@convention(witness_method: TestableAsync) @async (@in_guaranteed TestActor) -> ()
|
|
// CHECK: [[ACTOR_INSTANCE:%.*]] = load_borrow %0 : $*TestActor
|
|
// CHECK-NEXT: hop_to_executor [[ACTOR_INSTANCE]] : $TestActor
|
|
func test() { }
|
|
}
|
|
|
|
@available(SwiftStdlib 5.1, *)
|
|
@MainActor class TestClass : TestableAsync {
|
|
// CHECK-LABEL: sil private [transparent] [thunk] [ossa] @$s4test9TestClassCAA13TestableAsyncA2aDPAAyyYaFTW : $@convention(witness_method: TestableAsync) @async (@in_guaranteed TestClass) -> ()
|
|
// CHECK: hop_to_executor {{%.*}} : $MainActor
|
|
func test() { }
|
|
}
|