Files
swift-mirror/test/DebugInfo/if.swift
Adrian Prantl 84d9238315 Emit llvm.dbg.declare intrisics immediately after the described alloca.
This cleanup change doesn't change the semantics, but it makes the
resulting IR much easier to read and debug.
2017-05-24 09:13:41 -07:00

14 lines
516 B
Swift

// RUN: %target-swift-frontend -g -emit-ir %s | %FileCheck %s
func yieldValue() -> Int64? { return 23 }
// Verify that variables bound in the while statements are in distinct scopes.
if let val = yieldValue() {
// CHECK: !DILocalVariable(name: "val", scope: ![[SCOPE1:[0-9]+]]
// CHECK: ![[SCOPE1]] = distinct !DILexicalBlock(scope: ![[MAIN:[0-9]+]]
}
if let val = yieldValue() {
// CHECK: !DILocalVariable(name: "val", scope: ![[SCOPE2:[0-9]+]]
// CHECK: ![[SCOPE2]] = distinct !DILexicalBlock(scope: ![[MAIN]]
}