[InstCombine] Remove insertRangeTest code that handles the equality case.
[llvm-complete.git] / test / tools / llvm-objcopy / ELF / overlapping-sections.test
blob1ab0bb66c750c33d7c89e6bccadcdfc60e165c52
1 ## This test shows that llvm-objcopy does not baulk at overlapping sections.
2 ## These don't really make sense, but the tool should still handle invalid
3 ## inputs somehow.
4 # RUN: yaml2obj %s -o %t.o
6 ## First, check that the section header table appears immediately after the ELF
7 ## header.
8 # RUN: llvm-readobj --file-headers %t.o | FileCheck %s --check-prefix=SHDRS-OFFSET
9 # SHDRS-OFFSET: SectionHeaderOffset: 0x40{{$}}
11 ## Binary edit the section header sh_offset field of the second section to
12 ## overlap the first one.
13 # RUN: %python -c "with open('%/t.o', 'r+b') as input: import struct; bytes = struct.pack('<Q', 0x1001); input.seek(216); input.write(bytes)"
15 ## Sanity check that the binary editing modified the correct field.
16 # RUN: llvm-readobj --section-headers %t.o | FileCheck %s --check-prefix=VALIDATE
18 # VALIDATE: Name: .first
19 # VALIDATE: Offset: 0x1000
20 # VALIDATE: Name: .second
21 # VALIDATE: Offset: 0x1001
23 ## Check that the contents are as expected before the copy.
24 # RUN: llvm-readobj -x .first -x .second %t.o | FileCheck %s --check-prefix=CONTENTS
26 ## Now check that the section contents are still correct after the copy.
27 ## Also characterize the behavior of llvm-objcopy in that it "unoverlaps" the
28 ## two sections.
29 # RUN: llvm-objcopy %t.o %t2.o
30 # RUN: llvm-readobj --section-headers %t2.o | FileCheck %s
31 # RUN: llvm-readobj -x .first -x .second %t2.o | FileCheck %s --check-prefix=CONTENTS
33 # CHECK: Name: .first
34 # CHECK: Offset: 0x1000
35 # CHECK: Name: .second
36 # CHECK: Offset: 0x1004
38 # CONTENTS:      Hex dump of section '.first':
39 # CONTENTS-NEXT: 0x00000000 01234567
40 # CONTENTS-EMPTY:
41 # CONTENTS-NEXT: Hex dump of section '.second':
42 # CONTENTS-NEXT: 0x00000000 23456789
44 --- !ELF
45 FileHeader:
46   Class:   ELFCLASS64
47   Data:    ELFDATA2LSB
48   Type:    ET_EXEC
49   Machine: EM_X86_64
50 Sections:
51   - Name: .first
52     Type: SHT_PROGBITS
53     Content: '01234567'
54     AddressAlign: 0x1000
55   - Name: .second
56     Type: SHT_PROGBITS
57     Content: '89abcdef'