Files
swift-mirror/test/IRGen/playground.swift
Joe Groff 8cb1175e49 IRGen: Emit public definitions with protected visibility on ELF.
This prevents the linker from trying to emit relative relocations to locally-defined public symbols into dynamic libraries, which gives ld.so heartache.
2016-02-08 13:09:27 -08:00

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