// RUN: %empty-directory(%t) // RUN: %target-swift-frontend -emit-module -emit-module-path=%t/keypaths_external_other.swiftmodule -module-name=keypaths_external_other %S/Inputs/keypaths_external_other.swift // -- Convert constants to decimal constants that LLVM will print // RUN: %{python} %utils/chex.py < %s > %t/keypaths.sil // RUN: %target-swift-frontend -module-name keypaths -emit-ir %s -I %t | %FileCheck %t/keypaths.sil sil_stage canonical import Swift import keypaths_external_other sil @generic_external : $@convention(thin) (@in_guaranteed A, @in_guaranteed B, @in_guaranteed A, @in_guaranteed B, @in_guaranteed A, @in_guaranteed B) -> () { entry(%0 : $*A, %1 : $*B, %2 : $*A, %3 : $*B, %4 : $*A, %5 : $*B): %t = keypath $KeyPath, B>, ( root $G; gettable_property $Z, id @g_x_get : $@convention(thin) (@in_guaranteed G) -> @out Z, getter @g_x_get : $@convention(thin) (@in_guaranteed G) -> @out Z, external #G.x ) %u = keypath $KeyPath, A>, ( root $G; gettable_property $Y, id @g_subscript_get : $@convention(thin) (@in_guaranteed G, UnsafeRawPointer) -> @out B, getter @g_subscript_get : $@convention(thin) (@in_guaranteed G, UnsafeRawPointer) -> @out B, indices [%$0 : $X : $*X], indices_equals @s_equals : $@convention(thin) (UnsafeRawPointer, UnsafeRawPointer) -> Bool, indices_hash @s_hash : $@convention(thin) (UnsafeRawPointer) -> Int, external #G.subscript ) (%1) return undef : $() } sil @g_x_get : $@convention(thin) (@in_guaranteed G) -> @out Z sil @g_subscript_get : $@convention(thin) (@in_guaranteed G, UnsafeRawPointer) -> @out B sil @s_equals : $@convention(thin) (UnsafeRawPointer, UnsafeRawPointer) -> Bool sil @s_hash : $@convention(thin) (UnsafeRawPointer) -> Int // -- %t // CHECK: [[KP_T:@keypath(\..*)?]] = private global <{ {{.*}} }> <{ {{.*}} i32 1, {{.*}} @"{{got.|__imp_}}$s23keypaths_external_other1GV1xxvpMV" // CHECK-SAME: @"symbolic x" // -- computed get-only property, identified by indirect pointer // CHECK-SAME: // -- %u // CHECK: [[KP_U:@keypath(\..*)?]] = private global <{ {{.*}} }> <{ {{.*}} i32 3, {{.*}} @"{{got.|__imp_}}$s23keypaths_external_other1GVyxqd__cSHRd__luipMV" // CHECK-SAME: @"symbolic q_" // CHECK-SAME: @"symbolic x" // CHECK-SAME: @"get_witness_table // -- computed get-only property, identified by indirect pointer // CHECK-SAME: