Files
swift-mirror/test/DebugInfo/if-var.swift
Adrian Prantl 2a24b78dee Emit debug info for "if var" and "guard var" bindings.
<rdar://problem/23542506&24247817>
2016-02-01 15:45:30 -08:00

12 lines
249 B
Swift

// RUN: %target-swift-frontend %s -emit-ir -g -o - | FileCheck %s
func markUsed<T>(t: T) {}
public func f(s : String?)
{
if var str = s {
// CHECK: !DILocalVariable(name: "str", {{.*}}line: [[@LINE-1]]
str = "foo"
markUsed(str)
}
}