mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
In the lit.site.cfg, if a MODULES_SDK is available, add a '%sdk' substitution and enable REQUIRES: sdk tests. Add some tests under test/Interpreter/SDK to test some basic ObjC interop features. Swift SVN r4243
26 lines
465 B
Swift
26 lines
465 B
Swift
// RUN: %swift -sdk=%sdk -i %s | FileCheck %s
|
|
// REQUIRES: sdk
|
|
|
|
import Foundation
|
|
|
|
class SuperString : NSString {
|
|
var len : Int
|
|
constructor(len:Int) {
|
|
super.constructor()
|
|
this.len = len
|
|
}
|
|
|
|
func length() -> Int {
|
|
return len
|
|
}
|
|
|
|
func characterAtIndex(n:Int) -> unichar {
|
|
return unichar(0x30 + n)
|
|
}
|
|
}
|
|
|
|
// CHECK: 0123456789
|
|
println(new SuperString(10))
|
|
// CHECK: 0123456789
|
|
println(NSString(NSString.stringWithString(new SuperString(10))))
|