mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
33 lines
413 B
Swift
33 lines
413 B
Swift
// REQUIRES: OS=macosx
|
|
// RUN: %target-jit-run %s -enable-experimental-feature LazyImmediate | %FileCheck %s
|
|
|
|
// Tests that piecewise compilation works with global variables
|
|
|
|
let x = 1
|
|
|
|
// CHECK: 1
|
|
print(x)
|
|
|
|
fileprivate let y = 2
|
|
|
|
// CHECK: 2
|
|
print(y)
|
|
|
|
public let z = 3
|
|
|
|
// CHECK: 3
|
|
print(z)
|
|
|
|
var count = 0
|
|
|
|
func incr() -> Int {
|
|
count += 1
|
|
return count
|
|
}
|
|
|
|
// CHECK: 1
|
|
print(incr())
|
|
|
|
// CHECK: 2
|
|
print(incr())
|