[PATCH] D147364: [lld][ELF] Support relocations R_AVR_LO8_LDI_GS/R_AVR_HI8_LDI_GS

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 19 21:16:38 PDT 2023


MaskRay added inline comments.


================
Comment at: lld/test/ELF/avr-thunk.s:8
+
+; CHECK:       000110b4 <__AVRThunk_b>:
+; CHECK-NEXT:    jmp   0x20000
----------------
benshi001 wrote:
> MaskRay wrote:
> > benshi001 wrote:
> > > benshi001 wrote:
> > > > MaskRay wrote:
> > > > > Where is 000110b4 referenced in the CHECK lines?
> > > > `000110b4` is reffered by 
> > > > 
> > > > ```
> > > > ; CHECK-NEXT:    ldi     r30, 0x5a
> > > > ; CHECK-NEXT:    ldi     r31, 0x88
> > > > ```
> > > > 
> > > > that is ((0x88 << 8) + 0x5a) == 0x110b4
> > > > 
> > >  ((0x88 << 8) + 0x5a) << 1 == 0x110b4
> > I'd add a `;; CHECK-NEXT` just before `; CHECK-NEXT:    ldi     r30, 0x5a`. You can see my past updates to ppc-* or aarch64-* tests.
> I did not catch your point here, do you mean, it would be better to be
> 
> ```
> ;; CHECK:       [[ADDR0:[0-9]+]] <__AVRThunk_b>:
> ;; CHECK-NEXT:    jmp   0x20000
> ;; CHECK-NEXT:    ldi     r30, [[ADDR0]]
> ;; CHECK-NEXT:    ldi     r31, [[ADDR0]]
> ```
> 
> But this does not work, since `ADDR0` is broken to 0x88 and 0x5a.
Sorry, I mean you can add comments how 0x5a and 0x88 are computed
```
;; (0x20000 ... ) = 0x5a
;; (0x20000 ... ) = 0x88
```


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D147364/new/

https://reviews.llvm.org/D147364



More information about the llvm-commits mailing list