Files
swift-mirror/test/DebugInfo/async-await-no-debug-info-after-split-point.swift
Felipe de Azevedo Piovezan 58bbadd28e [DebugInfo] Dont generate line information at the split point of async funclets
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.
2024-09-13 19:06:56 -07:00

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
}