|
2 | 2 | // RUN: %FileCheck --input-file %t.ir %s
|
3 | 3 | // RUN: %FileCheck --input-file %t.ir --check-prefix NEGATIVE %s
|
4 | 4 |
|
| 5 | +// |
| 6 | +// @_objcImplementation class |
| 7 | +// |
| 8 | + |
5 | 9 | // Metaclass
|
6 | 10 | // CHECK: @"OBJC_METACLASS_$_ImplClass" = global %objc_class { %objc_class* @"OBJC_METACLASS_$_NSObject", %objc_class* @"OBJC_METACLASS_$_NSObject", %swift.opaque* @_objc_empty_cache, %swift.opaque* null, i64 ptrtoint ({ i32, i32, i32, i32, i8*, i8*, i8*, i8*, i8*, i8*, i8* }* [[_METACLASS_DATA_ImplClass:@[^, ]+]] to i64) }, align 8
|
7 | 11 | // CHECK: [[OBJC_CLASS_NAME_:@[^, ]+]] = private unnamed_addr constant [10 x i8] c"ImplClass\00"
|
|
15 | 19 | // CHECK: [[_DATA_ImplClass:@[^, ]+]] = internal constant { i32, i32, i32, i32, i8*, i8*, { i32, i32, [1 x { i8*, i8*, i8* }] }*, i8*, i8*, i8*, i8* } { i32 128, i32 8, i32 8, i32 0, i8* null, i8* getelementptr inbounds ([10 x i8], [10 x i8]* [[OBJC_CLASS_NAME_]], i64 0, i64 0), { i32, i32, [1 x { i8*, i8*, i8* }] }* [[_INSTANCE_METHODS_ImplClass]], i8* null, i8* null, i8* null, i8* null }, section "__DATA, __objc_data", align 8
|
16 | 20 | // CHECK: @"OBJC_CLASS_$_ImplClass" = global <{ i64, %objc_class*, %swift.opaque*, %swift.opaque*, { i32, i32, i32, i32, i8*, i8*, { i32, i32, [1 x { i8*, i8*, i8* }] }*, i8*, i8*, i8*, i8* }* }> <{ i64 ptrtoint (%objc_class* @"OBJC_METACLASS_$_ImplClass" to i64), %objc_class* @"OBJC_CLASS_$_NSObject", %swift.opaque* @_objc_empty_cache, %swift.opaque* null, { i32, i32, i32, i32, i8*, i8*, { i32, i32, [1 x { i8*, i8*, i8* }] }*, i8*, i8*, i8*, i8* }* [[_DATA_ImplClass]] }>, section "__DATA,__objc_data, regular", align 8
|
17 | 21 |
|
| 22 | +// Swift metadata |
| 23 | +// NEGATIVE-NOT: OBJC_CLASS_$_ImplClass.{{[0-9]}} |
| 24 | +// NEGATIVE-NOT: $sSo9ImplClassCMn |
| 25 | +// NEGATIVE-NOT: $sSo9ImplClassCHn |
| 26 | +// NEGATIVE-NOT: $sSo9ImplClassCN |
| 27 | +// NEGATIVE-NOT: $sSo9ImplClassCMf |
18 | 28 | @_objcImplementation extension ImplClass {
|
19 | 29 | @objc func mainMethod(_: Int32) {
|
20 | 30 | print("mainMethod")
|
21 | 31 | }
|
22 | 32 | }
|
23 | 33 |
|
| 34 | +// |
| 35 | +// @_objcImplementation category |
| 36 | +// |
| 37 | + |
24 | 38 | // Category1
|
25 | 39 | // CHECK: [[OBJC_CLASS_NAME_2:@[^, ]+]] = private unnamed_addr constant [10 x i8] c"Category1\00"
|
26 | 40 | // CHECK: [[selector_data_category1Method_:@[^, ]+]] = private global [17 x i8] c"category1Method:\00", section "__TEXT,__objc_methname,cstring_literals", align 1
|
|
32 | 46 | }
|
33 | 47 | }
|
34 | 48 |
|
| 49 | +// |
| 50 | +// Epilogue |
| 51 | +// |
| 52 | + |
35 | 53 | // CHECK: @"objc_classes_OBJC_CLASS_$_ImplClass" = internal global i8* bitcast (<{ i64, %objc_class*, %swift.opaque*, %swift.opaque*, { i32, i32, i32, i32, i8*, i8*, { i32, i32, [1 x { i8*, i8*, i8* }] }*, i8*, i8*, i8*, i8* }* }>* @"OBJC_CLASS_$_ImplClass" to i8*), section "__DATA,__objc_classlist,regular,no_dead_strip", align 8
|
36 | 54 | // CHECK: @objc_categories = internal global [1 x i8*] [i8* bitcast ({ i8*, %objc_class*, { i32, i32, [1 x { i8*, i8*, i8* }] }*, i8*, i8*, i8*, i8*, i32 }* [[_CATEGORY_ImplClass_Category1]] to i8*)], section "__DATA,__objc_catlist,regular,no_dead_strip", align 8
|
37 | 55 |
|
| 56 | + |
| 57 | +// |
| 58 | +// Functions |
| 59 | +// |
| 60 | + |
38 | 61 | // CHECK: define internal void @"$sSo9ImplClassC19objc_implementationE10mainMethodyys5Int32VFTo"
|
39 | 62 | // CHECK: define internal void @"$sSo9ImplClassC19objc_implementationE15category1Methodyys5Int32VFTo"
|
40 | 63 |
|
| 64 | +// |
| 65 | +// Not implemented in Swift |
| 66 | +// |
| 67 | + |
41 | 68 | // NEGATIVE-NOT: Category2
|
42 | 69 | // NEGATIVE-NOT: NoImplClass
|
43 |
| -// NEGATIVE-NOT: OBJC_CLASS_$_ImplClass.{{[0-9]}} |
44 |
| -// NEGATIVE-NOT: $sSo9ImplClassCMn |
45 |
| -// NEGATIVE-NOT: $sSo9ImplClassCHn |
46 |
| -// NEGATIVE-NOT: $sSo9ImplClassCN |
47 |
| -// NEGATIVE-NOT: $sSo9ImplClassCMf |
|
0 commit comments