[ELF] Make SyntheticSection parameter order match InputSection
[llvm-project.git] / lld / test / ELF / avr-reloc-error.s
blobf177e44f753fa63a4efc5c262f1b9eba3f4c41f9
1 # REQUIRES: avr
3 # RUN: rm -rf %t && split-file %s %t && cd %t
5 # RUN: llvm-mc -filetype=obj -triple=avr -mcpu=atmega328 avr-pcrel-7.s -o avr-pcrel-7.o
6 # RUN: not ld.lld avr-pcrel-7.o -o /dev/null -Ttext=0x1000 --defsym=callee0=0x1040 --defsym=callee1=0x1084 --defsym=callee2=0x100f 2>&1 | \
7 # RUN: FileCheck %s --check-prefix=PCREL7
8 # RUN: llvm-mc -filetype=obj -triple=avr -mcpu=atmega328 avr-pcrel-13.s -o avr-pcrel-13.o
9 # RUN: not ld.lld avr-pcrel-13.o -o /dev/null -Ttext=0x1000 --defsym=callee0=0x2000 --defsym=callee1=0x2004 --defsym=callee2=0x100f 2>&1 | \
10 # RUN: FileCheck %s --check-prefix=PCREL13
11 # RUN: llvm-mc -filetype=obj -triple=avr -mcpu=atmega328 avr-abs.s -o avr-abs.o
12 # RUN: not ld.lld avr-abs.o -o /dev/null -Ttext=0x1000 --defsym=callee0=0x1009 --defsym=callee1=0x1010 2>&1 | \
13 # RUN: FileCheck %s --check-prefix=ABS
15 #--- avr-pcrel-7.s
17 .section .LDI,"ax",@progbits
19 .globl __start
20 __start:
22 # PCREL7-NOT: callee0
23 # 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 bytes
25 brne callee0
26 breq callee1
27 brlt callee2
29 #--- avr-pcrel-13.s
31 .section .LDI,"ax",@progbits
33 .globl __start
34 __start:
36 # PCREL13-NOT: callee0
37 # PCREL13: error: {{.*}} improper alignment for relocation R_AVR_13_PCREL: {{.*}} is not aligned to 2 bytes
38 rjmp callee0
39 rcall callee1
40 rjmp callee2
42 #--- avr-abs.s
44 .section .LDI,"ax",@progbits
46 .globl __start
47 __start:
49 # ABS: error: {{.*}} improper alignment for relocation R_AVR_CALL: 0x1009 is not aligned to 2 bytes
50 # ABS-NOT: 0x1010
51 call callee0
52 jmp callee1