1# REQUIRES: aarch64 2 3# RUN: llvm-mc -filetype=obj -triple=arm64-apple-darwin %s -o %t.o 4# RUN: %lld -arch arm64 -lSystem -fixup_chains -o %t.out %t.o 5# RUN: llvm-otool -vs __TEXT __objc_stubs %t.out | FileCheck %s --check-prefix=CHECK --check-prefix=FIRST 6 7# Prepend a dummy entry to check if the address for _objc_msgSend is valid. 8# RUN: %lld -arch arm64 -lSystem -fixup_chains -e _dummy -U _dummy -o %t.out %t.o 9# RUN: llvm-otool -vs __TEXT __objc_stubs %t.out | FileCheck %s --check-prefix=CHECK --check-prefix=SECOND 10 11# CHECK: Contents of (__TEXT,__objc_stubs) section 12 13# CHECK-NEXT: _objc_msgSend$foo: 14# CHECK-NEXT: adrp x1, 8 ; 0x100008000 15# CHECK-NEXT: ldr x1, [x1] 16# CHECK-NEXT: adrp x16, 4 ; 0x100004000 17# FIRST-NEXT: ldr x16, [x16] 18# SECOND-NEXT:ldr x16, [x16, #0x8] 19# CHECK-NEXT: br x16 20# CHECK-NEXT: brk #0x1 21# CHECK-NEXT: brk #0x1 22# CHECK-NEXT: brk #0x1 23 24# CHECK-EMPTY: 25 26.text 27.globl _objc_msgSend 28_objc_msgSend: 29 ret 30 31.globl _main 32_main: 33 bl _objc_msgSend$foo 34 ret 35