Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / llvm / test / tools / llvm-readobj / ELF / packed-relocs-errors.s
blob32e96d716ca44f1a07840d35db2d91f5fc60c748
1 # REQUIRES: x86-registered-target
3 ## Test that we report meaningful warnings when dumping
4 ## broken Android's packed relocation sections.
6 # RUN: split-file %s %t
8 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %t/asm1.s -o %t1.o
9 # RUN: llvm-readobj --relocations %t1.o 2>&1 | FileCheck %s -DFILE=%t1.o --check-prefix=ERR-HEADER
10 # RUN: llvm-readelf --relocations %t1.o 2>&1 | FileCheck %s -DFILE=%t1.o --check-prefix=ERR-HEADER
12 #--- asm1.s
13 .section .rela.dyn, "a", @0x60000001
14 .ascii "APS9"
16 # ERR-HEADER: warning: '[[FILE]]': unable to read relocations from SHT_ANDROID_REL section with index 3: invalid packed relocation header
18 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %t/asm2.s -o %t2.o
19 # RUN: llvm-readobj --relocations %t2.o 2>&1 | FileCheck %s -DFILE=%t2.o --check-prefix=ERR-PAST-END
20 # RUN: llvm-readelf --relocations %t2.o 2>&1 | FileCheck %s -DFILE=%t2.o --check-prefix=ERR-PAST-END
22 #--- asm2.s
23 .section .rela.dyn, "a", @0x60000001
24 .ascii "APS2"
26 # ERR-PAST-END: warning: '[[FILE]]': unable to read relocations from SHT_ANDROID_REL section with index 3: unable to decode LEB128 at offset 0x{{([[:xdigit:]]{8})}}: malformed sleb128, extends past end
28 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %t/asm3.s -o %t3.o
29 # RUN: llvm-readobj --relocations %t3.o 2>&1 | FileCheck %s -DFILE=%t3.o --check-prefix=ERR-PAST-END
30 # RUN: llvm-readelf --relocations %t3.o 2>&1 | FileCheck %s -DFILE=%t3.o --check-prefix=ERR-PAST-END
32 #--- asm3.s
33 .section .rela.dyn, "a", @0x60000001
34 .ascii "APS2"
35 .sleb128 4 ## Number of relocations
36 .sleb128 0 ## Initial offset
38 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %t/asm4.s -o %t4.o
39 # RUN: llvm-readobj --relocations %t4.o 2>&1 | FileCheck %s -DFILE=%t4.o --check-prefix=ERR-PAST-END
40 # RUN: llvm-readelf --relocations %t4.o 2>&1 | FileCheck %s -DFILE=%t4.o --check-prefix=ERR-PAST-END
42 #--- asm4.s
43 .section .rela.dyn, "a", @0x60000001
44 .ascii "APS2"
45 .sleb128 4 ## Number of relocations
46 .sleb128 0 ## Initial offset
48 .sleb128 2 ## Number of relocations in group
49 .sleb128 2 ## RELOCATION_GROUPED_BY_OFFSET_DELTA_FLAG
50 .sleb128 8 ## offset delta
52 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %t/asm5.s -o %t5.o
53 # RUN: llvm-readobj --relocations %t5.o 2>&1 | FileCheck %s -DFILE=%t5.o --check-prefix=ERR-LARGE
54 # RUN: llvm-readelf --relocations %t5.o 2>&1 | FileCheck %s -DFILE=%t5.o --check-prefix=ERR-LARGE
56 # ERR-LARGE: warning: '[[FILE]]': unable to read relocations from SHT_ANDROID_REL section with index 3: relocation group unexpectedly large
58 #--- asm5.s
59 .section .rela.dyn, "a", @0x60000001
60 .ascii "APS2"
61 .sleb128 4 ## Number of relocations
62 .sleb128 0 ## Initial offset
64 .sleb128 5 ## Number of relocations in group
65 .sleb128 2 ## RELOCATION_GROUPED_BY_OFFSET_DELTA_FLAG
66 .sleb128 8 ## offset delta