Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / llvm / test / tools / llvm-readobj / ELF / dynamic-table-dtnull.s
blobbd55f3904ec03660968c4c3821563d533d046c19
1 # Check we are able to dump the dynamic section without a DT_NULL entry correctly.
3 # RUN: yaml2obj --docnum=1 %s -o %t.o
4 # RUN: llvm-readobj --dynamic-table %t.o | FileCheck %s --check-prefix=NONULL-LLVM
5 # RUN: llvm-readelf --dynamic-table %t.o | FileCheck %s --check-prefix=NONULL-GNU
7 # NONULL-LLVM: DynamicSection [ (1 entries)
8 # NONULL-LLVM-NEXT: Tag Type Name/Value
9 # NONULL-LLVM-NEXT: 0x0000000000000015 DEBUG 0x0
10 # NONULL-LLVM-NEXT: ]
12 # NONULL-GNU: Dynamic section at offset {{.*}} contains 1 entries:
13 # NONULL-GNU-NEXT: Tag Type Name/Value
14 # NONULL-GNU-NEXT: 0x0000000000000015 (DEBUG) 0x0
16 --- !ELF
17 FileHeader:
18 Class: ELFCLASS64
19 Data: ELFDATA2LSB
20 Type: ET_EXEC
21 Sections:
22 - Name: .dynamic
23 Type: SHT_DYNAMIC
24 Entries:
25 - Tag: DT_DEBUG
26 Value: 0x0000000000000000
27 ProgramHeaders:
28 - Type: PT_LOAD
29 FirstSec: .dynamic
30 LastSec: .dynamic
31 - Type: PT_DYNAMIC
32 FirstSec: .dynamic
33 LastSec: .dynamic
35 # Sometimes .dynamic section content length can be greater than the
36 # length of its entries. In this case, we should not try to dump anything
37 # past the DT_NULL entry, which works as a terminator.
39 # RUN: yaml2obj --docnum=2 %s -o %t.o
40 # RUN: llvm-readobj --dynamic-table %t.o | FileCheck %s --check-prefix=LONG-LLVM
41 # RUN: llvm-readelf --dynamic-table %t.o | FileCheck %s --check-prefix=LONG-GNU
43 # LONG-LLVM: DynamicSection [ (2 entries)
44 # LONG-LLVM-NEXT: Tag Type Name/Value
45 # LONG-LLVM-NEXT: 0x0000000000000015 DEBUG 0x0
46 # LONG-LLVM-NEXT: 0x0000000000000000 NULL 0x0
47 # LONG-LLVM-NEXT: ]
49 # LONG-GNU: Dynamic section at offset {{.*}} contains 2 entries:
50 # LONG-GNU-NEXT: Tag Type Name/Value
51 # LONG-GNU-NEXT: 0x0000000000000015 (DEBUG) 0x0
52 # LONG-GNU-NEXT: 0x0000000000000000 (NULL) 0x0
54 --- !ELF
55 FileHeader:
56 Class: ELFCLASS64
57 Data: ELFDATA2LSB
58 Type: ET_EXEC
59 Sections:
60 - Name: .dynamic
61 Type: SHT_DYNAMIC
62 Entries:
63 - Tag: DT_DEBUG
64 Value: 0x0000000000000000
65 - Tag: DT_NULL
66 Value: 0x0000000000000000
67 - Tag: DT_NULL
68 Value: 0x0000000000000000
69 ProgramHeaders:
70 - Type: PT_LOAD
71 FirstSec: .dynamic
72 LastSec: .dynamic
73 - Type: PT_DYNAMIC
74 FirstSec: .dynamic
75 LastSec: .dynamic