xref: /llvm-project/llvm/test/tools/llvm-objdump/ELF/ARM/literal-vldr-thumb2.s (revision a657440bc695a98c54cd95bb7cc4cec5ab811d17)
1@@ Check that PC-relative memory addressing is annotated
2
3@ RUN: llvm-mc %s -triple=thumbv8a --mattr=+fullfp16 -filetype=obj | \
4@ RUN:   llvm-objdump -d --no-show-raw-insn --triple=thumbv8a --mattr=+fullfp16 - | \
5@ RUN:   FileCheck %s
6
7.text
8foo:
9@ CHECK:      00000000 <foo>:
10  .short 0x0102
11foo2:
12@ CHECK:      00000002 <foo2>:
13  .short 0x0304
14
15_start:
16@@ Check AddrMode5 instructions, with positive and negative immediates
17  .balign 4
18  vldr d0, foo
19  vldr s0, bar
20@ CHECK:         4: vldr      d0, [pc, #-8]           @ 0x0 <foo>
21@ CHECK-NEXT:    8: vldr      s0, [pc, #56]           @ 0x44 <bar>
22
23@@ Same instructions, but the addresses are not 4-byte aligned
24  nop
25  vldr d0, foo
26  vldr s0, bar
27@ CHECK:          e: vldr     d0, [pc, #-16]          @ 0x0 <foo>
28@ CHECK-NEXT:    12: vldr     s0, [pc, #48]           @ 0x44 <bar>
29
30@@ Check that AddrMode5 instructions which do not use PC-relative addressing are not annotated
31  vldr d0, [r1, #8]
32@ CHECK:         16: vldr     d0, [r1, #8]{{$}}
33
34@@ Check AddrMode5FP16 instructions, with positive and negative immediates
35  .balign 4
36  vldr.16 s0, foo
37  vldr.16 s0, foo2
38  vldr.16 s1, bar
39  vldr.16 s1, bar2
40@ CHECK:         1c: vldr.16  s0, [pc, #-32]          @ 0x0 <foo>
41@ CHECK-NEXT:    20: vldr.16  s0, [pc, #-34]          @ 0x2 <foo2>
42@ CHECK-NEXT:    24: vldr.16  s1, [pc, #28]           @ 0x44 <bar>
43@ CHECK-NEXT:    28: vldr.16  s1, [pc, #26]           @ 0x46 <bar2>
44
45@@ Same instructions, but the addresses are not 4-byte aligned
46  nop
47  vldr.16 s0, foo
48  vldr.16 s0, foo2
49  vldr.16 s1, bar
50  vldr.16 s1, bar2
51@ CHECK:         2e: vldr.16  s0, [pc, #-48]          @ 0x0 <foo>
52@ CHECK-NEXT:    32: vldr.16  s0, [pc, #-50]          @ 0x2 <foo2>
53@ CHECK-NEXT:    36: vldr.16  s1, [pc, #12]           @ 0x44 <bar>
54@ CHECK-NEXT:    3a: vldr.16  s1, [pc, #10]           @ 0x46 <bar2>
55
56@@ Check that AddrMode5FP16 instructions which do not use PC-relative addressing are not annotated
57  vldr.16 s0, [r1, #8]
58@ CHECK:         3e: vldr.16  s0, [r1, #8]{{$}}
59
60  .balign 4
61bar:
62@ CHECK:      00000044 <bar>:
63  .short 0x0102
64bar2:
65@ CHECK:      00000046 <bar2>:
66  .short 0x0304
67