mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
These variables really are local variables -- they have have a TopLevelCodeDecl as their DeclContext rather than the SourceFile. Treating them as global variables caused crashes in serialization. We need an overhaul of top-level variables in script files anyway (see rdar://problem/20992489&21628526), but this fixes the immediate issue. rdar://problem/21928533 Swift SVN r30519
14 lines
384 B
Swift
14 lines
384 B
Swift
// RUN: rm -rf %t && mkdir %t
|
|
// RUN: %target-swift-frontend -emit-module -o %t %s -module-name Test
|
|
// RUN: llvm-bcanalyzer %t/Test.swiftmodule | FileCheck %s
|
|
|
|
// RUN: cp %s %t/main.swift
|
|
// RUN: %target-swift-frontend -parse -verify %t/main.swift -primary-file %S/Inputs/top-level-code-other.swift
|
|
|
|
// CHECK-NOT: UnknownCode
|
|
|
|
let a: Int? = 1
|
|
guard let b = a else {
|
|
fatalError()
|
|
}
|