Files
swift-mirror/test/SIL/printer_include_decls.swift
Michael Gottesman 34ec32bc14 [semantic-arc] Handle the rest of the unqualified mem opts in SILGen.
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
2016-11-09 11:37:52 -08:00

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