Files
swift-mirror/test/IRGen/reparentable_availability.swift
Kavon Farvardin 149ee8f02d IRGen: weak-link the base descriptor for reparented extensions
A reparented extension can have availability that is newer than
the two protocols involved. In such a case, we were mistakenly not
considering the availability of that extension when determining
whether the base conformance descriptor should be `weak extern`.

rdar://181953862
2026-07-21 12:32:40 -07:00

23 lines
1.1 KiB
Swift

// RUN: %empty-directory(%t)
// RUN: %target-swift-frontend -enable-experimental-feature Reparenting -enable-library-evolution -emit-module %S/Inputs/reparentable_availability_lib.swift -o %t
// A conformance to P references the base conformance descriptor for P: RP,
// but because of the availability of the @reparented extension, that
// conformance descriptor is only available in macOS 14, so it should be
// weak-linked when targeting platforms older than that.
// OLD: @"$s{{.*}}1PPAA2RPTb" = extern_weak global
// RUN: %target-swift-frontend -module-name output -enable-experimental-feature Reparenting -target %target-cpu-apple-macosx13 -emit-ir -parse-as-library %s -I %t | %FileCheck %s --check-prefix=OLD
// NEW: @"$s{{.*}}1PPAA2RPTb" = external global
// RUN: %target-swift-frontend -module-name output -enable-experimental-feature Reparenting -target %target-cpu-apple-macosx14 -emit-ir -parse-as-library %s -I %t | %FileCheck %s --check-prefix=NEW
// REQUIRES: OS=macosx
// REQUIRES: swift_feature_Reparenting
import reparentable_availability_lib
public struct C: P {
public func doP() {}
}