mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
The logic here used to consist of a couple of ad-hoc checks, followed by a general assumption that if something had already been emitted, it could be referenced directly, whereas everything else had to go through a GOT entry. This is way too conservative. Instead, let's try to correctly calculate what translation unit an entity is going to end up in.
20 lines
997 B
Swift
20 lines
997 B
Swift
// RUN: %target-swift-frontend -emit-ir %s | %FileCheck %s
|
|
// RUN: %target-swift-frontend -emit-ir -enable-private-imports %s | %FileCheck %s --check-prefix=PRIVATE
|
|
|
|
protocol P {
|
|
associatedtype A
|
|
}
|
|
// CHECK-DAG: @"symbolic _____ 19symbolic_references3Foo016_{{.*}}V5InnerV9InnermostV" = linkonce_odr hidden constant <{ i8, i32, i8 }> <{ i8 1,
|
|
// CHECK-DAG: @"symbolic _____ 19symbolic_references3Foo016_{{.*}}V5InnerV" = linkonce_odr hidden constant <{ i8, i32, i8 }> <{ i8 1
|
|
// CHECK-DAG: @"symbolic _____ 19symbolic_references3Foo016_{{.*}}V" = linkonce_odr hidden constant <{ i8, i32, i8 }> <{ i8 1
|
|
|
|
// PRIVATE-DAG: @"symbolic _____ 19symbolic_references3Foo016_{{.*}}V5InnerV" = linkonce_odr hidden constant <{ i8, i32, i8 }> <{ i8 1
|
|
// PRIVATE-DAG: @"symbolic _____ 19symbolic_references3Foo016_{{.*}}V" = linkonce_odr hidden constant <{ i8, i32, i8 }> <{ i8 1
|
|
|
|
fileprivate struct Foo {
|
|
fileprivate struct Inner: P {
|
|
fileprivate struct Innermost { }
|
|
typealias A = Innermost
|
|
}
|
|
}
|