mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
14 lines
334 B
Swift
14 lines
334 B
Swift
// RUN: %swift < %s -repl | FileCheck %s
|
|
import Builtin
|
|
|
|
var x = new Int[10]
|
|
println(swift_isUniquelyReferenced(x.owner) as Bool)
|
|
// CHECK: true
|
|
|
|
var y = x
|
|
println(swift_isUniquelyReferenced(x.owner) as Bool)
|
|
// CHECK: false
|
|
|
|
swift_keepAlive(Builtin.castToObjectPointer(x.owner))
|
|
swift_keepAlive(Builtin.castToObjectPointer(y.owner))
|