mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Making those functions transparent enables to completely remove the creation of keypaths, even with -Onone. rdar://127793797
18 lines
509 B
Swift
18 lines
509 B
Swift
// RUN: %target-swift-frontend %s -module-name=test -parse-as-library -emit-sil | %FileCheck %s
|
|
|
|
// REQUIRES: swift_stdlib_no_asserts,optimized_stdlib
|
|
|
|
public struct S {
|
|
var a: Int
|
|
var b: Int
|
|
}
|
|
|
|
// Check that even with -Onone, no keypath is created.
|
|
|
|
// CHECK-LABEL: sil @$s4test6testitySPySiGSgSPyAA1SVGF :
|
|
// CHECK-NOT: keypath
|
|
// CHECK: } // end sil function '$s4test6testitySPySiGSgSPyAA1SVGF'
|
|
public func testit(_ p: UnsafePointer<S>) -> UnsafePointer<Int>? {
|
|
return p.pointer(to: \.b)
|
|
}
|