brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.2 KiB · f6a6e1f Raw
55 lines · plain
1# REQUIRES: x862# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t3# RUN: echo "MEMORY {                                  \4# RUN:   ROM (rwx): ORIGIN = 0x1000, LENGTH = 0x100    \5# RUN:   RAM (rwx): ORIGIN = 0x2000, LENGTH = 0x100    \6# RUN: }                                               \7# RUN: INCLUDE \"%t.script.inc\"                       \8# RUN: SECTIONS {                                      \9# RUN:  .text : { *(.text*) } > ALIAS_TEXT             \10# RUN:  .data : { *(.data*) } > ALIAS_DATA             \11# RUN: }" > %t.script12 13## .text to ROM, .data to RAM.14# RUN: echo 'REGION_ALIAS ("ALIAS_TEXT", "ROM");' > %t.script.inc15# RUN: echo "REGION_ALIAS (\"ALIAS_DATA\", RAM);" >> %t.script.inc16# RUN: ld.lld %t --script %t.script -o %t217# RUN: llvm-objdump --section-headers %t2 | FileCheck %s18# CHECK: .text       00000001 0000000000001000 TEXT19# CHECK: .data       00000008 0000000000002000 DATA20 21## All to ROM.22# RUN: echo "REGION_ALIAS (\"ALIAS_TEXT\", ROM);" > %t.script.inc23# RUN: echo "REGION_ALIAS (\"ALIAS_DATA\", ROM);" >> %t.script.inc24# RUN: ld.lld %t --script %t.script -o %t225# RUN: llvm-objdump --section-headers %t2 | FileCheck %s --check-prefix=RAM26# RAM: .text         00000001 0000000000001000 TEXT27# RAM: .data         00000008 0000000000001001 DATA28 29## Redefinition of region.30# RUN: echo "REGION_ALIAS (\"ROM\", ROM);" > %t.script.inc31# RUN: not ld.lld %t --script %t.script -o /dev/null 2>&1 | \32# RUN:   FileCheck %s --check-prefix=ERR133# ERR1: {{.*}}script.inc:1: redefinition of memory region 'ROM'34 35## Redefinition of alias.36# RUN: echo "REGION_ALIAS (\"ALIAS_TEXT\", ROM);" > %t.script.inc37# RUN: echo "REGION_ALIAS (\"ALIAS_TEXT\", ROM);" >> %t.script.inc38# RUN: not ld.lld %t --script %t.script -o /dev/null 2>&1 | \39# RUN:   FileCheck %s --check-prefix=ERR240# ERR2: {{.*}}script.inc:2: redefinition of memory region 'ALIAS_TEXT'41 42## Attemp to create an alias for undefined region.43# RUN: echo "REGION_ALIAS (\"ALIAS_TEXT\", FOO);" > %t.script.inc44# RUN: not ld.lld %t --script %t.script -o /dev/null 2>&1 | \45# RUN:   FileCheck %s --check-prefix=ERR346# ERR3: {{.*}}script.inc:1: memory region 'FOO' is not defined47 48.text49.global _start50_start:51 nop52 53.section .data,"aw"54.quad 055