mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
SwiftRemoteMirror: Add a test for unowned-self captures
NFC.
This commit is contained in:
@@ -82,6 +82,12 @@ class C {
|
||||
print(self)
|
||||
}
|
||||
}
|
||||
|
||||
func captureUnownedSelf() -> () -> () {
|
||||
return { [unowned self] in
|
||||
print(self)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func generic<T : P, U, V : C>(x: T, y: U, z: V, i: Int) {
|
||||
@@ -504,4 +510,25 @@ reflect(function: C().captureWeakSelf())
|
||||
// CHECK-32-NEXT: (field offset=12
|
||||
// CHECK-32-NEXT: (reference kind=weak refcounting=native)))
|
||||
|
||||
reflect(function: C().captureUnownedSelf())
|
||||
// CHECK-64: Reflecting an object.
|
||||
// CHECK-64: Instance pointer in child address space: 0x{{[0-9a-fA-F]+}}
|
||||
// CHECK-64: Type reference:
|
||||
// CHECK-64: (builtin Builtin.NativeObject)
|
||||
|
||||
// CHECK-64: Type info:
|
||||
// CHECK-64: (closure_context size=24 alignment=8 stride=24 num_extra_inhabitants=0
|
||||
// CHECK-64-NEXT: (field offset=16
|
||||
// CHECK-64-NEXT: (reference kind=unowned refcounting=native)))
|
||||
|
||||
// CHECK-32: Reflecting an object.
|
||||
// CHECK-32: Instance pointer in child address space: 0x{{[0-9a-fA-F]+}}
|
||||
// CHECK-32: Type reference:
|
||||
// CHECK-32: (builtin Builtin.NativeObject)
|
||||
|
||||
// CHECK-32: Type info:
|
||||
// CHECK-32: (closure_context size=16 alignment=4 stride=16 num_extra_inhabitants=0
|
||||
// CHECK-32-NEXT: (field offset=12
|
||||
// CHECK-32-NEXT: (reference kind=unowned refcounting=native)))
|
||||
|
||||
doneReflecting()
|
||||
|
||||
Reference in New Issue
Block a user