Files
swift-mirror/test/Interop/Cxx/foreign-reference/derived-field-getter-retainable-frt-silgen.swift
Alex Lorenz f7ce9aa37f [cxx-interop] Synthesized derived-to-base field getter should copy out a retainable FRT value
This matches the semantics of accessing the same field from the base class
2023-10-16 14:41:44 -07:00

13 lines
463 B
Swift

// RUN: %target-swift-emit-sil -I %S/Inputs -enable-experimental-cxx-interop %s -validate-tbd-against-ir=none -Xcc -fignore-exceptions | %FileCheck %s
import DerivedFieldGetterReturnsOwnedFRT
func testGetX() -> CInt {
let derived = DerivedFieldFRT()
return derived.value.testVal
}
let _ = testGetX()
// CHECK: function_ref @{{.*}}__synthesizedBaseGetterAccessor_{{.*}} : $@convention(cxx_method) (@in_guaranteed DerivedFieldFRT) -> @owned RefCounted