Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / llvm / test / tools / llvm-ifs / binary-read-arch.test
blob427035e30eb8de610b7ad796116e5c00c5bd11bc
1 # RUN: yaml2obj --docnum=1 %s -o %t
2 # RUN: llvm-ifs --input-format=ELF --output-ifs=- %t | FileCheck %s -DTARGET="{ ObjectFormat: ELF, Arch: x86_64, Endianness: little, BitWidth: 64 }"
3 # RUN: llvm-ifs --input-format=ELF --output-ifs=- --hint-ifs-target="x86_64-linux-gnu" %t | FileCheck %s -DTARGET="x86_64-linux-gnu"
5 --- !ELF
6 FileHeader:
7   Class:           ELFCLASS64
8   Data:            ELFDATA2LSB
9   Type:            ET_DYN
10   Machine:         EM_X86_64
11 Sections:
12   - Name:            .dynstr
13     Type:            SHT_STRTAB
14     Flags:           [ SHF_ALLOC ]
15     Address:         0x0000
16     Content:         "00"
17   - Name:            .dynamic
18     Type:            SHT_DYNAMIC
19     Flags:           [ SHF_ALLOC ]
20     Address:         0x0000000000000008
21     Link:            .dynstr
22     AddressAlign:    0x0000000000000008
23     EntSize:         0x0000000000000010
24     Entries:
25       - Tag:             DT_STRSZ
26         Value:           0x0000000000000001
27       - Tag:             DT_STRTAB
28         Value:           0x0000000000000000
29       - Tag:             DT_SYMTAB
30         Value:           0x0000000000000000
31       - Tag:             DT_NULL
32         Value:           0x0000000000000000
33 ProgramHeaders:
34   - Type:     PT_LOAD
35     Flags:    [ PF_R ]
36     VAddr:    0x0000
37     Align:    8
38     FirstSec: .dynstr
39     LastSec:  .dynamic
40   - Type:     PT_DYNAMIC
41     Flags:    [ PF_X, PF_R ]
42     VAddr:    0x0008
43     FirstSec: .dynamic
44     LastSec:  .dynamic
46 # CHECK:      --- !ifs-v1
47 # CHECK-NEXT: IfsVersion: {{[1-9]\d*\.(0|([1-9]\d*))}}
48 # CHECK-NEXT: Target: [[TARGET]]
49 # CHECK-NEXT: Symbols: []
50 # CHECK-NEXT: ...
52 # HINTERR: error: Triple hint does not match the actual [[MSG]]
54 # RUN: yaml2obj --docnum=1 %s -o %t
55 # RUN: not llvm-ifs --input-format=ELF --output-ifs=%t.tbe --hint-ifs-target="aarch64-linux-gnu" %t 2>&1 | FileCheck %s -DMSG=architecture --check-prefix=HINTERR
57 --- !ELF
58 FileHeader:
59   Class:           ELFCLASS64
60   Data:            ELFDATA2MSB
61   Type:            ET_DYN
62   Machine:         EM_X86_64
63 Sections:
64   - Name:            .dynstr
65     Type:            SHT_STRTAB
66     Flags:           [ SHF_ALLOC ]
67     Address:         0x0000
68     Content:         "00"
69   - Name:            .dynamic
70     Type:            SHT_DYNAMIC
71     Flags:           [ SHF_ALLOC ]
72     Address:         0x0000000000000008
73     Link:            .dynstr
74     AddressAlign:    0x0000000000000008
75     EntSize:         0x0000000000000010
76     Entries:
77       - Tag:             DT_STRSZ
78         Value:           0x0000000000000001
79       - Tag:             DT_STRTAB
80         Value:           0x0000000000000000
81       - Tag:             DT_SYMTAB
82         Value:           0x0000000000000000
83       - Tag:             DT_NULL
84         Value:           0x0000000000000000
85 ProgramHeaders:
86   - Type:     PT_LOAD
87     Flags:    [ PF_R ]
88     VAddr:    0x0000
89     Align:    8
90     FirstSec: .dynstr
91     LastSec:  .dynamic
92   - Type:     PT_DYNAMIC
93     Flags:    [ PF_X, PF_R ]
94     VAddr:    0x0008
95     FirstSec: .dynamic
96     LastSec:  .dynamic
98 # RUN: yaml2obj --docnum=2 %s -o %t
99 # RUN: not llvm-ifs --input-format=ELF --output-ifs=%t.tbe --hint-ifs-target="x86_64-unknown-linux-gnu" %t 2>&1 | FileCheck %s -DMSG="endianness" --check-prefix=HINTERR
101 --- !ELF
102 FileHeader:
103   Class:           ELFCLASS32
104   Data:            ELFDATA2LSB
105   Type:            ET_DYN
106   Machine:         EM_X86_64
107 Sections:
108   - Name:            .dynstr
109     Type:            SHT_STRTAB
110     Flags:           [ SHF_ALLOC ]
111     Address:         0x0000
112     Content:         "00"
113   - Name:            .dynamic
114     Type:            SHT_DYNAMIC
115     Flags:           [ SHF_ALLOC ]
116     Address:         0x0000000000000008
117     Link:            .dynstr
118     AddressAlign:    0x0000000000000008
119     EntSize:         0x0000000000000010
120     Entries:
121       - Tag:             DT_STRSZ
122         Value:           0x0000000000000001
123       - Tag:             DT_STRTAB
124         Value:           0x0000000000000000
125       - Tag:             DT_SYMTAB
126         Value:           0x0000000000000000
127       - Tag:             DT_NULL
128         Value:           0x0000000000000000
129 ProgramHeaders:
130   - Type:     PT_LOAD
131     Flags:    [ PF_R ]
132     VAddr:    0x0000
133     Align:    8
134     FirstSec: .dynstr
135     LastSec:  .dynamic
136   - Type:     PT_DYNAMIC
137     Flags:    [ PF_X, PF_R ]
138     VAddr:    0x0008
139     FirstSec: .dynamic
140     LastSec:  .dynamic
142 # RUN: yaml2obj --docnum=3 %s -o %t
143 # RUN: not llvm-ifs --input-format=ELF --output-ifs=%t.tbe --hint-ifs-target="x86_64-unknown-linux-gnu" %t 2>&1 | FileCheck %s -DMSG="bit width" --check-prefix=HINTERR