Open esky-software opened 2 years ago
@llvm/issue-subscribers-backend-arm
From the manual, A8.8.12 ADR
:
ADR{<c>}{<q>} <Rd>, <label> Normal syntax
So this should be allowed, gcc does allow both styles. We do allow using the label directly if you are thumb2 (armv7-M) and I don't see a reason in the manual to not extend that to armv6-m. (https://godbolt.org/z/fGMYT537a)
When using clang (LLVM 14.0.0) to process assembler for armv6-m, the instruction 'adr Rn,, expr' is only accepted if expr is a label. An expression is not accepted. However if expr is a .equ it is accepted, even if the .equ is defined by an exression
e.g. Not accepted: adr Rn, lbl+4
e,g, Accepted: .equ lbl_plus_4, lbl+4 adr Rn, lbl_plus_4