brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.5 KiB · 6c07f9f Raw
85 lines · plain
1# RUN: yaml2obj %p/Inputs/ihex-elf-sections.yaml -o %t2# RUN: llvm-objcopy -O ihex %t - | FileCheck %s3 4# Check ihex output, when we have segments in ELF file5# In such case only sections in PT_LOAD segments will6# be exported and their physical addresses will be used7# RUN: yaml2obj %p/Inputs/ihex-elf-segments.yaml -o %t-segs8# RUN: llvm-objcopy -O ihex %t-segs - | FileCheck %s --check-prefix=SEGMENTS9 10# Check that non-load segments are ignored:11# RUN: yaml2obj %p/Inputs/ihex-elf-pt-null.yaml -o %t2-segs12# RUN: llvm-objcopy -O ihex %t2-segs - | FileCheck %s --check-prefix=PT_NULL13 14# Check that sign-extended 32-bit section addresses are processed15# correctly16# RUN: yaml2obj %p/Inputs/ihex-elf-sections2.yaml -o %t-sec217# RUN: llvm-objcopy -O ihex --only-section=.text1 %t-sec2 - | FileCheck %s --check-prefix=SIGN_EXTENDED18 19# Check that section address range overlapping 32 bit range20# triggers an error21# RUN: not llvm-objcopy -O ihex --only-section=.text2 %t-sec2 %t-sec2-2.hex 2>&1 | FileCheck %s --check-prefix=BAD-ADDR22# RUN: not llvm-objcopy -O ihex --only-section=.text3 %t-sec2 %t-sec2-3.hex 2>&1 | FileCheck %s --check-prefix=BAD-ADDR223 24# Check that zero length section is not written25# RUN: llvm-objcopy -O ihex --only-section=.text %t-sec2 - | FileCheck %s --check-prefix=ZERO_SIZE_SEC26 27# Check 80x86 start address record. It is created for start28# addresses less than 0x10000029# RUN: llvm-objcopy -O ihex --set-start=0xFFFF %t - | FileCheck %s --check-prefix=START130 31# Check i386 start address record (05). It is created for32# start addresses which doesn't fit 20 bits33# RUN: llvm-objcopy -O ihex --set-start=0x100000 %t - | FileCheck %s --check-prefix=START234 35# We allow sign extended 32 bit start addresses as well.36# RUN: llvm-objcopy -O ihex --set-start=0xFFFFFFFF80001000 %t - | FileCheck %s --check-prefix=START337 38# Start address which exceeds 32 bit range triggers an error39# RUN: not llvm-objcopy -O ihex --set-start=0xF00000000 %t %t6.hex 2>&1 | FileCheck %s --check-prefix=BAD-START40 41# CHECK:      :10000000000102030405060708090A0B0C0D0E0F7842# CHECK-NEXT: :0500100010111213149143# CHECK-NEXT: :08FFF80030313233343536376544# CHECK-NEXT: :020000021000EC45# CHECK-NEXT: :030000003839404C46# CHECK-NEXT: :0401000040414243F547# CHECK-NEXT: :020000020000FC48# CHECK-NEXT: :020000040010EA49# CHECK-NEXT: :08FFF80050515253545556576550# CHECK-NEXT: :020000040011E951# CHECK-NEXT: :03000000585960EC52# CHECK-NEXT: :00000001FF53 54# SEGMENTS:       :020000040010EA55# SEGMENTS-NEXT:  :10000000000102030405060708090A0B0C0D0E0F7856# SEGMENTS-NEXT:  :0500100010111213149157# SEGMENTS-NEXT:  :0B00180030313233343536373839409058# SEGMENTS-NEXT:  :0400280040414243CE59# SEGMENTS-NEXT:  :0B00300050515253545556575859601860# SEGMENTS-NEXT:  :020000040020DA61# SEGMENTS-NEXT:  :03FFF8000000000662# SEGMENTS-NEXT:  :0400000500100000E763# SEGMENTS-NEXT:  :00000001FF64# SEGMENTS-NOT:   {{.}}65 66# 'ExtendedAddr' (04) record shouldn't be created67# PT_NULL-NOT: :0200000468 69# SIGN_EXTENDED:      :0200000480007A70# SIGN_EXTENDED-NEXT: :051000000001020304E171# SIGN_EXTENDED-NEXT: :00000001FF72 73# BAD-ADDR: error: {{.*}}: section '.text2' address range [0x{{.*}}, 0x{{.*}}] is not 32 bit74# BAD-ADDR2: error: {{.*}}: section '.text3' address range [0x{{.*}}, 0x{{.*}}] is not 32 bit75 76# There shouldn't be 'ExtendedAddr' nor 'Data' records77# ZERO_SIZE_SEC-NOT:  :0200000478# ZERO_SIZE_SEC-NOT:  :00FFFF0079# ZERO_SIZE_SEC:      :00000001FF80 81# START1: :040000030000FFFFFB82# START2: :0400000500100000E783# START3: :04000005800010006784# BAD-START: error: {{.*}}: entry point address 0x{{.*}} overflows 32 bits85