Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lld / test / MachO / loh-adrp-ldr-got.s
blob5363a1167770424f661a537528f7a9de99502f0d
1 # REQUIRES: aarch64
3 # RUN: rm -rf %t; split-file %s %t
4 # RUN: llvm-mc -filetype=obj -triple=arm64-apple-darwin %t/obj.s -o %t/obj.o
5 # RUN: llvm-mc -filetype=obj -triple=arm64-apple-darwin %t/dylib.s -o %t/dylib.o
6 # RUN: %lld -arch arm64 -dylib -o %t/libdylib.dylib %t/dylib.o
7 # RUN: %lld -arch arm64 %t/obj.o %t/libdylib.dylib -o %t/AdrpLdrGot
8 # RUN: llvm-objdump -d --macho %t/AdrpLdrGot | FileCheck %s
10 #--- obj.s
11 .text
12 .globl _main
13 # CHECK-LABEL: _main:
14 _main:
15 ## The referenced symbol is local
16 L1: adrp x0, _local@GOTPAGE
17 L2: ldr x0, [x0, _local@GOTPAGEOFF]
18 # CHECK-NEXT: adr x0
19 # CHECK-NEXT: nop
21 ## The referenced symbol is in a dylib
22 L3: adrp x1, _external@GOTPAGE
23 L4: ldr x1, [x1, _external@GOTPAGEOFF]
24 # CHECK-NEXT: nop
25 # CHECK-NEXT: ldr x1
27 _local:
28 nop
30 .loh AdrpLdrGot L1, L2
31 .loh AdrpLdrGot L3, L4
33 #--- dylib.s
34 .globl _external
35 _external: