3 # RUN: llvm-mc -filetype=obj -triple=arm64-apple-darwin %s -o %t.o
4 # RUN: %lld -arch arm64 -lSystem -o %t.out %t.o
5 # RUN: llvm-otool -vs __TEXT __objc_stubs %t.out | FileCheck %s
6 # RUN: %lld -arch arm64 -lSystem -o %t.out %t.o -dead_strip
7 # RUN: llvm-otool -vs __TEXT __objc_stubs %t.out | FileCheck %s
8 # RUN: %lld -arch arm64 -lSystem -o %t.out %t.o -objc_stubs_fast
9 # RUN: llvm-otool -vs __TEXT __objc_stubs %t.out | FileCheck %s
10 # RUN: %no-fatal-warnings-lld -arch arm64 -lSystem -o %t.out %t.o -objc_stubs_small 2>&1 | FileCheck %s --check-prefix=WARNING
11 # RUN: llvm-otool -vs __TEXT __objc_stubs %t.out | FileCheck %s
13 # WARNING: warning: -objc_stubs_small is not yet implemented, defaulting to -objc_stubs_fast
15 # CHECK: Contents of (__TEXT,__objc_stubs) section
17 # CHECK-NEXT: _objc_msgSend$foo:
18 # CHECK-NEXT: adrp x1, 8 ; 0x100008000
19 # CHECK-NEXT: ldr x1, [x1, #0x10]
20 # CHECK-NEXT: adrp x16, 4 ; 0x100004000
21 # CHECK-NEXT: ldr x16, [x16]
23 # CHECK-NEXT: brk #0x1
24 # CHECK-NEXT: brk #0x1
25 # CHECK-NEXT: brk #0x1
27 # CHECK-NEXT: _objc_msgSend$length:
28 # CHECK-NEXT: adrp x1, 8 ; 0x100008000
29 # CHECK-NEXT: ldr x1, [x1, #0x18]
30 # CHECK-NEXT: adrp x16, 4 ; 0x100004000
31 # CHECK-NEXT: ldr x16, [x16]
33 # CHECK-NEXT: brk #0x1
34 # CHECK-NEXT: brk #0x1
35 # CHECK-NEXT: brk #0x1
39 .section __TEXT,__objc_methname,cstring_literals
45 .section __DATA,__objc_selrefs,literal_pointers,no_dead_strip
57 bl _objc_msgSend$length