mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
This prevents the linker from trying to emit relative relocations to locally-defined public symbols into dynamic libraries, which gives ld.so heartache.
25 lines
662 B
Swift
25 lines
662 B
Swift
// RUN: rm -rf %t
|
|
// RUN: %target-swift-frontend -use-jit -playground -parse-stdlib %s -emit-ir -disable-objc-attr-requires-foundation-module | FileCheck %s
|
|
|
|
// REQUIRES: OS=macosx
|
|
// REQUIRES: CPU=x86_64
|
|
// REQUIRES: objc_interop
|
|
|
|
import Swift
|
|
|
|
@objc class C { }
|
|
|
|
public func anchor() {}
|
|
|
|
anchor()
|
|
|
|
// CHECK-LABEL: define{{( protected)?}} i32 @main
|
|
// CHECK: call void @runtime_registration
|
|
// CHECK: call void @_TF10playground6anchorFT_T_
|
|
// CHECK: ret void
|
|
// CHECK: }
|
|
|
|
// CHECK-LABEL: define{{( protected)?}} private void @runtime_registration
|
|
// CHECK: call void @swift_instantiateObjCClass({{.*}} @_TMC10playground1C
|
|
|