1 ## Check yaml2obj is able to set an ABI version for an object.
3 ## Check that by default yaml2obj emits ELFOSABI_NONE (0) for ABI version.
4 # RUN: yaml2obj %s --docnum=1 -o %t.default
5 # RUN: yaml2obj %s --docnum=2 -o %t.none
6 # RUN: llvm-readobj --file-headers %t.none | FileCheck %s --check-prefix=OSABI-NONE
7 # RUN: llvm-readobj --file-headers %t.default | FileCheck %s --check-prefix=OSABI-NONE
9 # OSABI-NONE: OS/ABI: SystemV (0x0)
24 # RUN: yaml2obj %s --docnum=3 -o %t.hpux
25 # RUN: llvm-readobj --file-headers %t.hpux | FileCheck %s --check-prefix=OSABI-HPUX
27 # OSABI-HPUX: OS/ABI: HPUX (0x1)
36 # RUN: yaml2obj %s --docnum=4 -o %t.netbsd
37 # RUN: llvm-readobj --file-headers %t.netbsd | FileCheck %s --check-prefix=OSABI-NETBSD
39 # OSABI-NETBSD: OS/ABI: NetBSD (0x2)
46 OSABI: ELFOSABI_NETBSD
48 ## Test ELFOSABI_GNU and ELFOSABI_LINUX (historical alias for ELFOSABI_GNU).
49 # RUN: yaml2obj %s --docnum=5 -o %t.gnu
50 # RUN: llvm-readobj --file-headers %t.gnu | FileCheck %s --check-prefix=OSABI-GNU
51 # RUN: yaml2obj %s --docnum=6 -o %t.gnu.alias
52 # RUN: llvm-readobj --file-headers %t.gnu.alias | FileCheck %s --check-prefix=OSABI-GNU
53 # OSABI-GNU: OS/ABI: GNU/Linux (0x3)
69 # RUN: yaml2obj %s --docnum=7 -o %t.hurd
70 # RUN: llvm-readobj --file-headers %t.hurd | FileCheck %s --check-prefix=OSABI-HURD
72 # OSABI-HURD: OS/ABI: GNU/Hurd (0x4)
81 # RUN: yaml2obj %s --docnum=8 -o %t.solaris
82 # RUN: llvm-readobj --file-headers %t.solaris | FileCheck %s --check-prefix=OSABI-SOLARIS
84 # OSABI-SOLARIS: OS/ABI: Solaris (0x6)
91 OSABI: ELFOSABI_SOLARIS
93 # RUN: yaml2obj %s --docnum=9 -o %t.aix
94 # RUN: llvm-readobj --file-headers %t.aix | FileCheck %s --check-prefix=OSABI-AIX
96 # OSABI-AIX: OS/ABI: AIX (0x7)
105 # RUN: yaml2obj %s --docnum=10 -o %t.irix
106 # RUN: llvm-readobj --file-headers %t.irix | FileCheck %s --check-prefix=OSABI-IRIX
108 # OSABI-IRIX: OS/ABI: IRIX (0x8)
117 # RUN: yaml2obj %s --docnum=11 -o %t.freebsd
118 # RUN: llvm-readobj --file-headers %t.freebsd | FileCheck %s --check-prefix=OSABI-FREEBSD
120 # OSABI-FREEBSD: OS/ABI: FreeBSD (0x9)
127 OSABI: ELFOSABI_FREEBSD
129 # RUN: yaml2obj %s --docnum=12 -o %t.tru64
130 # RUN: llvm-readobj --file-headers %t.tru64 | FileCheck %s --check-prefix=OSABI-TRU64
132 # OSABI-TRU64: OS/ABI: TRU64 (0xA)
139 OSABI: ELFOSABI_TRU64
141 # RUN: yaml2obj %s --docnum=13 -o %t.modesto
142 # RUN: llvm-readobj --file-headers %t.modesto | FileCheck %s --check-prefix=OSABI-MODESTO
144 # OSABI-MODESTO: OS/ABI: Modesto (0xB)
151 OSABI: ELFOSABI_MODESTO
153 # RUN: yaml2obj %s --docnum=14 -o %t.openbsd
154 # RUN: llvm-readobj --file-headers %t.openbsd | FileCheck %s --check-prefix=OSABI-OPENBSD
156 # OSABI-OPENBSD: OS/ABI: OpenBSD (0xC)
163 OSABI: ELFOSABI_OPENBSD
165 # RUN: yaml2obj %s --docnum=15 -o %t.openvms
166 # RUN: llvm-readobj --file-headers %t.openvms | FileCheck %s --check-prefix=OSABI-OPENVMS
168 # OSABI-OPENVMS: OS/ABI: OpenVMS (0xD)
175 OSABI: ELFOSABI_OPENVMS
177 # RUN: yaml2obj %s --docnum=16 -o %t.nsk
178 # RUN: llvm-readobj --file-headers %t.nsk | FileCheck %s --check-prefix=OSABI-NSK
180 # OSABI-NSK: OS/ABI: NSK (0xE)
189 # RUN: yaml2obj %s --docnum=17 -o %t.aros
190 # RUN: llvm-readobj --file-headers %t.aros | FileCheck %s --check-prefix=OSABI-AROS
192 # OSABI-AROS: OS/ABI: AROS (0xF)
201 # RUN: yaml2obj %s --docnum=18 -o %t.fenixos
202 # RUN: llvm-readobj --file-headers %t.fenixos | FileCheck %s --check-prefix=OSABI-FENIXOS
204 # OSABI-FENIXOS: OS/ABI: FenixOS (0x10)
211 OSABI: ELFOSABI_FENIXOS
213 # RUN: yaml2obj %s --docnum=19 -o %t.cloudabi
214 # RUN: llvm-readobj --file-headers %t.cloudabi | FileCheck %s --check-prefix=OSABI-CLOUDABI
216 # OSABI-CLOUDABI: OS/ABI: CloudABI (0x11)
223 OSABI: ELFOSABI_CLOUDABI
225 # RUN: yaml2obj %s --docnum=20 -o %t.amdhsa
226 # RUN: llvm-readobj --file-headers %t.amdhsa | FileCheck %s --check-prefix=OSABI-ARCHSPEC40
227 # RUN: yaml2obj %s --docnum=21 -o %t.c6000
228 # RUN: llvm-readobj --file-headers %t.c6000 | FileCheck %s --check-prefix=OSABI-ARCHSPEC40
230 # OSABI-ARCHSPEC40: OS/ABI: 0x40
237 OSABI: ELFOSABI_AMDGPU_HSA
244 OSABI: ELFOSABI_C6000_ELFABI
246 # RUN: yaml2obj %s --docnum=22 -o %t.amdpal
247 # RUN: llvm-readobj --file-headers %t.amdpal | FileCheck %s --check-prefix=OSABI-ARCHSPEC41
248 # RUN: yaml2obj %s --docnum=23 -o %t.c6000linux
249 # RUN: llvm-readobj --file-headers %t.c6000linux | FileCheck %s --check-prefix=OSABI-ARCHSPEC41
251 # OSABI-ARCHSPEC41: OS/ABI: 0x41
258 OSABI: ELFOSABI_AMDGPU_PAL
265 OSABI: ELFOSABI_C6000_LINUX
267 # RUN: yaml2obj %s --docnum=24 -o %t.amdmesa
268 # RUN: llvm-readobj --file-headers %t.amdmesa | FileCheck %s --check-prefix=OSABI-AMD-MESA3D
270 # OSABI-AMD-MESA3D: OS/ABI: 0x42
277 OSABI: ELFOSABI_AMDGPU_MESA3D
279 # RUN: yaml2obj %s --docnum=25 -o %t.arm
280 # RUN: llvm-readobj --file-headers %t.arm | FileCheck %s --check-prefix=OSABI-ARM
282 # OSABI-ARM: OS/ABI: 0x61
291 # RUN: yaml2obj %s --docnum=26 -o %t.standalone
292 # RUN: llvm-readobj --file-headers %t.standalone | FileCheck %s --check-prefix=OSABI-STANDALONE
294 # OSABI-STANDALONE: OS/ABI: Standalone (0xFF)
301 OSABI: ELFOSABI_STANDALONE
303 ## Test we can use an arbitrary number for OSABI.
304 # RUN: yaml2obj %s --docnum=27 -o %t.number
305 # RUN: llvm-readobj --file-headers %t.number | FileCheck %s --check-prefix=OSABI-NUMBER
306 # OSABI-NUMBER: OS/ABI: 0xFE