1 ## This is a test to test how the OS/ABI identification field (EI_OSABI) of an ELF file header is dumped.
3 ## EI_OSABI is set to ELFOSABI_NONE.
4 # RUN: yaml2obj %s -DOSABI=ELFOSABI_NONE -o %t.osabi.none
5 # RUN: llvm-readobj --file-headers %t.osabi.none | FileCheck %s --match-full-lines --check-prefix=OSABI-NONE-LLVM
6 # RUN: llvm-readelf --file-headers %t.osabi.none | FileCheck %s --match-full-lines --check-prefix=OSABI-NONE-GNU
8 # OSABI-NONE-LLVM: OS/ABI: SystemV (0x0)
9 # OSABI-NONE-GNU: OS/ABI: UNIX - System V
16 Machine: [[MACHINE=<none>]]
19 ## EI_OSABI is set to ELFOSABI_HPUX.
20 # RUN: yaml2obj %s -DOSABI=ELFOSABI_HPUX -o %t.osabi.hpux
21 # RUN: llvm-readobj --file-headers %t.osabi.hpux | FileCheck %s --match-full-lines --check-prefix=OSABI-HPUX-LLVM
22 # RUN: llvm-readelf --file-headers %t.osabi.hpux | FileCheck %s --match-full-lines --check-prefix=OSABI-HPUX-GNU
24 # OSABI-HPUX-LLVM: OS/ABI: HPUX (0x1)
25 # OSABI-HPUX-GNU: OS/ABI: UNIX - HP-UX
27 ## EI_OSABI is set to ELFOSABI_NETBSD.
28 # RUN: yaml2obj %s -DOSABI=ELFOSABI_NETBSD -o %t.osabi.netbsd
29 # RUN: llvm-readobj --file-headers %t.osabi.netbsd | FileCheck %s --match-full-lines --check-prefix=OSABI-NETBSD-LLVM
30 # RUN: llvm-readelf --file-headers %t.osabi.netbsd | FileCheck %s --match-full-lines --check-prefix=OSABI-NETBSD-GNU
32 # OSABI-NETBSD-LLVM: OS/ABI: NetBSD (0x2)
33 # OSABI-NETBSD-GNU: OS/ABI: UNIX - NetBSD
35 ## EI_OSABI is set to ELFOSABI_LINUX.
36 # RUN: yaml2obj %s -DOSABI=ELFOSABI_LINUX -o %t.osabi.linux
37 # RUN: llvm-readobj --file-headers %t.osabi.linux | FileCheck %s --match-full-lines --check-prefix=OSABI-LINUX-LLVM
38 # RUN: llvm-readelf --file-headers %t.osabi.linux | FileCheck %s --match-full-lines --check-prefix=OSABI-LINUX-GNU
40 # OSABI-LINUX-LLVM: OS/ABI: GNU/Linux (0x3)
41 # OSABI-LINUX-GNU: OS/ABI: UNIX - GNU
43 ## EI_OSABI is set to ELFOSABI_HURD.
44 # RUN: yaml2obj %s -DOSABI=ELFOSABI_HURD -o %t.osabi.hurd
45 # RUN: llvm-readobj --file-headers %t.osabi.hurd | FileCheck %s --match-full-lines --check-prefix=OSABI-HURD-LLVM
46 # RUN: llvm-readelf --file-headers %t.osabi.hurd | FileCheck %s --match-full-lines --check-prefix=OSABI-HURD-GNU
48 # OSABI-HURD-LLVM: OS/ABI: GNU/Hurd (0x4)
49 # OSABI-HURD-GNU: OS/ABI: GNU/Hurd
51 ## EI_OSABI is set to ELFOSABI_SOLARIS.
52 # RUN: yaml2obj %s -DOSABI=ELFOSABI_SOLARIS -o %t.osabi.solaris
53 # RUN: llvm-readobj --file-headers %t.osabi.solaris | FileCheck %s --match-full-lines --check-prefix=OSABI-SOLARIS-LLVM
54 # RUN: llvm-readelf --file-headers %t.osabi.solaris | FileCheck %s --match-full-lines --check-prefix=OSABI-SOLARIS-GNU
56 # OSABI-SOLARIS-LLVM: OS/ABI: Solaris (0x6)
57 # OSABI-SOLARIS-GNU: OS/ABI: UNIX - Solaris
59 ## EI_OSABI is set to ELFOSABI_AIX.
60 # RUN: yaml2obj %s -DOSABI=ELFOSABI_AIX -o %t.osabi.aix
61 # RUN: llvm-readobj --file-headers %t.osabi.aix | FileCheck %s --match-full-lines --check-prefix=OSABI-AIX-LLVM
62 # RUN: llvm-readelf --file-headers %t.osabi.aix | FileCheck %s --match-full-lines --check-prefix=OSABI-AIX-GNU
64 # OSABI-AIX-LLVM: OS/ABI: AIX (0x7)
65 # OSABI-AIX-GNU: OS/ABI: UNIX - AIX
67 ## EI_OSABI is set to ELFOSABI_IRIX.
68 # RUN: yaml2obj %s -DOSABI=ELFOSABI_IRIX -o %t.osabi.irix
69 # RUN: llvm-readobj --file-headers %t.osabi.irix | FileCheck %s --match-full-lines --check-prefix=OSABI-IRIX-LLVM
70 # RUN: llvm-readelf --file-headers %t.osabi.irix | FileCheck %s --match-full-lines --check-prefix=OSABI-IRIX-GNU
72 # OSABI-IRIX-LLVM: OS/ABI: IRIX (0x8)
73 # OSABI-IRIX-GNU: OS/ABI: UNIX - IRIX
75 ## EI_OSABI is set to ELFOSABI_FREEBSD.
76 # RUN: yaml2obj %s -DOSABI=ELFOSABI_FREEBSD -o %t.osabi.freebsd
77 # RUN: llvm-readobj --file-headers %t.osabi.freebsd | FileCheck %s --match-full-lines --check-prefix=OSABI-FREEBSD-LLVM
78 # RUN: llvm-readelf --file-headers %t.osabi.freebsd | FileCheck %s --match-full-lines --check-prefix=OSABI-FREEBSD-GNU
80 # OSABI-FREEBSD-LLVM: OS/ABI: FreeBSD (0x9)
81 # OSABI-FREEBSD-GNU: OS/ABI: UNIX - FreeBSD
83 ## EI_OSABI is set to ELFOSABI_TRU64.
84 # RUN: yaml2obj %s -DOSABI=ELFOSABI_TRU64 -o %t.osabi.tru64
85 # RUN: llvm-readobj --file-headers %t.osabi.tru64 | FileCheck %s --match-full-lines --check-prefix=OSABI-TRU64-LLVM
86 # RUN: llvm-readelf --file-headers %t.osabi.tru64 | FileCheck %s --match-full-lines --check-prefix=OSABI-TRU64-GNU
88 # OSABI-TRU64-LLVM: OS/ABI: TRU64 (0xA)
89 # OSABI-TRU64-GNU: OS/ABI: UNIX - TRU64
91 ## EI_OSABI is set to ELFOSABI_MODESTO.
92 # RUN: yaml2obj %s -DOSABI=ELFOSABI_MODESTO -o %t.osabi.modesto
93 # RUN: llvm-readobj --file-headers %t.osabi.modesto | FileCheck %s --match-full-lines --check-prefix=OSABI-MODESTO-LLVM
94 # RUN: llvm-readelf --file-headers %t.osabi.modesto | FileCheck %s --match-full-lines --check-prefix=OSABI-MODESTO-GNU
96 # OSABI-MODESTO-LLVM: OS/ABI: Modesto (0xB)
97 # OSABI-MODESTO-GNU: OS/ABI: Novell - Modesto
99 ## EI_OSABI is set to ELFOSABI_OPENBSD.
100 # RUN: yaml2obj %s -DOSABI=ELFOSABI_OPENBSD -o %t.osabi.openbsd
101 # RUN: llvm-readobj --file-headers %t.osabi.openbsd | FileCheck %s --match-full-lines --check-prefix=OSABI-OPENBSD-LLVM
102 # RUN: llvm-readelf --file-headers %t.osabi.openbsd | FileCheck %s --match-full-lines --check-prefix=OSABI-OPENBSD-GNU
104 # OSABI-OPENBSD-LLVM: OS/ABI: OpenBSD (0xC)
105 # OSABI-OPENBSD-GNU: OS/ABI: UNIX - OpenBSD
107 ## EI_OSABI is set to ELFOSABI_OPENVMS.
108 # RUN: yaml2obj %s -DOSABI=ELFOSABI_OPENVMS -o %t.osabi.openvms
109 # RUN: llvm-readobj --file-headers %t.osabi.openvms | FileCheck %s --match-full-lines --check-prefix=OSABI-OPENVMS-LLVM
110 # RUN: llvm-readelf --file-headers %t.osabi.openvms | FileCheck %s --match-full-lines --check-prefix=OSABI-OPENVMS-GNU
112 # OSABI-OPENVMS-LLVM: OS/ABI: OpenVMS (0xD)
113 # OSABI-OPENVMS-GNU: OS/ABI: VMS - OpenVMS
115 ## EI_OSABI is set to ELFOSABI_NSK.
116 # RUN: yaml2obj %s -DOSABI=ELFOSABI_NSK -o %t.osabi.nsk
117 # RUN: llvm-readobj --file-headers %t.osabi.nsk | FileCheck %s --match-full-lines --check-prefix=OSABI-NSK-LLVM
118 # RUN: llvm-readelf --file-headers %t.osabi.nsk | FileCheck %s --match-full-lines --check-prefix=OSABI-NSK-GNU
120 # OSABI-NSK-LLVM: OS/ABI: NSK (0xE)
121 # OSABI-NSK-GNU: OS/ABI: HP - Non-Stop Kernel
123 ## EI_OSABI is set to ELFOSABI_AROS.
124 # RUN: yaml2obj %s -DOSABI=ELFOSABI_AROS -o %t.osabi.aros
125 # RUN: llvm-readobj --file-headers %t.osabi.aros | FileCheck %s --match-full-lines --check-prefix=OSABI-AROS-LLVM
126 # RUN: llvm-readelf --file-headers %t.osabi.aros | FileCheck %s --match-full-lines --check-prefix=OSABI-AROS-GNU
128 # OSABI-AROS-LLVM: OS/ABI: AROS (0xF)
129 # OSABI-AROS-GNU: OS/ABI: AROS
131 ## EI_OSABI is set to ELFOSABI_FENIXOS.
132 # RUN: yaml2obj %s -DOSABI=ELFOSABI_FENIXOS -o %t.osabi.fenixos
133 # RUN: llvm-readobj --file-headers %t.osabi.fenixos | FileCheck %s --match-full-lines --check-prefix=OSABI-FENIXOS-LLVM
134 # RUN: llvm-readelf --file-headers %t.osabi.fenixos | FileCheck %s --match-full-lines --check-prefix=OSABI-FENIXOS-GNU
136 # OSABI-FENIXOS-LLVM: OS/ABI: FenixOS (0x10)
137 # OSABI-FENIXOS-GNU: OS/ABI: FenixOS
139 ## EI_OSABI is set to ELFOSABI_CLOUDABI.
140 # RUN: yaml2obj %s -DOSABI=ELFOSABI_CLOUDABI -o %t.osabi.cloudabi
141 # RUN: llvm-readobj --file-headers %t.osabi.cloudabi | FileCheck %s --match-full-lines --check-prefix=OSABI-CLOUDABI-LLVM
142 # RUN: llvm-readelf --file-headers %t.osabi.cloudabi | FileCheck %s --match-full-lines --check-prefix=OSABI-CLOUDABI-GNU
144 # OSABI-CLOUDABI-LLVM: OS/ABI: CloudABI (0x11)
145 # OSABI-CLOUDABI-GNU: OS/ABI: CloudABI
147 ## EI_OSABI is set to ELFOSABI_STANDALONE.
148 # RUN: yaml2obj %s -DOSABI=ELFOSABI_STANDALONE -o %t.osabi.standalone
149 # RUN: llvm-readobj --file-headers %t.osabi.standalone | FileCheck %s --match-full-lines --check-prefix=OSABI-STANDALONE-LLVM
150 # RUN: llvm-readelf --file-headers %t.osabi.standalone | FileCheck %s --match-full-lines --check-prefix=OSABI-STANDALONE-GNU
152 # OSABI-STANDALONE-LLVM: OS/ABI: Standalone (0xFF)
153 # OSABI-STANDALONE-GNU: OS/ABI: Standalone App
155 ## EI_OSABI is set to an arbitrary value which is not supported by llvm-readobj/llvm-readelf.
156 # RUN: yaml2obj %s -DOSABI=0xFE -o %t.osabi.unknown
157 # RUN: llvm-readobj --file-headers %t.osabi.unknown | FileCheck %s --match-full-lines --check-prefix=OSABI-UNKNOWN-LLVM
158 # RUN: llvm-readelf --file-headers %t.osabi.unknown | FileCheck %s --match-full-lines --check-prefix=OSABI-UNKNOWN-GNU
160 # OSABI-UNKNOWN-LLVM: OS/ABI: 0xFE
161 # OSABI-UNKNOWN-GNU: OS/ABI: fe
163 ## Check all EM_AMDGPU specific values.
165 # RUN: yaml2obj %s -DOSABI=ELFOSABI_AMDGPU_HSA -DMACHINE=EM_AMDGPU -o %t.osabi.amd.hsa
166 # RUN: llvm-readobj --file-headers %t.osabi.amd.hsa | FileCheck %s --match-full-lines --check-prefix=OSABI-AMDHSA-LLVM
167 # RUN: llvm-readelf --file-headers %t.osabi.amd.hsa | FileCheck %s --match-full-lines --check-prefix=OSABI-AMDHSA-GNU
169 # OSABI-AMDHSA-LLVM: OS/ABI: AMDGPU_HSA (0x40)
170 # OSABI-AMDHSA-GNU: OS/ABI: AMDGPU - HSA
172 # RUN: yaml2obj %s -DOSABI=ELFOSABI_AMDGPU_PAL -DMACHINE=EM_AMDGPU -o %t.osabi.amd.pal
173 # RUN: llvm-readobj --file-headers %t.osabi.amd.pal | FileCheck %s --match-full-lines --check-prefix=OSABI-AMDPAL-LLVM
174 # RUN: llvm-readelf --file-headers %t.osabi.amd.pal | FileCheck %s --match-full-lines --check-prefix=OSABI-AMDPAL-GNU
176 # OSABI-AMDPAL-LLVM: OS/ABI: AMDGPU_PAL (0x41)
177 # OSABI-AMDPAL-GNU: OS/ABI: AMDGPU - PAL
179 # RUN: yaml2obj %s -DOSABI=ELFOSABI_AMDGPU_MESA3D -DMACHINE=EM_AMDGPU -o %t.osabi.amd.mesa3d
180 # RUN: llvm-readobj --file-headers %t.osabi.amd.mesa3d | FileCheck %s --match-full-lines --check-prefix=OSABI-AMDMESA3D-LLVM
181 # RUN: llvm-readelf --file-headers %t.osabi.amd.mesa3d | FileCheck %s --match-full-lines --check-prefix=OSABI-AMDMESA3D-GNU
183 # OSABI-AMDMESA3D-LLVM: OS/ABI: AMDGPU_MESA3D (0x42)
184 # OSABI-AMDMESA3D-GNU: OS/ABI: AMDGPU - MESA3D
186 # Check all EM_ARM specific values.
188 # RUN: yaml2obj %s -DOSABI=ELFOSABI_ARM -DMACHINE=EM_ARM -o %t.osabi.arm
189 # RUN: llvm-readobj --file-headers %t.osabi.arm | FileCheck %s --match-full-lines --check-prefix=OSABI-ARM-LLVM
190 # RUN: llvm-readelf --file-headers %t.osabi.arm | FileCheck %s --match-full-lines --check-prefix=OSABI-ARM-GNU
192 # OSABI-ARM-LLVM: OS/ABI: ARM (0x61)
193 # OSABI-ARM-GNU: OS/ABI: ARM
195 # RUN: yaml2obj %s -DOSABI=ELFOSABI_ARM_FDPIC -DMACHINE=EM_ARM -o %t.osabi.arm_fdpic
196 # RUN: llvm-readobj --file-headers %t.osabi.arm_fdpic | FileCheck %s --match-full-lines --check-prefix=OSABI-ARMFDPIC-LLVM
197 # RUN: llvm-readelf --file-headers %t.osabi.arm_fdpic | FileCheck %s --match-full-lines --check-prefix=OSABI-ARMFDPIC-GNU
199 # OSABI-ARMFDPIC-LLVM: OS/ABI: ARM FDPIC (0x41)
200 # OSABI-ARMFDPIC-GNU: OS/ABI: ARM FDPIC
202 ## Check all EM_TI_C6000 specific values.
204 # RUN: yaml2obj %s -DOSABI=ELFOSABI_C6000_ELFABI -DMACHINE=EM_TI_C6000 -o %t.osabi.c6000.elfabi
205 # RUN: llvm-readobj --file-headers %t.osabi.c6000.elfabi | FileCheck %s --match-full-lines --check-prefix=OSABI-C6000ELFABI-LLVM
206 # RUN: llvm-readelf --file-headers %t.osabi.c6000.elfabi | FileCheck %s --match-full-lines --check-prefix=OSABI-C6000ELFABI-GNU
208 # OSABI-C6000ELFABI-LLVM: OS/ABI: C6000_ELFABI (0x40)
209 # OSABI-C6000ELFABI-GNU: OS/ABI: 40
211 # RUN: yaml2obj %s -DOSABI=ELFOSABI_C6000_LINUX -DMACHINE=EM_TI_C6000 -o %t.osabi.c6000.linux
212 # RUN: llvm-readobj --file-headers %t.osabi.c6000.linux | FileCheck %s --match-full-lines --check-prefix=OSABI-C6000LINUX-LLVM
213 # RUN: llvm-readelf --file-headers %t.osabi.c6000.linux | FileCheck %s --match-full-lines --check-prefix=OSABI-C6000LINUX-GNU
215 # OSABI-C6000LINUX-LLVM: OS/ABI: C6000_LINUX (0x41)
216 # OSABI-C6000LINUX-GNU: OS/ABI: 41