brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.1 KiB · 58de337 Raw
34 lines · plain
1; REQUIRES: avr2; RUN: llvm-mc -filetype=obj -triple=avr -mcpu=atmega2560 %s -o %t.o3; RUN: ld.lld %t.o --defsym=a=0x1fffe --defsym=b=0x20000 -o %t4; RUN: llvm-objdump -d --print-imm-hex --no-show-raw-insn --mcpu=atmega2560 %t \5; RUN:     | FileCheck %s6 7.section .LDI,"ax",@progbits8 9;; CHECK-LABEL: <__AVRThunk_b>:10;; CHECK-NEXT:  110b4: jmp  0x2000011;; CHECK-LABEL: <__init>:12;; CHECK-NEXT:  110b8:  ldi r30, 0xff13;; CHECK-NEXT:  110ba:  ldi r31, 0xff14;; CHECK-NEXT:  110bc:  eicall15;; The destination of the following two LDI instructions is16;; __AVRThunk_b == 0x110b4, so they actually are17;;                      ldi r30, ((0x110b4) >> 1) & 0xff18;;                      ldi r31, ((0x110b4) >> 9)19;; CHECK-NEXT:  110be:  ldi r30, 0x5a20;; CHECK-NEXT:  110c0:  ldi r31, 0x8821;; CHECK-NEXT:  110c2:  eicall22;; CHECK-NOT:   __AVRThunk_a23 24.globl __init25__init:26;; No thunk is needed, since the destination is in range [0, 0x1ffff].27ldi r30, lo8_gs(a)  ; R_AVR_LO8_LDI_GS28ldi r31, hi8_gs(a)  ; R_AVR_HI8_LDI_GS29eicall30;; A thunk is needed, since the destination is out of range.31ldi r30, lo8_gs(b)  ; R_AVR_LO8_LDI_GS32ldi r31, hi8_gs(b)  ; R_AVR_HI8_LDI_GS33eicall34