Files
swift-mirror/test/DebugInfo/if.swift
Adrian Prantl 42c470ad73 Debug Info: Add a testcase for the scoping of patterns bound in an if stmt.
rdar://problem/22677613

Swift SVN r31999
2015-09-16 17:51:19 +00:00

14 lines
515 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: ![[SCOPE1:[0-9]+]] = distinct !DILexicalBlock(scope: ![[MAIN:[0-9]+]]
// CHECK: !DILocalVariable(name: "val", scope: ![[SCOPE1]]
}
if let val = yieldValue() {
// CHECK: ![[SCOPE2:[0-9]+]] = distinct !DILexicalBlock(scope: ![[MAIN]]
// CHECK: !DILocalVariable(name: "val", scope: ![[SCOPE2]]
}