1## Check how obj2yaml dumps SHT_MIPS_ABIFLAGS sections.
2
3# RUN: yaml2obj %s -o %t
4# RUN: obj2yaml %t | FileCheck %s
5
6# CHECK:      Sections:
7# CHECK-NEXT:   - Name:         .MIPS.abiflags
8# CHECK-NEXT:     Type:         SHT_MIPS_ABIFLAGS
9# CHECK-NEXT:     AddressAlign: 0x8
10# CHECK-NEXT:     EntSize:      0x18
11# CHECK-NEXT:     ISA:          MIPS64
12# CHECK-NEXT:     ISARevision:  0x5
13# CHECK-NEXT:     ISAExtension: EXT_OCTEON3
14# CHECK-NEXT:     ASEs:         [ DSP, DSPR2, VIRT ]
15# CHECK-NEXT:     FpABI:        FP_DOUBLE
16# CHECK-NEXT:     GPRSize:      REG_64
17# CHECK-NEXT:     CPR1Size:     REG_64
18# CHECK-NEXT:     Flags1:       [ ODDSPREG ]
19# CHECK-NEXT: ...
20
21--- !ELF
22FileHeader:
23  Class:   ELFCLASS64
24  Data:    ELFDATA2MSB
25  Type:    ET_REL
26  Machine: EM_MIPS
27Sections:
28  - Name:         .MIPS.abiflags
29    Type:         SHT_MIPS_ABIFLAGS
30    AddressAlign: 8
31    Version:      0
32    ISA:          MIPS64
33    ISARevision:  5
34    ISAExtension: EXT_OCTEON3
35    ASEs:         [ DSP, DSPR2, VIRT ]
36    FpABI:        FP_DOUBLE
37    GPRSize:      REG_64
38    CPR1Size:     REG_64
39    CPR2Size:     REG_NONE
40    Flags1:       [ ODDSPREG ]
41    Flags2:       0x0
42
43## Check how we dump the SHT_MIPS_ABIFLAGS (0x7000002a) section when
44## the machine type is not EM_MIPS. It is dumped as a regular
45## section of an unknown type.
46
47# RUN: yaml2obj %s --docnum=2 -DMACHINE=EM_NONE -o %t2.notmips
48# RUN: obj2yaml %t2.notmips | FileCheck %s --check-prefix=NOT-MIPS
49
50# RUN: yaml2obj %s --docnum=2 -DMACHINE=EM_MIPS -o %t2.mips
51# RUN: obj2yaml %t2.mips | FileCheck %s --check-prefix=MIPS
52
53# MIPS:      - Name: .MIPS.abiflags
54# MIPS-NEXT:   Type: SHT_MIPS_ABIFLAGS
55# MIPS-NEXT:   ISA:  0x0
56# MIPS-NEXT: ...
57
58# NOT-MIPS:      - Name:    .MIPS.abiflags
59# NOT-MIPS-NEXT:   Type:    0x7000002A
60# NOT-MIPS-NEXT:   Content: '000000000000000000000000000000000000000000000000'
61# NOT-MIPS-NEXT: ...
62
63--- !ELF
64FileHeader:
65  Class:   ELFCLASS64
66  Data:    ELFDATA2MSB
67  Type:    ET_REL
68  Machine: [[MACHINE]]
69Sections:
70  - Name:   .MIPS.abiflags
71    Type:   SHT_PROGBITS
72    ShType: 0x7000002a ## SHT_MIPS_ABIFLAGS.
73    Size:   0x18
74