[ARM] Better OR's for MVE compares
[llvm-core.git] / test / MC / AArch64 / coff-relocations.s
blob965955809dab3f6c39bc1c4348afd6234f4fa4ee
1 ; RUN: llvm-mc -triple aarch64-windows -filetype obj -o %t.obj %s
2 ; RUN: llvm-readobj -r %t.obj | FileCheck %s
3 ; RUN: llvm-objdump -d %t.obj | FileCheck %s -check-prefix DISASM
5 ; IMAGE_REL_ARM64_ADDR32
6 .Linfo_foo:
7 .asciz "foo"
8 .long foo
10 ; IMAGE_REL_ARM64_ADDR32NB
11 .long func@IMGREL
13 ; IMAGE_REL_ARM64_ADDR64
14 .globl struc
15 struc:
16 .quad arr
18 ; IMAGE_REL_ARM64_BRANCH26
19 b target
21 ; IMAGE_REL_ARM64_PAGEBASE_REL21
22 adrp x0, foo
24 ; IMAGE_REL_ARM64_PAGEOFFSET_12A
25 add x0, x0, :lo12:foo
27 ; IMAGE_REL_ARM64_PAGEOFFSET_12L
28 ldr x0, [x0, :lo12:foo]
30 ; IMAGE_REL_ARM64_PAGEBASE_REL21, even if the symbol offset is known
31 adrp x0, bar
32 bar:
34 ; IMAGE_REL_ARM64_SECREL
35 .secrel32 .Linfo_bar
36 .Linfo_bar:
38 ; IMAGE_REL_ARM64_SECTION
39 .secidx func
41 .align 2
42 adrp x0, baz + 0x12345
43 baz:
44 add x0, x0, :lo12:foo + 0x12345
45 ldrb w0, [x0, :lo12:foo + 0x12345]
46 ldr x0, [x0, :lo12:foo + 0x12348]
48 ; IMAGE_REL_ARM64_SECREL_LOW12A
49 add x0, x0, :secrel_lo12:foo
50 ; IMAGE_REL_ARM64_SECREL_HIGH12A
51 add x0, x0, :secrel_hi12:foo
52 ; IMAGE_REL_ARM64_SECREL_LOW12L
53 ldr x0, [x0, :secrel_lo12:foo]
55 ; IMAGE_REL_ARM64_REL21
56 adr x0, foo + 0x12345
58 ; IMAGE_REL_ARM64_BRANCH19
59 bne target
61 ; IMAGE_REL_ARM64_BRANCH14
62 tbz x0, #0, target
64 ; CHECK: Format: COFF-ARM64
65 ; CHECK: Arch: aarch64
66 ; CHECK: AddressSize: 64bit
67 ; CHECK: Relocations [
68 ; CHECK: Section (1) .text {
69 ; CHECK: 0x4 IMAGE_REL_ARM64_ADDR32 foo
70 ; CHECK: 0x8 IMAGE_REL_ARM64_ADDR32NB func
71 ; CHECK: 0xC IMAGE_REL_ARM64_ADDR64 arr
72 ; CHECK: 0x14 IMAGE_REL_ARM64_BRANCH26 target
73 ; CHECK: 0x18 IMAGE_REL_ARM64_PAGEBASE_REL21 foo
74 ; CHECK: 0x1C IMAGE_REL_ARM64_PAGEOFFSET_12A foo
75 ; CHECK: 0x20 IMAGE_REL_ARM64_PAGEOFFSET_12L foo
76 ; CHECK: 0x24 IMAGE_REL_ARM64_PAGEBASE_REL21 bar
77 ; CHECK: 0x28 IMAGE_REL_ARM64_SECREL .text
78 ; CHECK: 0x2C IMAGE_REL_ARM64_SECTION func
79 ; CHECK: 0x30 IMAGE_REL_ARM64_PAGEBASE_REL21 baz
80 ; CHECK: 0x34 IMAGE_REL_ARM64_PAGEOFFSET_12A foo
81 ; CHECK: 0x38 IMAGE_REL_ARM64_PAGEOFFSET_12L foo
82 ; CHECK: 0x3C IMAGE_REL_ARM64_PAGEOFFSET_12L foo
83 ; CHECK: 0x40 IMAGE_REL_ARM64_SECREL_LOW12A foo
84 ; CHECK: 0x44 IMAGE_REL_ARM64_SECREL_HIGH12A foo
85 ; CHECK: 0x48 IMAGE_REL_ARM64_SECREL_LOW12L foo
86 ; CHECK: 0x4C IMAGE_REL_ARM64_REL21 foo
87 ; CHECK: 0x50 IMAGE_REL_ARM64_BRANCH19 target
88 ; CHECK: 0x54 IMAGE_REL_ARM64_BRANCH14 target
89 ; CHECK: }
90 ; CHECK: ]
92 ; DISASM: 30: 20 1a 09 b0 adrp x0, #305418240
93 ; DISASM: 34: 00 14 0d 91 add x0, x0, #837
94 ; DISASM: 38: 00 14 4d 39 ldrb w0, [x0, #837]
95 ; DISASM: 3c: 00 a4 41 f9 ldr x0, [x0, #840]
96 ; DISASM: 40: 00 00 00 91 add x0, x0, #0
97 ; DISASM: 44: 00 00 40 91 add x0, x0, #0, lsl #12
98 ; DISASM: 48: 00 00 40 f9 ldr x0, [x0]
99 ; DISASM: 4c: 20 1a 09 30 adr x0, #74565