mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Unless there is some meaningful code on the same line as an await call (e.g. other parts of an expression), there should be no additional line entries associated with that line on the continuation funclet. This patch changes codegen to avoid emitting debug location for the "prologue" code at the start of a funclet, instead of simply copying the debug location of the split point.
25 lines
703 B
Swift
25 lines
703 B
Swift
// RUN: %target-swift-frontend %s -emit-irgen -g -o - \
|
|
// RUN: -module-name M -disable-availability-checking \
|
|
// RUN: -parse-as-library | %FileCheck %s --check-prefix=CHECK
|
|
|
|
// REQUIRES: concurrency
|
|
|
|
|
|
func ASYNC___1___() async -> Int {
|
|
return 42
|
|
}
|
|
|
|
// Check that the first debug location after a split point is for the line
|
|
// _after_ the await.
|
|
|
|
// CHECK: define {{.*}} @"$s1M12ASYNC___2___SiyYaF"
|
|
func ASYNC___2___() async -> Int {
|
|
var x = 10
|
|
await ASYNC___1___()
|
|
// CHECK: call {{.*}} @llvm.coro.suspend.async{{.*}} ptr @__swift_async_resume_get_context{{.*}} !dbg
|
|
// CHECK: !dbg ![[FirstDbg:[0-9]+]]
|
|
// CHECK: ![[FirstDbg]] = !DILocation(line: [[@LINE+1]]
|
|
x = 12
|
|
return x
|
|
}
|