mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Most tests were using %swift or similar substitutions, which did not include the target triple and SDK. The driver was defaulting to the host OS. Thus, we could not run the tests when the standard library was not built for OS X. Swift SVN r24504
45 lines
791 B
Swift
45 lines
791 B
Swift
// RUN: rm -f %t.*
|
|
// RUN: %target-swift-frontend -emit-sil %s -o %t.sil
|
|
// RUN: FileCheck --input-file=%t.sil %s
|
|
// RUN: %target-swift-frontend -emit-silgen %t.sil -module-name=printer_include_decl | FileCheck %s
|
|
|
|
var x: Int
|
|
// CHECK: var x: Int
|
|
|
|
class Foo {
|
|
// FIXME: The constructors and destructors without bodies cannot be parsed.
|
|
init(i: Int) {
|
|
self.x = i
|
|
}
|
|
// CHECK: init(i: Int)
|
|
|
|
deinit { m() }
|
|
// CHECK: deinit
|
|
|
|
subscript(x: Int, y: Int) -> Int {
|
|
get {
|
|
return 0
|
|
}
|
|
set {}
|
|
}
|
|
// CHECK: subscript (x: Int, y: Int) -> Int
|
|
|
|
final var x : Int
|
|
// CHECK: var x: Int
|
|
|
|
final var y : Int {
|
|
get {
|
|
return 5
|
|
}
|
|
}
|
|
// CHECK: var y: Int
|
|
|
|
func m() {}
|
|
// CHECK: func m()
|
|
}
|
|
|
|
func bar(x: Foo) -> Int {
|
|
return x.x
|
|
}
|
|
// CHECK: func bar(x: Foo) -> Int
|