Files
swift-mirror/test/IRGen/conformance_access_path.swift
Augusto Noronha 66748f71eb [DebugInfo] Emit debug info for witness tables
This change emits debug info for witness tables passed into generic
functions when a generic type is constrained to a protocol. This
information is required for LLDB's generic expression evaluator
to work in such functions.

rdar://104446865
2025-04-30 11:18:19 -07:00

34 lines
1.1 KiB
Swift

// RUN: %target-swift-frontend -primary-file %s -emit-ir > %t.ll
// RUN: %FileCheck %s < %t.ll
// https://github.com/apple/swift/issues/48752
// Canonicalizing a conformance access path that was built without the
// requirement signature.
public struct Valid<V> {}
extension Valid where V: ValidationSuite {}
public protocol Validatable {}
extension Validatable {
public func tested() {}
// CHECK-LABEL: define{{.*}}$s23conformance_access_path11ValidatablePAAE6tested2byyqd__m_t9InputTypeQyd__RszAA15ValidationSuiteRd__lF
public func tested<S: ValidationSuite>(by suite: S.Type) where S.InputType == Self {
// CHECK: [[S_AS_VALIDATION_SUITE_GEP:%[0-9]+]] = getelementptr inbounds ptr, ptr %S.ValidationSuite, i32 1
// CHECK: [[S_AS_VALIDATION_SUITE:%.*]] = load ptr, ptr [[S_AS_VALIDATION_SUITE_GEP]]
// CHECK: call swiftcc ptr @swift_getAssociatedConformanceWitness(ptr %S.Validator, ptr %S, ptr %Self,
tested()
}
}
public protocol Validator {
associatedtype InputType: Validatable
}
public protocol ValidationSuite: Validator {
associatedtype InputType: Validatable
}