Files
swift-mirror/test/DebugInfo/while.swift
Davide Italiano 67f90696d8 [SILGen] Create a new debug scope for top-level code.
<rdar://problem/46686369>
2019-01-10 15:38:24 -08:00

14 lines
536 B
Swift

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