mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Windows does not permit cross-module data accesses to be direct. This is a problem for public protocols with root conformances which are external. Use a runtime initialiser for the root protocol conformance chaining to alleviate this issue. This shows up in the Foundation build.
26 lines
844 B
Swift
26 lines
844 B
Swift
// RUN: %empty-directory(%t)
|
|
// RUN: %target-swift-frontend -emit-module -DA -parse-as-library -parse-stdlib -module-name A %s -o %t/A.swiftmodule
|
|
// RUN: %target-swift-frontend -emit-ir -DB -I %t -parse-as-library -parse-stdlib -module-name B -o - %s | %FileCheck %s -check-prefix CHECK-%target-import-type
|
|
|
|
#if A
|
|
public protocol P {
|
|
}
|
|
|
|
public enum E : P {
|
|
}
|
|
#endif
|
|
|
|
#if B
|
|
import A
|
|
|
|
public protocol Q : P {
|
|
}
|
|
|
|
extension E : Q {
|
|
}
|
|
#endif
|
|
|
|
// CHECK-DIRECT: @"$s1A1EO1B1QADWP" ={{( dllexport)?}}{{( protected)?}} constant [2 x i8*] [i8* bitcast (%swift.protocol_conformance_descriptor* @"$s1A1EO1B1QADMc" to i8*), i8* bitcast (i8** @"$s1A1EOAA1PAAWP" to i8*)]
|
|
// CHECK-INDIRECT: @"$s1A1EO1B1QADWP" ={{( dllexport)?}}{{( protected)?}} constant [2 x i8*] [i8* bitcast (%swift.protocol_conformance_descriptor* @"$s1A1EO1B1QADMc" to i8*), i8* null]
|
|
|