Files
swift-mirror/test/IRGen/symbolic_references.swift
Slava Pestov e6dc10accd IRGen: More accurate getAddrOfLLVMVariableOrGOTEquivalent()
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.
2020-02-11 18:59:21 -05:00

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
}
}