[docs] Fix build-docs.sh
[llvm-project.git] / compiler-rt / test / orc / TestCases / Darwin / arm64 / trivial-objc-methods.S
blob1a0718c0b822c4a8258f3a0ab3d67ca10d9570cf
1 // RUN: %clang -c -o %t %s
2 // RUN: %llvm_jitlink -preload libobjc.A.dylib %t
3 //
4 // Test that Objective-C class and instance methods work.
6         .section        __TEXT,__text,regular,pure_instructions
7         .build_version macos, 12, 0     sdk_version 12, 0
8         .p2align        2                               ; -- Begin function +[ZeroGen classZero]
9 "+[ZeroGen classZero]":                 ; @"\01+[ZeroGen classZero]"
10         .cfi_startproc
11 ; %bb.0:
12         sub     sp, sp, #16                     ; =16
13         .cfi_def_cfa_offset 16
14         str     x0, [sp, #8]
15         str     x1, [sp]
16         mov     w0, #0
17         add     sp, sp, #16                     ; =16
18         ret
19         .cfi_endproc
20                                         ; -- End function
21         .p2align        2                               ; -- Begin function -[ZeroGen objZero]
22 "-[ZeroGen objZero]":                   ; @"\01-[ZeroGen objZero]"
23         .cfi_startproc
24 ; %bb.0:
25         sub     sp, sp, #16                     ; =16
26         .cfi_def_cfa_offset 16
27         str     x0, [sp, #8]
28         str     x1, [sp]
29         mov     w0, #0
30         add     sp, sp, #16                     ; =16
31         ret
32         .cfi_endproc
33                                         ; -- End function
34         .globl  _main                           ; -- Begin function main
35         .p2align        2
36 _main:                                  ; @main
37         .cfi_startproc
38 ; %bb.0:
39         sub     sp, sp, #48                     ; =48
40         stp     x29, x30, [sp, #32]             ; 16-byte Folded Spill
41         add     x29, sp, #32                    ; =32
42         .cfi_def_cfa w29, 16
43         .cfi_offset w30, -8
44         .cfi_offset w29, -16
45         stur    wzr, [x29, #-4]
46         adrp    x8, _OBJC_CLASSLIST_REFERENCES_$_@PAGE
47         str     x8, [sp, #8]                    ; 8-byte Folded Spill
48         ldr     x0, [x8, _OBJC_CLASSLIST_REFERENCES_$_@PAGEOFF]
49         bl      _objc_alloc_init
50         ldr     x8, [sp, #8]                    ; 8-byte Folded Reload
51         str     x0, [sp, #16]
52         ldr     x0, [x8, _OBJC_CLASSLIST_REFERENCES_$_@PAGEOFF]
53         adrp    x8, _OBJC_SELECTOR_REFERENCES_@PAGE
54         ldr     x1, [x8, _OBJC_SELECTOR_REFERENCES_@PAGEOFF]
55         bl      _objc_msgSend
56         cbz     w0, LBB2_2
57 ; %bb.1:
58         mov     w8, #1
59         stur    w8, [x29, #-4]
60         b       LBB2_5
61 LBB2_2:
62         ldr     x0, [sp, #16]
63         adrp    x8, _OBJC_SELECTOR_REFERENCES_.2@PAGE
64         ldr     x1, [x8, _OBJC_SELECTOR_REFERENCES_.2@PAGEOFF]
65         bl      _objc_msgSend
66         cbz     w0, LBB2_4
67 ; %bb.3:
68         mov     w8, #1
69         stur    w8, [x29, #-4]
70         b       LBB2_5
71 LBB2_4:
72         stur    wzr, [x29, #-4]
73 LBB2_5:
74         ldur    w0, [x29, #-4]
75         ldp     x29, x30, [sp, #32]             ; 16-byte Folded Reload
76         add     sp, sp, #48                     ; =48
77         ret
78         .cfi_endproc
79                                         ; -- End function
80         .section        __TEXT,__objc_classname,cstring_literals
81 l_OBJC_CLASS_NAME_:                     ; @OBJC_CLASS_NAME_
82         .asciz  "ZeroGen"
84         .section        __TEXT,__objc_methname,cstring_literals
85 l_OBJC_METH_VAR_NAME_:                  ; @OBJC_METH_VAR_NAME_
86         .asciz  "classZero"
88         .section        __TEXT,__objc_methtype,cstring_literals
89 l_OBJC_METH_VAR_TYPE_:                  ; @OBJC_METH_VAR_TYPE_
90         .asciz  "i16@0:8"
92         .section        __DATA,__objc_const
93         .p2align        3                               ; @"_OBJC_$_CLASS_METHODS_ZeroGen"
94 __OBJC_$_CLASS_METHODS_ZeroGen:
95         .long   24                              ; 0x18
96         .long   1                               ; 0x1
97         .quad   l_OBJC_METH_VAR_NAME_
98         .quad   l_OBJC_METH_VAR_TYPE_
99         .quad   "+[ZeroGen classZero]"
101         .p2align        3                               ; @"_OBJC_METACLASS_RO_$_ZeroGen"
102 __OBJC_METACLASS_RO_$_ZeroGen:
103         .long   1                               ; 0x1
104         .long   40                              ; 0x28
105         .long   40                              ; 0x28
106         .space  4
107         .quad   0
108         .quad   l_OBJC_CLASS_NAME_
109         .quad   __OBJC_$_CLASS_METHODS_ZeroGen
110         .quad   0
111         .quad   0
112         .quad   0
113         .quad   0
115         .section        __DATA,__objc_data
116         .globl  _OBJC_METACLASS_$_ZeroGen       ; @"OBJC_METACLASS_$_ZeroGen"
117         .p2align        3
118 _OBJC_METACLASS_$_ZeroGen:
119         .quad   _OBJC_METACLASS_$_NSObject
120         .quad   _OBJC_METACLASS_$_NSObject
121         .quad   __objc_empty_cache
122         .quad   0
123         .quad   __OBJC_METACLASS_RO_$_ZeroGen
125         .section        __TEXT,__objc_methname,cstring_literals
126 l_OBJC_METH_VAR_NAME_.1:                ; @OBJC_METH_VAR_NAME_.1
127         .asciz  "objZero"
129         .section        __DATA,__objc_const
130         .p2align        3                               ; @"_OBJC_$_INSTANCE_METHODS_ZeroGen"
131 __OBJC_$_INSTANCE_METHODS_ZeroGen:
132         .long   24                              ; 0x18
133         .long   1                               ; 0x1
134         .quad   l_OBJC_METH_VAR_NAME_.1
135         .quad   l_OBJC_METH_VAR_TYPE_
136         .quad   "-[ZeroGen objZero]"
138         .p2align        3                               ; @"_OBJC_CLASS_RO_$_ZeroGen"
139 __OBJC_CLASS_RO_$_ZeroGen:
140         .long   0                               ; 0x0
141         .long   8                               ; 0x8
142         .long   8                               ; 0x8
143         .space  4
144         .quad   0
145         .quad   l_OBJC_CLASS_NAME_
146         .quad   __OBJC_$_INSTANCE_METHODS_ZeroGen
147         .quad   0
148         .quad   0
149         .quad   0
150         .quad   0
152         .section        __DATA,__objc_data
153         .globl  _OBJC_CLASS_$_ZeroGen           ; @"OBJC_CLASS_$_ZeroGen"
154         .p2align        3
155 _OBJC_CLASS_$_ZeroGen:
156         .quad   _OBJC_METACLASS_$_ZeroGen
157         .quad   _OBJC_CLASS_$_NSObject
158         .quad   __objc_empty_cache
159         .quad   0
160         .quad   __OBJC_CLASS_RO_$_ZeroGen
162         .section        __DATA,__objc_classrefs,regular,no_dead_strip
163         .p2align        3                               ; @"OBJC_CLASSLIST_REFERENCES_$_"
164 _OBJC_CLASSLIST_REFERENCES_$_:
165         .quad   _OBJC_CLASS_$_ZeroGen
167         .section        __DATA,__objc_selrefs,literal_pointers,no_dead_strip
168         .p2align        3                               ; @OBJC_SELECTOR_REFERENCES_
169 _OBJC_SELECTOR_REFERENCES_:
170         .quad   l_OBJC_METH_VAR_NAME_
172         .p2align        3                               ; @OBJC_SELECTOR_REFERENCES_.2
173 _OBJC_SELECTOR_REFERENCES_.2:
174         .quad   l_OBJC_METH_VAR_NAME_.1
176         .section        __DATA,__objc_classlist,regular,no_dead_strip
177         .p2align        3                               ; @"OBJC_LABEL_CLASS_$"
178 l_OBJC_LABEL_CLASS_$:
179         .quad   _OBJC_CLASS_$_ZeroGen
181         .section        __DATA,__objc_imageinfo,regular,no_dead_strip
182 L_OBJC_IMAGE_INFO:
183         .long   0
184         .long   64
186 .subsections_via_symbols