[libc] Switch to using the generic `<gpuintrin.h>` implementations (#121810)
[llvm-project.git] / lld / test / MachO / loh-adrp-add.s
blob6026be8d462dc6bc78282baee81cbf764ad3f554
1 # REQUIRES: aarch64
3 # RUN: llvm-mc -filetype=obj -triple=arm64-apple-darwin %s -o %t.o
4 # RUN: %lld -arch arm64 %t.o -o %t
5 # RUN: llvm-objdump -d --macho %t | FileCheck %s
7 # CHECK-LABEL: _main:
8 ## Out of range, before
9 # CHECK-NEXT: adrp x0
10 # CHECK-NEXT: add x0, x0
11 ## In range, before
12 # CHECK-NEXT: adr x1
13 # CHECK-NEXT: nop
14 ## Registers don't match (invalid input)
15 # CHECK-NEXT: adrp x2
16 # CHECK-NEXT: add x0
17 ## Not an adrp instruction (invalid input)
18 # CHECK-NEXT: nop
19 # CHECK-NEXT: add x4
20 ## In range, after
21 # CHECK-NEXT: adr x5
22 # CHECK-NEXT: nop
23 ## In range, add's destination register is not the same as its source
24 # CHECK-NEXT: adr x7
25 # CHECK-NEXT: nop
26 ## Valid, non-adjacent instructions - start
27 # CHECK-NEXT: adr x8
28 ## Out of range, after
29 # CHECK-NEXT: adrp x9
30 # CHECK-NEXT: add x9, x9
31 ## Valid, non-adjacent instructions - end
32 # CHECK-NEXT: nop
34 .text
35 .align 2
36 _before_far:
37 .space 1048576
39 _before_near:
40 nop
42 .globl _main
43 _main:
44 L1:
45 adrp x0, _before_far@PAGE
46 L2:
47 add x0, x0, _before_far@PAGEOFF
48 L3:
49 adrp x1, _before_near@PAGE
50 L4:
51 add x1, x1, _before_near@PAGEOFF
52 L5:
53 adrp x2, _before_near@PAGE
54 L6:
55 add x0, x0, _before_near@PAGEOFF
56 L9:
57 nop
58 L10:
59 add x4, x4, _after_near@PAGEOFF
60 L11:
61 adrp x5, _after_near@PAGE
62 L12:
63 add x5, x5, _after_near@PAGEOFF
64 L13:
65 adrp x6, _after_near@PAGE
66 L14:
67 add x7, x6, _after_near@PAGEOFF
68 L15:
69 adrp x8, _after_near@PAGE
70 L16:
71 adrp x9, _after_far@PAGE
72 L17:
73 add x9, x9, _after_far@PAGEOFF
74 L18:
75 add x8, x8, _after_near@PAGEOFF
77 _after_near:
78 .space 1048576
80 _after_far:
81 nop
83 .loh AdrpAdd L1, L2
84 .loh AdrpAdd L3, L4
85 .loh AdrpAdd L5, L6
86 .loh AdrpAdd L9, L10
87 .loh AdrpAdd L11, L12
88 .loh AdrpAdd L13, L14
89 .loh AdrpAdd L15, L18
90 .loh AdrpAdd L16, L17