Files
swift-mirror/test/DebugInfo/lazy-getter.swift
Adrian Prantl 958a1577b5 Ensure calls to getters have a source location.
Calls to getters are implicit because the compiler inserts them on a property
access, but the location is useful in backtraces so it should be preserved.

rdar://109123395
2023-05-31 17:41:26 -07:00

11 lines
384 B
Swift

// RUN: %target-swift-frontend %s -Onone -emit-ir -g -o - -parse-as-library -module-name a | %FileCheck %s
func use<T>(_ t : T) {}
public func f() -> (() -> ()) {
lazy var i : Int = 0
return {
// CHECK: call {{.*}} @"$s1a1fyycyF1iL_Sivg"({{.*}}), !dbg ![[GETTER_LOC:[0-9]+]]
// CHECK: ![[GETTER_LOC]] = !DILocation(line: [[@LINE+1]], column: 11
use(i)
}
}