forked from swiftlang/swift
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathobjc_properties_jit.swift
26 lines (22 loc) · 1.23 KB
/
objc_properties_jit.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) %s -emit-ir -disable-objc-attr-requires-foundation-module -use-jit | FileCheck %s
// REQUIRES: objc_interop
import Foundation
extension NSString {
class var classProp: Int {
get { fatalError() }
set { fatalError() }
}
var instanceProp: Int {
get { fatalError() }
set { fatalError() }
}
}
// CHECK-LABEL: define private void @runtime_registration
// CHECK: [[GET_CLASS_PROP:%.*]] = call i8* @sel_registerName({{.*}}(classProp)
// CHECK: call i8* @class_replaceMethod(%objc_class* @"OBJC_METACLASS_$_NSString", i8* [[GET_CLASS_PROP]]
// CHECK: [[SET_CLASS_PROP:%.*]] = call i8* @sel_registerName({{.*}}(setClassProp:)
// CHECK: call i8* @class_replaceMethod(%objc_class* @"OBJC_METACLASS_$_NSString", i8* [[SET_CLASS_PROP]]
// CHECK: [[GET_INSTANCE_PROP:%.*]] = call i8* @sel_registerName({{.*}}(instanceProp)
// CHECK: call i8* @class_replaceMethod(%objc_class* @"OBJC_CLASS_$_NSString", i8* [[GET_INSTANCE_PROP]]
// CHECK: [[SET_INSTANCE_PROP:%.*]] = call i8* @sel_registerName({{.*}}(setInstanceProp:)
// CHECK: call i8* @class_replaceMethod(%objc_class* @"OBJC_CLASS_$_NSString", i8* [[SET_INSTANCE_PROP]]