mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Keep in mind that these are approximations that will not impact correctness since in all cases I ensured that the SIL will be the same after the OwnershipModelEliminator has run. The cases that I was unsure of I commented with SEMANTIC ARC TODO. Once we have the verifier any confusion that may have occurred here will be dealt with. rdar://28685236
45 lines
834 B
Swift
45 lines
834 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 -assume-parsing-unqualified-ownership-sil -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
|