3 ## Test ld.lld supports OUTPUT_FORMAT/OUTPUT_ARCH for AVR output.
5 # RUN: split-file %s %t
6 # RUN: llvm-mc -filetype=obj -triple=avr -mcpu=atmega328 %t/avr5.s -o %t/avr5.o
7 # RUN: ld.lld %t/avr5.o -T %t/avr5.lds -o %t/avr5a.out
8 # RUN: llvm-objdump --no-print-imm-hex --mcpu=atmega328 -d %t/avr5a.out | FileCheck %s --check-prefix=RELOC
9 # RUN: ld.lld %t/avr5.o -Ttext=0 -Tdata=0x800 -e _start -o %t/avr5b.out
10 # RUN: llvm-objdump --no-print-imm-hex --mcpu=atmega328 -d %t/avr5b.out | FileCheck %s --check-prefix=RELOC
13 # RELOC-NEXT: ldi r25, 8
15 # RUN: llvm-readelf --headers %t/avr5a.out | FileCheck %s --check-prefix=HEAD
16 # RUN: llvm-readelf --headers %t/avr5b.out | FileCheck %s --check-prefix=HEAD
18 # HEAD: Atmel AVR 8-bit microcontroller
19 # HEAD: 0x85, EF_AVR_ARCH_AVR5, relaxable
21 # HEAD: Name Type Address Off Size
22 # HEAD-NEXT: NULL 00000000 000000 000000
23 # HEAD-NEXT: .text PROGBITS 00000000 001000 000006
24 # HEAD-NEXT: .data PROGBITS 00000800 001800 000004
31 ldi r24, lo8(def) ; Load lower byte of variable def 16-bit address to r24
32 ldi r25, hi8(def) ; Load higher byte of variable def 16-bit address to r25
46 OUTPUT_FORMAT("elf32-avr", "elf32-avr", "elf32-avr")
50 .text 0x000: { *(.text*) }
51 .data 0x800: { *(.data*) }