Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lld / test / MachO / invalid / arm64-unaligned-load.s
blob60e89f3447525a41feb05b58fe1f9af59fca653d
1 # REQUIRES: aarch64
2 # RUN: llvm-mc -filetype=obj -triple=arm64-apple-darwin %s -o %t.o
3 # RUN: not %lld -arch arm64 %t.o -o %t 2>&1 | FileCheck %s --implicit-check-not=_byte \
4 # RUN: --implicit-check-not=_correct
6 # CHECK-DAG: error: {{.*}}:(symbol _main+0x4): 16-bit LDR/STR to 0x[[#%X,]] (_half) is not 2-byte aligned
7 # CHECK-DAG: error: {{.*}}:(symbol _main+0xc): 32-bit LDR/STR to 0x[[#%X,]] (_word) is not 4-byte aligned
8 # CHECK-DAG: error: {{.*}}:(symbol _main+0x14): 64-bit LDR/STR to 0x[[#%X,]] (_double) is not 8-byte aligned
9 # CHECK-DAG: error: {{.*}}:(symbol _main+0x1c): 128-bit LDR/STR to 0x[[#%X,]] (_quad) is not 16-byte aligned
11 .globl _main
12 _main:
13 adrp x0, _half@PAGE
14 ldrh w0, [x0, _half@PAGEOFF]
16 adrp x1, _word@PAGE
17 ldr w1, [x1, _word@PAGEOFF]
19 adrp x2, _double@PAGE
20 ldr x2, [x2, _double@PAGEOFF]
22 adrp x3, _quad@PAGE
23 ldr q0, [x3, _quad@PAGEOFF]
25 adrp x4, _byte@PAGE
26 ldrb w4, [x4, _byte@PAGEOFF]
28 adrp x5, _correct@PAGE
29 ldr x5, [x5, _correct@PAGEOFF]
31 .data
32 .p2align 4
33 _correct:
34 .8byte 0
35 .byte 0
36 _half:
37 .2byte 0
38 _word:
39 .4byte 0
40 _double:
41 .8byte 0
42 _quad:
43 .8byte 0
44 .8byte 0
45 _byte:
46 .byte 0