mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
By using relative references, either directly to symbols internal to the current TU, or to the GOT entry for external symbols, we avoid unnecessary runtime relocations, and we save space on 64-bit platforms, since a single image is still <2GB in size. For the 64-bit standard library, this trades 26KB of fake-const data in __DATA,__swift1_proto for 13KB of true-const data in __TEXT,__swift2_proto. Implements rdar://problem/22334380. Swift SVN r31555
21 lines
325 B
Swift
21 lines
325 B
Swift
// RUN: %target-repl-run-simple-swift | FileCheck %s
|
|
|
|
// REQUIRES: objc_interop
|
|
// REQUIRES: swift_repl
|
|
|
|
import Cocoa
|
|
|
|
// CHECK: 0{{$}}
|
|
print(NSNumber(integer: 0).description)
|
|
|
|
protocol Q { func foo() }
|
|
|
|
extension CGRect: Q {
|
|
func foo() {
|
|
print(self)
|
|
}
|
|
}
|
|
|
|
(CGRect() as Any as! Q).foo()
|
|
// CHECK: (0.0, 0.0, 0.0, 0.0)
|