1 ## Tests that lld correctly resolves the custom personality referenced by objc code in an archive.
4 # RUN: rm -rf %t; split-file %s %t
5 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-iossimulator %t/defined.s -o %t/defined.o
6 # RUN: yaml2obj %t/combined.yaml > %t/combined.o
7 # RUN: llvm-ar r %t/pack.a %t/defined.o %t/combined.o
8 # RUN: %no-arg-lld -dylib -arch x86_64 -platform_version ios-simulator 12.0.0 15.0 -ObjC %t/pack.a -o %t/a.dylib
9 # RUN: llvm-objdump --macho --syms %t/a.dylib | FileCheck %s
10 # RUN: %no-arg-lld -dylib -arch x86_64 -platform_version ios-simulator 12.0.0 15.0 -ObjC --start-lib %t/defined.o %t/combined.o --end-lib -o %t/a.dylib
11 # RUN: llvm-objdump --macho --syms %t/a.dylib | FileCheck %s
13 # CHECK: SYMBOL TABLE:
14 # CHECK: {{.*}} l F __TEXT,__text _my_personality
18 .private_extern _my_personality
21 .no_dead_strip _my_personality
24 .cfi_def_cfa_offset 16
27 .subsections_via_symbols
29 ## combined.yaml is produced from combined.o below:
30 ## lvm-mc -filetype=obj -triple=x86_64-apple-iossimulator %t/objc.s -o %t/objc.o
31 ## ld -r -o combined.o defined.o objc.o
33 ## .section __TEXT,__text
34 ## .global _OBJC_CLASS_$_MyTest
35 ## .no_dead_strip _OBJC_CLASS_$_MyTest
36 ## _OBJC_CLASS_$_MyTest:
38 ## .cfi_personality 155, _my_personality
39 ## .cfi_def_cfa_offset 16
44 ## .subsections_via_symbols
83 - sectname
: __eh_frame
95 content
: 1400000000000000017A520001781001100C0708900100001800000000000000017A505200017810069B04000000100C070890011800000004000000F8FFFFFFFFFFFFFF0100000000000000000E1000
137 - sectname
: __compact_unwind
149 content
: '00000000000000000100000000000202000000000000000000000000000000000000000000000000020000000000020200000000000000000000000000000000'
181 - cmd
: LC_DATA_IN_CODE
214 - '_OBJC_CLASS_$_MyTest'