These operands are illegal and rejected by avr-gcc.
subi r24, -lo8(symobl+offset)
sbci r25, -hi8(symobl+offset)
And their correct form should be
subi r24, lo8(-(symobl+offset))
sbci r25, hi8(-(symobl+offset))
Reviewed By: aykevl
Differential Revision: https://reviews.llvm.org/D140473
SMLoc S = Parser.getTok().getLoc();
- // Check for sign
- AsmToken tokens[2];
- size_t ReadCount = Parser.getLexer().peekTokens(tokens);
-
- if (ReadCount == 2) {
- if ((tokens[0].getKind() == AsmToken::Identifier &&
- tokens[1].getKind() == AsmToken::LParen) ||
- (tokens[0].getKind() == AsmToken::LParen &&
- tokens[1].getKind() == AsmToken::Minus)) {
+ // Reject the form in which sign comes first. This behaviour is
+ // in accordance with avr-gcc.
+ AsmToken::TokenKind CurTok = Parser.getLexer().getKind();
+ if (CurTok == AsmToken::Minus || CurTok == AsmToken::Plus)
+ return true;
- AsmToken::TokenKind CurTok = Parser.getLexer().getKind();
- if (CurTok == AsmToken::Minus || tokens[1].getKind() == AsmToken::Minus) {
+ // Check for sign.
+ AsmToken tokens[2];
+ if (Parser.getLexer().peekTokens(tokens) == 2)
+ if (tokens[0].getKind() == AsmToken::LParen &&
+ tokens[1].getKind() == AsmToken::Minus)
isNegated = true;
- } else {
- assert(CurTok == AsmToken::Plus);
- isNegated = false;
- }
-
- // Eat the sign
- if (CurTok == AsmToken::Minus || CurTok == AsmToken::Plus)
- Parser.Lex();
- }
- }
// Check if we have a target specific modifier (lo8, hi8, &c)
- if (Parser.getTok().getKind() != AsmToken::Identifier ||
+ if (CurTok != AsmToken::Identifier ||
Parser.getLexer().peekTok().getKind() != AsmToken::LParen) {
// Not a reloc expr
return true;
void AVRMCExpr::printImpl(raw_ostream &OS, const MCAsmInfo *MAI) const {
assert(Kind != VK_AVR_None);
-
- if (isNegated())
- OS << '-';
-
OS << getName() << '(';
+ if (isNegated())
+ OS << '-' << '(';
getSubExpr()->print(OS, MAI);
+ if (isNegated())
+ OS << ')';
OS << ')';
}
; CHECK: ; %bb.0: ; %entry
; CHECK-NEXT: lsl r22
; CHECK-NEXT: rol r23
-; CHECK-NEXT: subi r22, -lo8(arr0)
-; CHECK-NEXT: sbci r23, -hi8(arr0)
+; CHECK-NEXT: subi r22, lo8(-(arr0))
+; CHECK-NEXT: sbci r23, hi8(-(arr0))
; CHECK-NEXT: movw r30, r22
; CHECK-NEXT: lpm r18, Z+
; CHECK-NEXT: lpm r19, Z
; CHECK-NEXT: lsl r24
; CHECK-NEXT: rol r25
-; CHECK-NEXT: subi r24, -lo8(arr0)
-; CHECK-NEXT: sbci r25, -hi8(arr0)
+; CHECK-NEXT: subi r24, lo8(-(arr0))
+; CHECK-NEXT: sbci r25, hi8(-(arr0))
; CHECK-NEXT: movw r30, r24
; CHECK-NEXT: lpm r24, Z+
; CHECK-NEXT: lpm r25, Z
; CHECK: ; %bb.0: ; %entry
; CHECK-NEXT: lsl r22
; CHECK-NEXT: rol r23
-; CHECK-NEXT: subi r22, -lo8(arr1)
-; CHECK-NEXT: sbci r23, -hi8(arr1)
+; CHECK-NEXT: subi r22, lo8(-(arr1))
+; CHECK-NEXT: sbci r23, hi8(-(arr1))
; CHECK-NEXT: movw r30, r22
; CHECK-NEXT: ldi r18, 1
; CHECK-NEXT: out 59, r18
; CHECK-NEXT: elpm r21, Z
; CHECK-NEXT: lsl r24
; CHECK-NEXT: rol r25
-; CHECK-NEXT: subi r24, -lo8(arr0)
-; CHECK-NEXT: sbci r25, -hi8(arr0)
+; CHECK-NEXT: subi r24, lo8(-(arr0))
+; CHECK-NEXT: sbci r25, hi8(-(arr0))
; CHECK-NEXT: movw r30, r24
; CHECK-NEXT: lpm r24, Z+
; CHECK-NEXT: lpm r25, Z
; CHECK: ; %bb.0: ; %entry
; CHECK-NEXT: lsl r24
; CHECK-NEXT: rol r25
-; CHECK-NEXT: subi r24, -lo8(arr2)
-; CHECK-NEXT: sbci r25, -hi8(arr2)
+; CHECK-NEXT: subi r24, lo8(-(arr2))
+; CHECK-NEXT: sbci r25, hi8(-(arr2))
; CHECK-NEXT: movw r30, r24
; CHECK-NEXT: ldi r18, 2
; CHECK-NEXT: out 59, r18
; CHECK-NEXT: elpm r25, Z
; CHECK-NEXT: lsl r22
; CHECK-NEXT: rol r23
-; CHECK-NEXT: subi r22, -lo8(arr0)
-; CHECK-NEXT: sbci r23, -hi8(arr0)
+; CHECK-NEXT: subi r22, lo8(-(arr0))
+; CHECK-NEXT: sbci r23, hi8(-(arr0))
; CHECK-NEXT: movw r30, r22
; CHECK-NEXT: lpm r18, Z+
; CHECK-NEXT: lpm r19, Z
; CHECK: ; %bb.0: ; %entry
; CHECK-NEXT: lsl r22
; CHECK-NEXT: rol r23
-; CHECK-NEXT: subi r22, -lo8(arr1)
-; CHECK-NEXT: sbci r23, -hi8(arr1)
+; CHECK-NEXT: subi r22, lo8(-(arr1))
+; CHECK-NEXT: sbci r23, hi8(-(arr1))
; CHECK-NEXT: movw r30, r22
; CHECK-NEXT: ldi r18, 1
; CHECK-NEXT: out 59, r18
; CHECK-NEXT: elpm r21, Z
; CHECK-NEXT: lsl r24
; CHECK-NEXT: rol r25
-; CHECK-NEXT: subi r24, -lo8(arr2)
-; CHECK-NEXT: sbci r25, -hi8(arr2)
+; CHECK-NEXT: subi r24, lo8(-(arr2))
+; CHECK-NEXT: sbci r25, hi8(-(arr2))
; CHECK-NEXT: movw r30, r24
; CHECK-NEXT: ldi r18, 2
; CHECK-NEXT: out 59, r18
define signext i8 @foob0(i16 %a, i16 %b) {
; CHECK-LABEL: foob0:
; CHECK: ; %bb.0: ; %entry
-; CHECK-NEXT: subi r22, -lo8(arrb1)
-; CHECK-NEXT: sbci r23, -hi8(arrb1)
+; CHECK-NEXT: subi r22, lo8(-(arrb1))
+; CHECK-NEXT: sbci r23, hi8(-(arrb1))
; CHECK-NEXT: movw r30, r22
; CHECK-NEXT: lpm r18, Z
-; CHECK-NEXT: subi r24, -lo8(arrb1)
-; CHECK-NEXT: sbci r25, -hi8(arrb1)
+; CHECK-NEXT: subi r24, lo8(-(arrb1))
+; CHECK-NEXT: sbci r25, hi8(-(arrb1))
; CHECK-NEXT: movw r30, r24
; CHECK-NEXT: lpm r24, Z
; CHECK-NEXT: sub r24, r18
define signext i8 @foob1(i16 %a, i16 %b) {
; CHECK-LABEL: foob1:
; CHECK: ; %bb.0: ; %entry
-; CHECK-NEXT: subi r22, -lo8(arrb3)
-; CHECK-NEXT: sbci r23, -hi8(arrb3)
+; CHECK-NEXT: subi r22, lo8(-(arrb3))
+; CHECK-NEXT: sbci r23, hi8(-(arrb3))
; CHECK-NEXT: movw r30, r22
; CHECK-NEXT: ldi r18, 2
; CHECK-NEXT: out 59, r18
; CHECK-NEXT: elpm r18, Z
-; CHECK-NEXT: subi r24, -lo8(arrb1)
-; CHECK-NEXT: sbci r25, -hi8(arrb1)
+; CHECK-NEXT: subi r24, lo8(-(arrb1))
+; CHECK-NEXT: sbci r25, hi8(-(arrb1))
; CHECK-NEXT: movw r30, r24
; CHECK-NEXT: lpm r24, Z
; CHECK-NEXT: sub r24, r18
define signext i8 @foob2(i16 %a, i16 %b) {
; CHECK-LABEL: foob2:
; CHECK: ; %bb.0: ; %entry
-; CHECK-NEXT: subi r24, -lo8(arrb5)
-; CHECK-NEXT: sbci r25, -hi8(arrb5)
+; CHECK-NEXT: subi r24, lo8(-(arrb5))
+; CHECK-NEXT: sbci r25, hi8(-(arrb5))
; CHECK-NEXT: movw r30, r24
; CHECK-NEXT: ldi r24, 4
; CHECK-NEXT: out 59, r24
; CHECK-NEXT: elpm r24, Z
-; CHECK-NEXT: subi r22, -lo8(arrb1)
-; CHECK-NEXT: sbci r23, -hi8(arrb1)
+; CHECK-NEXT: subi r22, lo8(-(arrb1))
+; CHECK-NEXT: sbci r23, hi8(-(arrb1))
; CHECK-NEXT: movw r30, r22
; CHECK-NEXT: lpm r25, Z
; CHECK-NEXT: sub r24, r25
define signext i8 @foob3(i16 %a, i16 %b) {
; CHECK-LABEL: foob3:
; CHECK: ; %bb.0: ; %entry
-; CHECK-NEXT: subi r22, -lo8(arrb5)
-; CHECK-NEXT: sbci r23, -hi8(arrb5)
+; CHECK-NEXT: subi r22, lo8(-(arrb5))
+; CHECK-NEXT: sbci r23, hi8(-(arrb5))
; CHECK-NEXT: movw r30, r22
; CHECK-NEXT: ldi r18, 4
; CHECK-NEXT: out 59, r18
; CHECK-NEXT: elpm r18, Z
-; CHECK-NEXT: subi r24, -lo8(arrb3)
-; CHECK-NEXT: sbci r25, -hi8(arrb3)
+; CHECK-NEXT: subi r24, lo8(-(arrb3))
+; CHECK-NEXT: sbci r25, hi8(-(arrb3))
; CHECK-NEXT: movw r30, r24
; CHECK-NEXT: ldi r24, 2
; CHECK-NEXT: out 59, r24
define signext i8 @foob4(i16 %a, i16 %b) {
; CHECK-LABEL: foob4:
; CHECK: ; %bb.0: ; %entry
-; CHECK-NEXT: subi r22, -lo8(arrb3)
-; CHECK-NEXT: sbci r23, -hi8(arrb3)
+; CHECK-NEXT: subi r22, lo8(-(arrb3))
+; CHECK-NEXT: sbci r23, hi8(-(arrb3))
; CHECK-NEXT: movw r30, r22
; CHECK-NEXT: ldi r18, 2
; CHECK-NEXT: out 59, r18
; CHECK-NEXT: elpm r19, Z
-; CHECK-NEXT: subi r24, -lo8(arrb3)
-; CHECK-NEXT: sbci r25, -hi8(arrb3)
+; CHECK-NEXT: subi r24, lo8(-(arrb3))
+; CHECK-NEXT: sbci r25, hi8(-(arrb3))
; CHECK-NEXT: movw r30, r24
; CHECK-NEXT: out 59, r18
; CHECK-NEXT: elpm r24, Z
; CHECK-O0-NEXT: ldd r31, Y+2
; CHECK-O0-NEXT: lsl r30
; CHECK-O0-NEXT: rol r31
-; CHECK-O0-NEXT: subi r30, -lo8(arr0)
-; CHECK-O0-NEXT: sbci r31, -hi8(arr0)
+; CHECK-O0-NEXT: subi r30, lo8(-(arr0))
+; CHECK-O0-NEXT: sbci r31, hi8(-(arr0))
; CHECK-O0-NEXT: lpm r24, Z+
; CHECK-O0-NEXT: lpm r25, Z
; CHECK-O0-NEXT: adiw r28, 2
; CHECK-O3-NEXT: std Y+2, r25
; CHECK-O3-NEXT: lsl r24
; CHECK-O3-NEXT: rol r25
-; CHECK-O3-NEXT: subi r24, -lo8(arr0)
-; CHECK-O3-NEXT: sbci r25, -hi8(arr0)
+; CHECK-O3-NEXT: subi r24, lo8(-(arr0))
+; CHECK-O3-NEXT: sbci r25, hi8(-(arr0))
; CHECK-O3-NEXT: movw r30, r24
; CHECK-O3-NEXT: lpm r24, Z+
; CHECK-O3-NEXT: lpm r25, Z
; CHECK-O0-NEXT: std Y+2, r25
; CHECK-O0-NEXT: ldd r30, Y+1
; CHECK-O0-NEXT: ldd r31, Y+2
-; CHECK-O0-NEXT: subi r30, -lo8(arr1)
-; CHECK-O0-NEXT: sbci r31, -hi8(arr1)
+; CHECK-O0-NEXT: subi r30, lo8(-(arr1))
+; CHECK-O0-NEXT: sbci r31, hi8(-(arr1))
; CHECK-O0-NEXT: lpm r24, Z
; CHECK-O0-NEXT: adiw r28, 2
; CHECK-O0-NEXT: in r0, 63
; CHECK-O3-NEXT: out 61, r28
; CHECK-O3-NEXT: std Y+1, r24
; CHECK-O3-NEXT: std Y+2, r25
-; CHECK-O3-NEXT: subi r24, -lo8(arr1)
-; CHECK-O3-NEXT: sbci r25, -hi8(arr1)
+; CHECK-O3-NEXT: subi r24, lo8(-(arr1))
+; CHECK-O3-NEXT: sbci r25, hi8(-(arr1))
; CHECK-O3-NEXT: movw r30, r24
; CHECK-O3-NEXT: lpm r24, Z
; CHECK-O3-NEXT: adiw r28, 2
lo8_neg:
- ldi r24, -lo8(123456)
- ldi r24, -lo8(foo)
+ ldi r24, lo8(-(123456))
+ ldi r24, lo8(-(foo))
-; CHECK: ldi r24, -lo8(123456) ; encoding: [0x80,0xec]
-; CHECK: ldi r24, -lo8(foo) ; encoding: [0x80'A',0xe0]
-; CHECK: ; fixup A - offset: 0, value: -lo8(foo), kind: fixup_lo8_ldi_neg
+; CHECK: ldi r24, lo8(-(123456)) ; encoding: [0x80,0xec]
+; CHECK: ldi r24, lo8(-(foo)) ; encoding: [0x80'A',0xe0]
+; CHECK: ; fixup A - offset: 0, value: lo8(-(foo)), kind: fixup_lo8_ldi_neg
hi8:
hi8_neg:
- ldi r24, -hi8(123456)
- ldi r24, -hi8(foo)
+ ldi r24, hi8(-(123456))
+ ldi r24, hi8(-(foo))
-; CHECK: ldi r24, -hi8(123456) ; encoding: [0x8d,0xe1]
-; CHECK: ldi r24, -hi8(foo) ; encoding: [0x80'A',0xe0]
-; CHECK: ; fixup A - offset: 0, value: -hi8(foo), kind: fixup_hi8_ldi_neg
+; CHECK: ldi r24, hi8(-(123456)) ; encoding: [0x8d,0xe1]
+; CHECK: ldi r24, hi8(-(foo)) ; encoding: [0x80'A',0xe0]
+; CHECK: ; fixup A - offset: 0, value: hi8(-(foo)), kind: fixup_hi8_ldi_neg
hh8:
hh8_neg:
- ldi r24, -hh8(123456)
- ldi r24, -hh8(foo)
+ ldi r24, hh8(-(123456))
+ ldi r24, hh8(-(foo))
-; CHECK: ldi r24, -hh8(123456) ; encoding: [0x8e,0xef]
-; CHECK: ldi r24, -hh8(foo) ; encoding: [0x80'A',0xe0]
-; CHECK: ; fixup A - offset: 0, value: -hh8(foo), kind: fixup_hh8_ldi_neg
+; CHECK: ldi r24, hh8(-(123456)) ; encoding: [0x8e,0xef]
+; CHECK: ldi r24, hh8(-(foo)) ; encoding: [0x80'A',0xe0]
+; CHECK: ; fixup A - offset: 0, value: hh8(-(foo)), kind: fixup_hh8_ldi_neg
hlo8: ; synonym with hh8() above, hence the... odd results
hlo8_neg:
- ldi r24, -hlo8(123456)
- ldi r24, -hlo8(foo)
+ ldi r24, hlo8(-(123456))
+ ldi r24, hlo8(-(foo))
-; CHECK: ldi r24, -hh8(123456) ; encoding: [0x8e,0xef]
-; CHECK: ldi r24, -hh8(foo) ; encoding: [0x80'A',0xe0]
-; CHECK: ; fixup A - offset: 0, value: -hh8(foo), kind: fixup_hh8_ldi_neg
+; CHECK: ldi r24, hh8(-(123456)) ; encoding: [0x8e,0xef]
+; CHECK: ldi r24, hh8(-(foo)) ; encoding: [0x80'A',0xe0]
+; CHECK: ; fixup A - offset: 0, value: hh8(-(foo)), kind: fixup_hh8_ldi_neg
hhi8:
; CHECK: ; fixup A - offset: 0, value: hhi8(bar+5), kind: fixup_ms8_ldi
hhi8_neg:
- ldi r24, -hhi8(123456)
- ldi r24, -hhi8(foo)
+ ldi r24, hhi8(-(123456))
+ ldi r24, hhi8(-(foo))
-; CHECK: ldi r24, -hhi8(123456) ; encoding: [0x8f,0xef]
-; CHECK: ldi r24, -hhi8(foo) ; encoding: [0x80'A',0xe0]
-; CHECK: ; fixup A - offset: 0, value: -hhi8(foo), kind: fixup_ms8_ldi_neg
+; CHECK: ldi r24, hhi8(-(123456)) ; encoding: [0x8f,0xef]
+; CHECK: ldi r24, hhi8(-(foo)) ; encoding: [0x80'A',0xe0]
+; CHECK: ; fixup A - offset: 0, value: hhi8(-(foo)), kind: fixup_ms8_ldi_neg
pm_lo8:
ldi r24, pm_lo8(0x0815)
pm_lo8_neg:
- ldi r24, -pm_lo8(0x0815)
- ldi r24, -pm_lo8(foo)
- ldi r24, -pm_lo8(bar + 5)
+ ldi r24, pm_lo8(-(0x0815))
+ ldi r24, pm_lo8(-(foo))
+ ldi r24, pm_lo8(-(bar + 5))
-; CHECK: ldi r24, -pm_lo8(2069) ; encoding: [0x85,0xef]
-; CHECK: ldi r24, -pm_lo8(foo) ; encoding: [0x80'A',0xe0]
-; CHECK: ; fixup A - offset: 0, value: -pm_lo8(foo), kind: fixup_lo8_ldi_pm_neg
-; CHECK: ldi r24, -pm_lo8(bar+5) ; encoding: [0x80'A',0xe0]
-; CHECK: ; fixup A - offset: 0, value: -pm_lo8(bar+5), kind: fixup_lo8_ldi_pm_neg
+; CHECK: ldi r24, pm_lo8(-(2069)) ; encoding: [0x85,0xef]
+; CHECK: ldi r24, pm_lo8(-(foo)) ; encoding: [0x80'A',0xe0]
+; CHECK: ; fixup A - offset: 0, value: pm_lo8(-(foo)), kind: fixup_lo8_ldi_pm_neg
+; CHECK: ldi r24, pm_lo8(-(bar+5)) ; encoding: [0x80'A',0xe0]
+; CHECK: ; fixup A - offset: 0, value: pm_lo8(-(bar+5)), kind: fixup_lo8_ldi_pm_neg
pm_hi8_neg:
- ldi r24, -pm_hi8(0x0815)
- ldi r24, -pm_hi8(foo)
- ldi r24, -pm_hi8(bar + 5)
+ ldi r24, pm_hi8(-(0x0815))
+ ldi r24, pm_hi8(-(foo))
+ ldi r24, pm_hi8(-(bar + 5))
-; CHECK: ldi r24, -pm_hi8(2069) ; encoding: [0x8b,0xef]
-; CHECK: ldi r24, -pm_hi8(foo) ; encoding: [0x80'A',0xe0]
-; CHECK: ; fixup A - offset: 0, value: -pm_hi8(foo), kind: fixup_hi8_ldi_pm_neg
-; CHECK: ldi r24, -pm_hi8(bar+5) ; encoding: [0x80'A',0xe0]
-; CHECK: ; fixup A - offset: 0, value: -pm_hi8(bar+5), kind: fixup_hi8_ldi_pm_neg
+; CHECK: ldi r24, pm_hi8(-(2069)) ; encoding: [0x8b,0xef]
+; CHECK: ldi r24, pm_hi8(-(foo)) ; encoding: [0x80'A',0xe0]
+; CHECK: ; fixup A - offset: 0, value: pm_hi8(-(foo)), kind: fixup_hi8_ldi_pm_neg
+; CHECK: ldi r24, pm_hi8(-(bar+5)) ; encoding: [0x80'A',0xe0]
+; CHECK: ; fixup A - offset: 0, value: pm_hi8(-(bar+5)), kind: fixup_hi8_ldi_pm_neg
pm_hh8_neg:
- ldi r24, -pm_hh8(0x0815)
- ldi r24, -pm_hh8(foo)
- ldi r24, -pm_hh8(bar + 5)
-
-; CHECK: ldi r24, -pm_hh8(2069) ; encoding: [0x8f,0xef]
-; CHECK: ldi r24, -pm_hh8(foo) ; encoding: [0x80'A',0xe0]
-; CHECK: ; fixup A - offset: 0, value: -pm_hh8(foo), kind: fixup_hh8_ldi_pm_neg
-; CHECK: ldi r24, -pm_hh8(bar+5) ; encoding: [0x80'A',0xe0]
-; CHECK: ; fixup A - offset: 0, value: -pm_hh8(bar+5), kind: fixup_hh8_ldi_pm_neg
-
+ ldi r24, pm_hh8(-(0x0815))
+ ldi r24, pm_hh8(-(foo))
+ ldi r24, pm_hh8(-(bar + 5))
+
+; CHECK: ldi r24, pm_hh8(-(2069)) ; encoding: [0x8f,0xef]
+; CHECK: ldi r24, pm_hh8(-(foo)) ; encoding: [0x80'A',0xe0]
+; CHECK: ; fixup A - offset: 0, value: pm_hh8(-(foo)), kind: fixup_hh8_ldi_pm_neg
+; CHECK: ldi r24, pm_hh8(-(bar+5)) ; encoding: [0x80'A',0xe0]
+; CHECK: ; fixup A - offset: 0, value: pm_hh8(-(bar+5)), kind: fixup_hh8_ldi_pm_neg
; CHECK-NEXT: R_AVR_LO8_LDI bar+0x3
; CHECK-NEXT: R_AVR_LO8_LDI abc
-; CHECK-NEXT: R_AVR_LO8_LDI abc
ldi r24, lo8(bar+3)
-ldi r16, +lo8(abc)
ldi r16, lo8(+(abc))
; CHECK-NEXT: R_AVR_HI8_LDI abc
; CHECK-NEXT: R_AVR_HI8_LDI abc
-; CHECK-NEXT: R_AVR_HI8_LDI abc
ldi r30, hi8(abc)
-ldi r16, +hi8(abc)
ldi r16, hi8(+(abc))
; CHECK-NEXT: R_AVR_LO8_LDI_NEG abc
-; CHECK-NEXT: R_AVR_LO8_LDI_NEG abc
-ldi r16, -lo8(abc)
ldi r16, lo8(-(abc))
; CHECK-NEXT: R_AVR_HI8_LDI_NEG abc
-; CHECK-NEXT: R_AVR_HI8_LDI_NEG abc
-ldi r16, -hi8(abc)
ldi r16, hi8(-(abc))
; CHECK-NEXT: R_AVR_HH8_LDI foo
; CHECK-NEXT: R_AVR_HH8_LDI foo
-; CHECK-NEXT: R_AVR_HH8_LDI foo
ldi r16, hh8(foo)
-ldi r16, +hh8(foo)
ldi r16, hh8(+(foo))
; CHECK-NEXT: R_AVR_HH8_LDI_NEG foo
-; CHECK-NEXT: R_AVR_HH8_LDI_NEG foo
-ldi r16, -hh8(foo)
ldi r16, hh8(-(foo))
; CHECK-NEXT: R_AVR_HH8_LDI foo
; CHECK-NEXT: R_AVR_HH8_LDI foo
-; CHECK-NEXT: R_AVR_HH8_LDI foo
ldi r24, hlo8(foo)
-ldi r24, +hlo8(foo)
ldi r24, hlo8(+(foo))
; CHECK-NEXT: R_AVR_HH8_LDI_NEG foo
-; CHECK-NEXT: R_AVR_HH8_LDI_NEG foo
-ldi r24, -hlo8(foo)
ldi r24, hlo8(-(foo))
; CHECK-NEXT: R_AVR_MS8_LDI bar
; CHECK-NEXT: R_AVR_MS8_LDI bar
-; CHECK-NEXT: R_AVR_MS8_LDI bar
ldi r24, hhi8(bar)
-ldi r24, +hhi8(bar)
ldi r24, hhi8(+(bar))
; CHECK-NEXT: R_AVR_MS8_LDI_NEG bar
-; CHECK-NEXT: R_AVR_MS8_LDI_NEG bar
-ldi r24, -hhi8(bar)
ldi r24, hhi8(-(bar))
; CHECK-NEXT: R_AVR_LO8_LDI_PM foo
; CHECK-NEXT: R_AVR_LO8_LDI_PM foo
-; CHECK-NEXT: R_AVR_LO8_LDI_PM foo
ldi r17, pm_lo8(foo)
-ldi r25, +pm_lo8(foo)
ldi r25, pm_lo8(+(foo))
; CHECK-NEXT: R_AVR_HI8_LDI_PM bar
; CHECK-NEXT: R_AVR_HI8_LDI_PM foo
-; CHECK-NEXT: R_AVR_HI8_LDI_PM foo
ldi r22, pm_hi8(bar)
-ldi r25, +pm_hi8(foo)
ldi r25, pm_hi8(+(foo))
; CHECK-NEXT: R_AVR_HH8_LDI_PM baz
; CHECK-NEXT: R_AVR_HH8_LDI_PM foo
-; CHECK-NEXT: R_AVR_HH8_LDI_PM foo
ldi r25, pm_hh8(baz)
-ldi r25, +pm_hh8(foo)
ldi r25, pm_hh8(+(foo))
; CHECK-NEXT: R_AVR_LO8_LDI_PM_NEG foo
-; CHECK-NEXT: R_AVR_LO8_LDI_PM_NEG foo
-ldi r25, -pm_lo8(foo)
ldi r25, pm_lo8(-(foo))
; CHECK-NEXT: R_AVR_HI8_LDI_PM_NEG foo
-; CHECK-NEXT: R_AVR_HI8_LDI_PM_NEG foo
-ldi r25, -pm_hi8(foo)
ldi r25, pm_hi8(-(foo))
; CHECK-NEXT: R_AVR_HH8_LDI_PM_NEG foo
-; CHECK-NEXT: R_AVR_HH8_LDI_PM_NEG foo
-ldi r25, -pm_hh8(foo)
ldi r25, pm_hh8(-(foo))
; CHECK-NEXT: R_AVR_LO8_LDI_GS foo