|
3 | 3 |
|
4 | 4 | ############ Test merging multiple categories into a single category ############
|
5 | 5 | ## Apply category merging to swiftc code just make sure we can handle addends
|
6 |
| -## and don't erase cateogry names for swift -- in order to not crash |
| 6 | +## and don't erase category names for swift -- in order to not crash |
7 | 7 | # RUN: llvm-mc -filetype=obj -triple=arm64-apple-macos -o cat_swift.o %s
|
8 | 8 | # RUN: %lld -arch arm64 -dylib -o cat_swift.dylib cat_swift.o -objc_category_merging
|
| 9 | +# RUN: llvm-objdump --objc-meta-data --macho cat_swift.dylib | FileCheck %s --check-prefixes=CHECK-MERGE |
| 10 | + |
| 11 | +; CHECK-MERGE: Contents of (__DATA_CONST,__objc_classlist) section |
| 12 | +; CHECK-MERGE: _$s11SimpleClassAACN |
| 13 | +; CHECK-MERGE: isa {{.+}} _OBJC_METACLASS_$__TtC11SimpleClass11SimpleClass |
| 14 | +; CHECK-MERGE: superclass 0x0 |
| 15 | +; CHECK-MERGE: cache 0x0 |
| 16 | +; CHECK-MERGE: vtable 0x0 |
| 17 | +; CHECK-MERGE: data {{.+}} (struct class_ro_t *) Swift class |
| 18 | +; CHECK-MERGE: flags 0x80 |
| 19 | +; CHECK-MERGE: instanceStart 8 |
| 20 | +; CHECK-MERGE: instanceSize 8 |
| 21 | +; CHECK-MERGE: reserved 0x0 |
| 22 | +; CHECK-MERGE: ivarLayout 0x0 |
| 23 | +; CHECK-MERGE: name {{.+}} _TtC11SimpleClass11SimpleClass |
| 24 | +; CHECK-MERGE: baseMethods {{.+}} (struct method_list_t *) |
| 25 | +; CHECK-MERGE: entsize 24 |
| 26 | +; CHECK-MERGE: count 3 |
| 27 | +; CHECK-MERGE: name {{.+}} categoryInstanceMethod |
| 28 | +; CHECK-MERGE: types {{.+}} q16@0:8 |
| 29 | +; CHECK-MERGE: imp _$s11SimpleClassAAC22categoryInstanceMethodSiyFTo |
| 30 | +; CHECK-MERGE: name {{.+}} baseClassInstanceMethod |
| 31 | +; CHECK-MERGE: types {{.+}} i16@0:8 |
| 32 | +; CHECK-MERGE: imp _$s11SimpleClassAAC04baseB14InstanceMethods5Int32VyFTo |
| 33 | +; CHECK-MERGE: name {{.+}} init |
| 34 | +; CHECK-MERGE: types {{.+}} @16@0:8 |
| 35 | +; CHECK-MERGE: imp _$s11SimpleClassAACABycfcTo |
| 36 | +; CHECK-MERGE: baseProtocols 0x0 |
| 37 | +; CHECK-MERGE: ivars 0x0 |
| 38 | +; CHECK-MERGE: weakIvarLayout 0x0 |
| 39 | +; CHECK-MERGE: baseProperties 0x0 |
| 40 | +; CHECK-MERGE: Meta Class |
| 41 | +; CHECK-MERGE: isa 0x0 |
| 42 | +; CHECK-MERGE: superclass 0x0 |
| 43 | +; CHECK-MERGE: cache 0x0 |
| 44 | +; CHECK-MERGE: vtable 0x0 |
| 45 | +; CHECK-MERGE: data {{.+}} (struct class_ro_t *) |
| 46 | +; CHECK-MERGE: flags 0x81 RO_META |
| 47 | +; CHECK-MERGE: instanceStart 40 |
| 48 | +; CHECK-MERGE: instanceSize 40 |
| 49 | +; CHECK-MERGE: reserved 0x0 |
| 50 | +; CHECK-MERGE: ivarLayout 0x0 |
| 51 | +; CHECK-MERGE: name {{.+}} _TtC11SimpleClass11SimpleClass |
| 52 | +; CHECK-MERGE: baseMethods 0x0 (struct method_list_t *) |
| 53 | +; CHECK-MERGE: baseProtocols 0x0 |
| 54 | +; CHECK-MERGE: ivars 0x0 |
| 55 | +; CHECK-MERGE: weakIvarLayout 0x0 |
| 56 | +; CHECK-MERGE: baseProperties 0x0 |
| 57 | +; CHECK-MERGE: Contents of (__DATA_CONST,__objc_imageinfo) section |
| 58 | +; CHECK-MERGE: version 0 |
| 59 | +; CHECK-MERGE: flags 0x740 OBJC_IMAGE_HAS_CATEGORY_CLASS_PROPERTIES Swift 5 or later |
9 | 60 |
|
10 | 61 | ; ================== Generated from Swift: ==================
|
| 62 | +;; > xcrun swiftc --version |
| 63 | +;; swift-driver version: 1.109.2 Apple Swift version 6.0 (swiftlang-6.0.0.3.300 clang-1600.0.20.10) |
11 | 64 | ;; > xcrun swiftc -S SimpleClass.swift -o SimpleClass.s
|
12 | 65 | ; import Foundation
|
13 | 66 | ; @objc class SimpleClass: NSObject {
|
|
0 commit comments