Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lld / test / MachO / loh-parsing.s
blobaad1af359fe1988c4e66aa7c32a374132c241498
1 # REQUIRES: aarch64
3 # RUN: llvm-mc -filetype=obj -triple=arm64-apple-darwin %s -o %t.o
4 # RUN: %lld -arch arm64 -dylib %t.o -o /dev/null
6 ## Check that we parse the LOH & match it to its referent sections correctly,
7 ## even when there are other subsections that don't get parsed as regular
8 ## sections. (We would previously segfault.)
9 ## __debug_info is one such section that gets special-case handling.
11 .text
12 _foo:
14 .section __DWARF,__debug_info,regular,debug
16 ## __StaticInit occurs after __debug_info in the input object file, so the
17 ## LOH-matching code will have to "walk" past __debug_info while searching for
18 ## __StaticInit. Thus this verifies that we can skip past __debug_info
19 ## correctly.
20 .section __TEXT,__StaticInit
21 L1: adrp x1, _foo@PAGE
22 L2: ldr x1, [x1, _foo@PAGEOFF]
24 .loh AdrpLdr L1, L2