1## Test how yaml2obj creates SHT_MIPS_ABIFLAGS sections.
2
3# RUN: yaml2obj %s -o %t
4# RUN: llvm-readobj -A %t | FileCheck %s
5
6# CHECK:      MIPS ABI Flags {
7# CHECK-NEXT:   Version: 0
8# CHECK-NEXT:   ISA: MIPS64r5
9# CHECK-NEXT:   ISA Extension: Cavium Networks Octeon3 (0x13)
10# CHECK-NEXT:   ASEs [ (0x103)
11# CHECK-NEXT:     DSP (0x1)
12# CHECK-NEXT:     DSPR2 (0x2)
13# CHECK-NEXT:     VZ (0x100)
14# CHECK-NEXT:   ]
15# CHECK-NEXT:   FP ABI: Hard float (double precision) (0x1)
16# CHECK-NEXT:   GPR size: 64
17# CHECK-NEXT:   CPR1 size: 64
18# CHECK-NEXT:   CPR2 size: 0
19# CHECK-NEXT:   Flags 1 [ (0x1)
20# CHECK-NEXT:     ODDSPREG (0x1)
21# CHECK-NEXT:   ]
22# CHECK-NEXT:   Flags 2: 0x0
23# CHECK-NEXT: }
24
25--- !ELF
26FileHeader:
27  Class:   ELFCLASS64
28  Data:    ELFDATA2MSB
29  Type:    ET_REL
30  Machine: [[MACHINE=EM_MIPS]]
31Sections:
32  - Name:         .MIPS.abiflags
33    Type:         SHT_MIPS_ABIFLAGS
34    AddressAlign: 8
35    Version:      0
36    ISA:          MIPS64
37    ISARevision:  5
38    ISAExtension: EXT_OCTEON3
39    ASEs:         [ DSP, DSPR2, VIRT ]
40    FpABI:        FP_DOUBLE
41    GPRSize:      REG_64
42    CPR1Size:     REG_64
43    CPR2Size:     REG_NONE
44    Flags1:       [ ODDSPREG ]
45    Flags2:       0x0
46    Content:     [[CONTENT=<none>]]
47    Size:        [[SIZE=<none>]]
48
49## Check we don't recognize the SHT_MIPS_ABIFLAGS section for non-MIPS targets.
50
51# RUN: not yaml2obj %s -DMACHINE=EM_NONE 2>&1 | FileCheck %s --check-prefix=ERR
52
53# ERR:      error: invalid hex32 number
54# ERR-NEXT: Type: SHT_MIPS_ABIFLAGS
55
56## Document we don't support the "Content" key yet.
57
58# RUN: not yaml2obj %s -DCONTENT="'00'" 2>&1 | FileCheck %s --check-prefix=ERR-CONTENT
59
60# ERR-CONTENT: error: "Content" key is not implemented for SHT_MIPS_ABIFLAGS section
61
62## Document we don't support the "Size" key yet.
63
64# RUN: not yaml2obj %s -DSIZE=0 2>&1 | FileCheck %s --check-prefix=ERR-SIZE
65
66# ERR-SIZE: error: "Size" key is not implemented for SHT_MIPS_ABIFLAGS section
67