1// Test that calls to Objective-C methods in other files work.
2//
3// RUN: %clang -c -o %t.o %s
4// RUN: %clang -c -o %t.aux.o %S/Inputs/objc-Foo-foo-class-method.S
5// RUN: %llvm_jitlink -preload libobjc.A.dylib %t.o %t.aux.o
6//
7// REQUIRES: jit-compatible-osx-swift-runtime
8
9 .section __TEXT,__text,regular,pure_instructions
10 .build_version macos, 14, 0 sdk_version 14, 0
11 .globl _main
12 .p2align 2
13_main:
14 adrp x8, _OBJC_CLASSLIST_REFERENCES_$_@PAGE
15 ldr x0, [x8, _OBJC_CLASSLIST_REFERENCES_$_@PAGEOFF]
16 adrp x8, _OBJC_SELECTOR_REFERENCES_@PAGE
17 ldr x1, [x8, _OBJC_SELECTOR_REFERENCES_@PAGEOFF]
18 b _objc_msgSend
19
20 .section __DATA,__objc_classrefs,regular,no_dead_strip
21 .p2align 3, 0x0
22_OBJC_CLASSLIST_REFERENCES_$_:
23 .quad _OBJC_CLASS_$_Foo
24
25 .section __TEXT,__objc_methname,cstring_literals
26l_OBJC_METH_VAR_NAME_:
27 .asciz "foo"
28
29 .section __DATA,__objc_selrefs,literal_pointers,no_dead_strip
30 .p2align 3, 0x0
31_OBJC_SELECTOR_REFERENCES_:
32 .quad l_OBJC_METH_VAR_NAME_
33
34 .section __DATA,__objc_imageinfo,regular,no_dead_strip
35L_OBJC_IMAGE_INFO:
36 .long 0
37 .long 64
38
39.subsections_via_symbols
40

source code of compiler-rt/test/orc/TestCases/Darwin/arm64/objc-cross-file-method-call.S