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
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
11 # CHECK: Contents of (__TEXT,__objc_stubs) section
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]
20 # CHECK-NEXT: brk #0x1
21 # CHECK-NEXT: brk #0x1
22 # CHECK-NEXT: brk #0x1