Files
swift-mirror/test/IRGen/fixed_class_initialization.swift
Joe Groff 4abb548adb IRGen: Invoke objc_opt_self directly when available.
We don't need swift_getInitializedObjCClass on new enough Apple OSes because
the ObjC runtime provides an equivalent call for us.
2020-02-28 10:36:42 -08:00

18 lines
626 B
Swift

// RUN: %target-swift-frontend -target x86_64-apple-macosx10.15 -module-name main -emit-ir %s | %FileCheck --check-prefix=CHECK --check-prefix=HAS_OPT_SELF %s
// RUN: %target-swift-frontend -target x86_64-apple-macosx10.14 -module-name main -emit-ir %s | %FileCheck --check-prefix=CHECK --check-prefix=NO_OPT_SELF %s
// REQUIRES: objc_interop
// REQUIRES: OS=macosx
class C {
var x: Int = 0
}
public func foof() -> Any.Type {
return C.self
}
// CHECK-LABEL: define {{.*}} %swift.metadata_response @"$s4main1CCMa"
// HAS_OPT_SELF: call {{.*}} @objc_opt_self
// NO_OPT_SELF: call {{.*}} @swift_getInitializedObjCClass