93 lines · plain
1# REQUIRES: aarch642 3# RUN: llvm-mc -filetype=obj -triple=arm64-apple-darwin %s -o %t.o4# RUN: %lld -arch arm64 -lSystem -o %t.out %t.o -U _external_func5# RUN: llvm-otool -vs __TEXT __objc_stubs %t.out | FileCheck %s6# RUN: %lld -arch arm64 -lSystem -o %t.out %t.o -dead_strip -U _external_func7# RUN: llvm-otool -vs __TEXT __objc_stubs %t.out | FileCheck %s8# RUN: %lld -arch arm64 -lSystem -o %t.out %t.o -objc_stubs_fast -U _external_func9# RUN: llvm-otool -vs __TEXT __objc_stubs %t.out | FileCheck %s10# RUN: llvm-otool -l %t.out | FileCheck %s --check-prefix=FASTALIGN11# RUN: %lld -arch arm64 -lSystem -o %t.out %t.o -objc_stubs_small -U _external_func12# RUN: llvm-otool -vs __TEXT __objc_stubs %t.out | FileCheck %s --check-prefix=SMALL13# RUN: llvm-otool -l %t.out | FileCheck %s --check-prefix=SMALLALIGN14# RUN: llvm-objdump --section-headers %t.out | FileCheck %s --check-prefix=SECTIONS15 16# CHECK: Contents of (__TEXT,__objc_stubs) section17 18# CHECK-NEXT: _objc_msgSend$foo:19# CHECK-NEXT: adrp x1, 8 ; 0x10000800020# CHECK-NEXT: ldr x1, [x1, #0x18]21# CHECK-NEXT: adrp x16, 4 ; 0x10000400022# CHECK-NEXT: ldr x16, [x16]23# CHECK-NEXT: br x1624# CHECK-NEXT: brk #0x125# CHECK-NEXT: brk #0x126# CHECK-NEXT: brk #0x127 28# CHECK-NEXT: _objc_msgSend$length:29# CHECK-NEXT: adrp x1, 8 ; 0x10000800030# CHECK-NEXT: ldr x1, [x1, #0x20]31# CHECK-NEXT: adrp x16, 4 ; 0x10000400032# CHECK-NEXT: ldr x16, [x16]33# CHECK-NEXT: br x1634# CHECK-NEXT: brk #0x135# CHECK-NEXT: brk #0x136# CHECK-NEXT: brk #0x137 38# CHECK-EMPTY:39 40# FASTALIGN: sectname __objc_stubs41# FASTALIGN-NEXT: segname __TEXT42# FASTALIGN-NEXT: addr43# FASTALIGN-NEXT: size44# FASTALIGN-NEXT: offset45# FASTALIGN-NEXT: align 2^5 (32)46 47# SMALL: _objc_msgSend$foo:48# SMALL-NEXT: adrp x1, 8 ; 0x10000800049# SMALL-NEXT: ldr x1, [x1, #0x18]50# SMALL-NEXT: b51 52# SMALL-NEXT: _objc_msgSend$length:53# SMALL-NEXT: adrp x1, 8 ; 0x10000800054# SMALL-NEXT: ldr x1, [x1, #0x20]55# SMALL-NEXT: b56 57# SMALLALIGN: sectname __objc_stubs58# SMALLALIGN-NEXT: segname __TEXT59# SMALLALIGN-NEXT: addr60# SMALLALIGN-NEXT: size61# SMALLALIGN-NEXT: offset62# SMALLALIGN-NEXT: align 2^2 (4)63 64## Check correct section ordering65# SECTIONS: Sections:66# SECTIONS: __text67# SECTIONS: __stubs68# SECTIONS: __objc_stubs69 70.section __TEXT,__objc_methname,cstring_literals71lselref1:72 .asciz "foo"73lselref2:74 .asciz "bar"75 76.section __DATA,__objc_selrefs,literal_pointers,no_dead_strip77.p2align 378.quad lselref179.quad lselref280 81.text82.globl _objc_msgSend83_objc_msgSend:84 ret85 86.globl _main87_main:88 bl _objc_msgSend$length89 bl _objc_msgSend$foo90 bl _objc_msgSend$foo91 bl _external_func92 ret93