brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.7 KiB · 4ac1b73 Raw
68 lines · plain
1; RUN: llc < %s -mtriple=avr --mcpu=atxmega384d3 \2; RUN:     | FileCheck --check-prefixes=CHECK,NOSECTIONS %s3; RUN: llc -function-sections -data-sections < %s -mtriple=avr --mcpu=atxmega384d3 \4; RUN:     | FileCheck --check-prefixes=CHECK,SECTIONS %s5; RUN: not llc -function-sections -data-sections < %s -mtriple=avr --mcpu=at90s8515 2>&1 \6; RUN:     | FileCheck --check-prefixes=CHECK-8515 %s7; RUN: not llc -function-sections -data-sections < %s -mtriple=avr --mcpu=attiny40 2>&1 \8; RUN:     | FileCheck --check-prefixes=CHECK-tiny40 %s9 10; Test that functions (in address space 1) are not considered .progmem data.11 12; SECTIONS: .text.somefunc,"ax",@progbits13; CHECK-LABEL: somefunc:14define void @somefunc() addrspace(1) {15  ret void16}17 18 19; Test whether global variables are placed in the correct section.20 21; Note: avr-gcc would place this global in .progmem.data.flash with22; -fdata-sections. The AVR backend does not yet respect -fdata-sections in this23; case.24 25; CHECK: .section .progmem.data,"a",@progbits26; CHECK-LABEL: flash:27@flash = addrspace(1) constant i16 328 29; CHECK: .section .progmem1.data,"a",@progbits30; CHECK-LABEL: flash1:31; CHECK-8515: error: Current AVR subtarget does not support accessing extended program memory32; CHECK-tiny40: error: Current AVR subtarget does not support accessing program memory33@flash1 = addrspace(2) constant i16 434 35; CHECK: .section .progmem2.data,"a",@progbits36; CHECK-LABEL: flash2:37; CHECK-8515: error: Current AVR subtarget does not support accessing extended program memory38; CHECK-tiny40: error: Current AVR subtarget does not support accessing program memory39@flash2 = addrspace(3) constant i16 540 41; CHECK: .section .progmem3.data,"a",@progbits42; CHECK-LABEL: flash3:43; CHECK-8515: error: Current AVR subtarget does not support accessing extended program memory44; CHECK-tiny40: error: Current AVR subtarget does not support accessing program memory45@flash3 = addrspace(4) constant i16 646 47; CHECK: .section .progmem4.data,"a",@progbits48; CHECK-LABEL: flash4:49; CHECK-8515: error: Current AVR subtarget does not support accessing extended program memory50; CHECK-tiny40: error: Current AVR subtarget does not support accessing program memory51@flash4 = addrspace(5) constant i16 752 53; CHECK: .section .progmem5.data,"a",@progbits54; CHECK-LABEL: flash5:55; CHECK-8515: error: Current AVR subtarget does not support accessing extended program memory56; CHECK-tiny40: error: Current AVR subtarget does not support accessing program memory57@flash5 = addrspace(6) constant i16 858 59; NOSECTIONS: .section .rodata,"a",@progbits60; SECTIONS:   .section .rodata.ram1,"a",@progbits61; CHECK-LABEL: ram1:62@ram1 = constant i16 363 64; NOSECTIONS: .data65; SECTIONS:   .section .data.ram2,"aw",@progbits66; CHECK-LABEL: ram2:67@ram2 = global i16 368