mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Very roughly this increases the total coverage of SILGen tests with ownership enabled to ~20%. rdar://33358110
23 lines
738 B
Swift
23 lines
738 B
Swift
// RUN: %target-swift-frontend -emit-silgen -enable-sil-ownership %s | %FileCheck %s
|
|
|
|
public struct X { }
|
|
public struct Y { }
|
|
|
|
public class Foo {
|
|
func doSomething(x: X, y: Y) { }
|
|
func doSomethingElse(x: X) { }
|
|
}
|
|
|
|
// CHECK-LABEL: sil hidden @_T015argument_labels7testFoo{{[_0-9a-zA-Z]*}}F
|
|
// CHECK: bb0([[ARG0:%.*]] : @owned $Foo,
|
|
func testFoo(foo: Foo, x: X, y: Y) {
|
|
// CHECK: [[BORROWED_ARG0:%.*]] = begin_borrow [[ARG0]]
|
|
// CHECK: class_method [[BORROWED_ARG0]] : $Foo, #Foo.doSomething!1 : (Foo) -> (X, Y) -> ()
|
|
foo.doSomething(x: x, y: y)
|
|
|
|
// CHECK: [[BORROWED_ARG0:%.*]] = begin_borrow [[ARG0]]
|
|
// CHECK: class_method [[BORROWED_ARG0]] : $Foo, #Foo.doSomethingElse!1 : (Foo) -> (X) -> ()
|
|
foo.doSomethingElse(x: x)
|
|
}
|
|
|