53 lines · plain
1# REQUIRES: avr2 3# RUN: rm -rf %t && split-file %s %t && cd %t4 5# RUN: llvm-mc -filetype=obj -triple=avr -mcpu=atmega328 avr-pcrel-7.s -o avr-pcrel-7.o6# RUN: not ld.lld avr-pcrel-7.o --image-base=0x1000 -Ttext=0x1000 --defsym=callee0=0x1040 --defsym=callee1=0x1084 --defsym=callee2=0x100f 2>&1 | \7# RUN: FileCheck %s --check-prefix=PCREL78# RUN: llvm-mc -filetype=obj -triple=avr -mcpu=atmega328 avr-pcrel-13.s -o avr-pcrel-13.o9# RUN: not ld.lld avr-pcrel-13.o --image-base=0x1000 -Ttext=0x1000 --defsym=callee0=0x2000 --defsym=callee1=0x2004 --defsym=callee2=0x100f 2>&1 | \10# RUN: FileCheck %s --check-prefix=PCREL1311# RUN: llvm-mc -filetype=obj -triple=avr -mcpu=atmega328 avr-abs.s -o avr-abs.o12# RUN: not ld.lld avr-abs.o --image-base=0x1000 -Ttext=0x1000 --defsym=callee0=0x1009 --defsym=callee1=0x1010 2>&1 | \13# RUN: FileCheck %s --check-prefix=ABS14 15#--- avr-pcrel-7.s16 17.section .LDI,"ax",@progbits18 19.globl __start20__start:21 22# PCREL7-NOT: callee023# PCREL7: error: {{.*}} relocation R_AVR_7_PCREL out of range: {{.*}} is not in [-128, 127]; references 'callee1'24# PCREL7: error: {{.*}} improper alignment for relocation R_AVR_7_PCREL: {{.*}} is not aligned to 2 bytes25brne callee026breq callee127brlt callee228 29#--- avr-pcrel-13.s30 31.section .LDI,"ax",@progbits32 33.globl __start34__start:35 36# PCREL13-NOT: callee037# PCREL13: error: {{.*}} improper alignment for relocation R_AVR_13_PCREL: {{.*}} is not aligned to 2 bytes38rjmp callee039rcall callee140rjmp callee241 42#--- avr-abs.s43 44.section .LDI,"ax",@progbits45 46.globl __start47__start:48 49# ABS: error: {{.*}} improper alignment for relocation R_AVR_CALL: 0x1009 is not aligned to 2 bytes50# ABS-NOT: 0x101051call callee052jmp callee153