brintos

brintos / llvm-project-archived public Read only

0
0
Text · 16.9 KiB · 791e3e9 Raw
393 lines · plain
1## Check that we are able to dump the SHT_MIPS_ABIFLAGS section using -A properly.2 3## Show how the full output looks like, check the formatting and the output order.4# RUN: yaml2obj %s -DBITS=32 -DENCODE=LSB -o %t.le325# RUN: llvm-readelf -A %t.le32 | \6# RUN:   FileCheck %s --check-prefix=GNU --strict-whitespace --match-full-lines7# RUN: yaml2obj %s -DBITS=32 -DENCODE=MSB -o %t.be328# RUN: llvm-readelf -A %t.be32 | \9# RUN:   FileCheck %s --check-prefix=GNU --strict-whitespace --match-full-lines10# RUN: yaml2obj %s -DBITS=64 -DENCODE=LSB -o %t.le6411# RUN: llvm-readelf -A %t.le64 | \12# RUN:   FileCheck %s --check-prefix=GNU --strict-whitespace --match-full-lines13# RUN: yaml2obj %s -DBITS=64 -DENCODE=MSB -o %t.be6414# RUN: llvm-readelf -A %t.be64 | \15# RUN:   FileCheck %s --check-prefix=GNU --strict-whitespace --match-full-lines16 17#       GNU:MIPS ABI Flags Version: 10118# GNU-EMPTY:19#  GNU-NEXT:ISA: MIPS32r10220#  GNU-NEXT:GPR size: 3221#  GNU-NEXT:CPR1 size: 6422#  GNU-NEXT:CPR2 size: 12823#  GNU-NEXT:FP ABI: Soft float24#  GNU-NEXT:ISA Extension: Broadcom SB-125#  GNU-NEXT:ASEs: DSP, DSPR226#  GNU-NEXT:FLAGS 1: 0000000127#  GNU-NEXT:FLAGS 2: ffffffff28 29# RUN: llvm-readobj -A %t.le32 | FileCheck %s --check-prefix=LLVM30# RUN: llvm-readobj -A %t.be32 | FileCheck %s --check-prefix=LLVM31# RUN: llvm-readobj -A %t.le64 | FileCheck %s --check-prefix=LLVM32# RUN: llvm-readobj -A %t.be64 | FileCheck %s --check-prefix=LLVM33 34# LLVM:      MIPS ABI Flags {35# LLVM-NEXT:   Version: 10136# LLVM-NEXT:   ISA: MIPS32r10237# LLVM-NEXT:   ISA Extension: Broadcom SB-1 (0xC)38# LLVM-NEXT:   ASEs [ (0x3)39# LLVM-NEXT:     DSP (0x1)40# LLVM-NEXT:     DSPR2 (0x2)41# LLVM-NEXT:   ]42# LLVM-NEXT:   FP ABI: Soft float (0x3)43# LLVM-NEXT:   GPR size: 3244# LLVM-NEXT:   CPR1 size: 6445# LLVM-NEXT:   CPR2 size: 12846# LLVM-NEXT:   Flags 1 [ (0x1)47# LLVM-NEXT:     ODDSPREG (0x1)48# LLVM-NEXT:   ]49# LLVM-NEXT:   Flags 2: 0xFFFFFFFF50# LLVM-NEXT: }51 52--- !ELF53FileHeader:54  Class:   ELFCLASS[[BITS=64]]55  Data:    ELFDATA2[[ENCODE=LSB]]56  Type:    ET_REL57  Machine: EM_MIPS58Sections:59## Set arbitrary default values.60  - Name:         .MIPS.abiflags61    Type:         SHT_MIPS_ABIFLAGS62    Version:      [[VERSION=101]]63    ISA:          [[ISA=MIPS32]]64    ISARevision:  [[ISAREV=102]]65    ISAExtension: EXT_SB166    ASEs:         [ [[ASES=DSP,DSPR2]] ]67    FpABI:        [[FPABI=FP_SOFT]]68    GPRSize:      [[GPR=REG_32]]69    CPR1Size:     [[CPR1=REG_64]]70    CPR2Size:     [[CPR2=REG_128]]71    Flags1:       [ [[FLAG1=ODDSPREG]] ]72    Flags2:       [[FLAG2=0xffffffff]]73 74## Check that we are able to dump the version properly.75## Document we do not report warnings for any version.76# RUN: yaml2obj %s -DVERSION=0 -o %t.version.a77# RUN: llvm-readelf -A %t.version.a | \78# RUN:   FileCheck %s --check-prefix=GNU-VERSION-A --implicit-check-not=warning:79# RUN: llvm-readobj -A %t.version.a | \80# RUN:   FileCheck %s --check-prefix=LLVM-VERSION-A --implicit-check-not=warning:81 82# GNU-VERSION-A: MIPS ABI Flags Version: 083 84# LLVM-VERSION-A:      MIPS ABI Flags {85# LLVM-VERSION-A-NEXT:   Version: 086 87# RUN: yaml2obj %s -DVERSION=0xffff -o %t.version.b88# RUN: llvm-readelf -A %t.version.b | \89# RUN:   FileCheck %s --check-prefix=GNU-VERSION-B --implicit-check-not=warning:90# RUN: llvm-readobj -A %t.version.b | \91# RUN:   FileCheck %s --check-prefix=LLVM-VERSION-B --implicit-check-not=warning:92 93# GNU-VERSION-B: MIPS ABI Flags Version: 6553594 95# LLVM-VERSION-B:      MIPS ABI Flags {96# LLVM-VERSION-B-NEXT:   Version: 6553597 98## Check how we dump isa_level and isa_rev fields.99 100# RUN: yaml2obj %s -DISAREV=1 -DISA=MIPS1 -o %t.isa1101# RUN: llvm-readelf -A %t.isa1 | FileCheck %s --check-prefix=CHECK-ISA -DVAL=MIPS1102# RUN: llvm-readobj -A %t.isa1 | FileCheck %s --check-prefix=CHECK-ISA -DVAL=MIPS1103 104# CHECK-ISA: ISA: [[VAL]]{{$}}105 106# RUN: yaml2obj %s -DISAREV=1 -DISA=MIPS2 -o %t.isa2107# RUN: llvm-readelf -A %t.isa2 | FileCheck %s --check-prefix=CHECK-ISA -DVAL=MIPS2108# RUN: llvm-readobj -A %t.isa2 | FileCheck %s --check-prefix=CHECK-ISA -DVAL=MIPS2109 110# RUN: yaml2obj %s -DISAREV=1 -DISA=MIPS3 -o %t.isa3111# RUN: llvm-readelf -A %t.isa3 | FileCheck %s --check-prefix=CHECK-ISA -DVAL=MIPS3112# RUN: llvm-readobj -A %t.isa3 | FileCheck %s --check-prefix=CHECK-ISA -DVAL=MIPS3113 114# RUN: yaml2obj %s -DISAREV=1 -DISA=MIPS4 -o %t.isa4115# RUN: llvm-readelf -A %t.isa4 | FileCheck %s --check-prefix=CHECK-ISA -DVAL=MIPS4116# RUN: llvm-readobj -A %t.isa4 | FileCheck %s --check-prefix=CHECK-ISA -DVAL=MIPS4117 118# RUN: yaml2obj %s -DISAREV=1 -DISA=MIPS5 -o %t.isa5119# RUN: llvm-readelf -A %t.isa5 | FileCheck %s --check-prefix=CHECK-ISA -DVAL=MIPS5120# RUN: llvm-readobj -A %t.isa5 | FileCheck %s --check-prefix=CHECK-ISA -DVAL=MIPS5121 122# RUN: yaml2obj %s -DISAREV=1 -DISA=MIPS32 -o %t.isa32123# RUN: llvm-readelf -A %t.isa32 | FileCheck %s --check-prefix=CHECK-ISA -DVAL=MIPS32124# RUN: llvm-readobj -A %t.isa32 | FileCheck %s --check-prefix=CHECK-ISA -DVAL=MIPS32125 126# RUN: yaml2obj %s -DISAREV=1 -DISA=MIPS64 -o %t.isa64127# RUN: llvm-readelf -A %t.isa64 | FileCheck %s --check-prefix=CHECK-ISA -DVAL=MIPS64128# RUN: llvm-readobj -A %t.isa64 | FileCheck %s --check-prefix=CHECK-ISA -DVAL=MIPS64129 130## Check that isa_rev is only dumped when its value > 1.131# RUN: yaml2obj %s -DISAREV=2 -DISA=MIPS1 -o %t.isa1.r132# RUN: llvm-readelf -A %t.isa1.r | FileCheck %s --check-prefix=CHECK-ISA -DVAL=MIPS1r2133# RUN: llvm-readobj -A %t.isa1.r | FileCheck %s --check-prefix=CHECK-ISA -DVAL=MIPS1r2134 135## Check how we dump the gpr_size field.136 137# RUN: yaml2obj %s -DGPR=REG_NONE -o %t.gpr.none138# RUN: llvm-readelf -A %t.gpr.none | FileCheck %s --check-prefix=GPRSIZE -DVAL=0139# RUN: llvm-readobj -A %t.gpr.none | FileCheck %s --check-prefix=GPRSIZE -DVAL=0140 141# GPRSIZE: GPR size: [[VAL]]{{$}}142 143# RUN: yaml2obj %s -DGPR=REG_32 -o %t.gpr.32144# RUN: llvm-readelf -A %t.gpr.32 | FileCheck %s --check-prefix=GPRSIZE -DVAL=32145# RUN: llvm-readobj -A %t.gpr.32 | FileCheck %s --check-prefix=GPRSIZE -DVAL=32146 147# RUN: yaml2obj %s -DGPR=REG_64 -o %t.gpr.64148# RUN: llvm-readelf -A %t.gpr.64 | FileCheck %s --check-prefix=GPRSIZE -DVAL=64149# RUN: llvm-readobj -A %t.gpr.64 | FileCheck %s --check-prefix=GPRSIZE -DVAL=64150 151# RUN: yaml2obj %s -DGPR=REG_128 -o %t.gpr.128152# RUN: llvm-readelf -A %t.gpr.128 | FileCheck %s --check-prefix=GPRSIZE -DVAL=128153# RUN: llvm-readobj -A %t.gpr.128 | FileCheck %s --check-prefix=GPRSIZE -DVAL=128154 155## Check how we dump the cpr1_size field.156 157# RUN: yaml2obj %s -DCPR1=REG_NONE -o %t.cpr1.none158# RUN: llvm-readelf -A %t.cpr1.none | FileCheck %s --check-prefix=CPR1SIZE -DVAL=0159# RUN: llvm-readobj -A %t.cpr1.none | FileCheck %s --check-prefix=CPR1SIZE -DVAL=0160 161# CPR1SIZE: CPR1 size: [[VAL]]{{$}}162 163# RUN: yaml2obj %s -DCPR1=REG_32 -o %t.cpr1.32164# RUN: llvm-readelf -A %t.cpr1.32 | FileCheck %s --check-prefix=CPR1SIZE -DVAL=32165# RUN: llvm-readobj -A %t.cpr1.32 | FileCheck %s --check-prefix=CPR1SIZE -DVAL=32166 167# RUN: yaml2obj %s -DCPR1=REG_64 -o %t.cpr1.64168# RUN: llvm-readelf -A %t.cpr1.64 | FileCheck %s --check-prefix=CPR1SIZE -DVAL=64169# RUN: llvm-readobj -A %t.cpr1.64 | FileCheck %s --check-prefix=CPR1SIZE -DVAL=64170 171# RUN: yaml2obj %s -DCPR1=REG_128 -o %t.cpr1.128172# RUN: llvm-readelf -A %t.cpr1.128 | FileCheck %s --check-prefix=CPR1SIZE -DVAL=128173# RUN: llvm-readobj -A %t.cpr1.128 | FileCheck %s --check-prefix=CPR1SIZE -DVAL=128174 175## Check how we dump the cpr2_size field.176 177# RUN: yaml2obj %s -DCPR2=REG_NONE -o %t.cpr2.none178# RUN: llvm-readelf -A %t.cpr2.none | FileCheck %s --check-prefix=CPR2SIZE -DVAL=0179# RUN: llvm-readobj -A %t.cpr2.none | FileCheck %s --check-prefix=CPR2SIZE -DVAL=0180 181# CPR2SIZE: CPR2 size: [[VAL]]{{$}}182 183# RUN: yaml2obj %s -DCPR2=REG_32 -o %t.cpr2.32184# RUN: llvm-readelf -A %t.cpr2.32 | FileCheck %s --check-prefix=CPR2SIZE -DVAL=32185# RUN: llvm-readobj -A %t.cpr2.32 | FileCheck %s --check-prefix=CPR2SIZE -DVAL=32186 187# RUN: yaml2obj %s -DCPR2=REG_64 -o %t.cpr2.64188# RUN: llvm-readelf -A %t.cpr2.64 | FileCheck %s --check-prefix=CPR2SIZE -DVAL=64189# RUN: llvm-readobj -A %t.cpr2.64 | FileCheck %s --check-prefix=CPR2SIZE -DVAL=64190 191# RUN: yaml2obj %s -DCPR2=REG_128 -o %t.cpr2.128192# RUN: llvm-readelf -A %t.cpr2.128 | FileCheck %s --check-prefix=CPR2SIZE -DVAL=128193# RUN: llvm-readobj -A %t.cpr2.128 | FileCheck %s --check-prefix=CPR2SIZE -DVAL=128194 195## Check how we dump the fp_abi field.196 197# RUN: yaml2obj %s -DFPABI=FP_ANY -o %t.fpabi.any198# RUN: llvm-readelf -A %t.fpabi.any | FileCheck %s --check-prefix=FPABI-ANY199# RUN: llvm-readobj -A %t.fpabi.any | FileCheck %s --check-prefix=FPABI-ANY200 201# FPABI-ANY: FP ABI: Hard or soft float202 203# RUN: yaml2obj %s -DFPABI=FP_DOUBLE -o %t.fpabi.double204# RUN: llvm-readelf -A %t.fpabi.double | FileCheck %s --check-prefix=FPABI-DOUBLE205# RUN: llvm-readobj -A %t.fpabi.double | FileCheck %s --check-prefix=FPABI-DOUBLE206 207# FPABI-DOUBLE: FP ABI: Hard float (double precision)208 209# RUN: yaml2obj %s -DFPABI=FP_SINGLE -o %t.fpabi.single210# RUN: llvm-readelf -A %t.fpabi.single | FileCheck %s --check-prefix=FPABI-SINGLE211# RUN: llvm-readobj -A %t.fpabi.single | FileCheck %s --check-prefix=FPABI-SINGLE212 213# FPABI-SINGLE: FP ABI: Hard float (single precision)214 215# RUN: yaml2obj %s -DFPABI=FP_SOFT -o %t.fpabi.soft216# RUN: llvm-readelf -A %t.fpabi.soft | FileCheck %s --check-prefix=FPABI-SOFT217# RUN: llvm-readobj -A %t.fpabi.soft | FileCheck %s --check-prefix=FPABI-SOFT218 219# FPABI-SOFT: FP ABI: Soft float220 221# RUN: yaml2obj %s -DFPABI=FP_OLD_64 -o %t.fpabi.old64222# RUN: llvm-readelf -A %t.fpabi.old64 | FileCheck %s --check-prefix=FPABI-OLD64223# RUN: llvm-readobj -A %t.fpabi.old64 | FileCheck %s --check-prefix=FPABI-OLD64224 225# FPABI-OLD64: FP ABI: Hard float (MIPS32r2 64-bit FPU 12 callee-saved)226 227# RUN: yaml2obj %s -DFPABI=FP_XX -o %t.fpabi.xx228# RUN: llvm-readelf -A %t.fpabi.xx | FileCheck %s --check-prefix=FPABI-XX229# RUN: llvm-readobj -A %t.fpabi.xx | FileCheck %s --check-prefix=FPABI-XX230 231# FPABI-XX: FP ABI: Hard float (32-bit CPU, Any FPU)232 233# RUN: yaml2obj %s -DFPABI=FP_64 -o %t.fpabi.fp64234# RUN: llvm-readelf -A %t.fpabi.fp64 | FileCheck %s --check-prefix=FPABI-FP64235# RUN: llvm-readobj -A %t.fpabi.fp64 | FileCheck %s --check-prefix=FPABI-FP64236 237# FPABI-FP64: FP ABI: Hard float (32-bit CPU, 64-bit FPU)238 239# RUN: yaml2obj %s -DFPABI=FP_64A -o %t.fpabi.fp64a240# RUN: llvm-readelf -A %t.fpabi.fp64a | FileCheck %s --check-prefix=FPABI-FP64A241# RUN: llvm-readobj -A %t.fpabi.fp64a | FileCheck %s --check-prefix=FPABI-FP64A242 243# FPABI-FP64A: FP ABI: Hard float compat (32-bit CPU, 64-bit FPU)244 245## Check how we dump ASEs.246# RUN: yaml2obj %s -DASES="" -o %t.ases.no247# RUN: llvm-readelf -A %t.ases.no | FileCheck %s --check-prefix=FPABI-ASES-NONE-GNU248# RUN: llvm-readobj -A %t.ases.no | FileCheck %s --check-prefix=FPABI-ASES-NONE-LLVM249 250# FPABI-ASES-NONE-GNU: ASEs: None251 252# FPABI-ASES-NONE-LLVM:      ASEs [ (0x0)253# FPABI-ASES-NONE-LLVM-NEXT: ]254 255# RUN: yaml2obj %s -DASES="DSP,DSPR2,EVA,MCU,MDMX,MIPS3D,MT,SMARTMIPS,VIRT,MSA,MIPS16,MICROMIPS,XPA,CRC,GINV" -o %t.ases.all256# RUN: llvm-readelf -A %t.ases.all | FileCheck %s --check-prefix=FPABI-ASES-ALL-GNU257# RUN: llvm-readobj -A %t.ases.all | FileCheck %s --check-prefix=FPABI-ASES-ALL-LLVM258 259# FPABI-ASES-ALL-GNU: ASEs: DSP, DSPR2, Enhanced VA Scheme, MCU, MDMX, MIPS-3D, MT, SmartMIPS, VZ, MSA, MIPS16, microMIPS, XPA, CRC, GINV260 261# FPABI-ASES-ALL-LLVM:      ASEs [ (0x29FFF)262# FPABI-ASES-ALL-LLVM-NEXT:   CRC (0x8000)263# FPABI-ASES-ALL-LLVM-NEXT:   DSP (0x1)264# FPABI-ASES-ALL-LLVM-NEXT:   DSPR2 (0x2)265# FPABI-ASES-ALL-LLVM-NEXT:   Enhanced VA Scheme (0x4)266# FPABI-ASES-ALL-LLVM-NEXT:   GINV (0x20000)267# FPABI-ASES-ALL-LLVM-NEXT:   MCU (0x8)268# FPABI-ASES-ALL-LLVM-NEXT:   MDMX (0x10)269# FPABI-ASES-ALL-LLVM-NEXT:   MIPS-3D (0x20)270# FPABI-ASES-ALL-LLVM-NEXT:   MIPS16 (0x400)271# FPABI-ASES-ALL-LLVM-NEXT:   MSA (0x200)272# FPABI-ASES-ALL-LLVM-NEXT:   MT (0x40)273# FPABI-ASES-ALL-LLVM-NEXT:   SmartMIPS (0x80)274# FPABI-ASES-ALL-LLVM-NEXT:   VZ (0x100)275# FPABI-ASES-ALL-LLVM-NEXT:   XPA (0x1000)276# FPABI-ASES-ALL-LLVM-NEXT:   microMIPS (0x800)277# FPABI-ASES-ALL-LLVM-NEXT: ]278 279## Check how we dump the flags1 field.280 281# RUN: yaml2obj %s -DFLAG1="" -o %t.flag1.empty282# RUN: llvm-readelf -A %t.flag1.empty | FileCheck %s --check-prefix=FLAG1-EMPTY-GNU283# RUN: llvm-readobj -A %t.flag1.empty | FileCheck %s --check-prefix=FLAG1-EMPTY-LLVM284 285# FLAG1-EMPTY-GNU: FLAGS 1: 00000000286 287# FLAG1-EMPTY-LLVM:      Flags 1 [ (0x0)288# FLAG1-EMPTY-LLVM-NEXT: ]289 290# RUN: yaml2obj %s -DFLAG1="ODDSPREG" -o %t.flag1.all291# RUN: llvm-readelf -A %t.flag1.all | FileCheck %s --check-prefix=FLAG1-ALL-GNU292# RUN: llvm-readobj -A %t.flag1.all | FileCheck %s --check-prefix=FLAG1-ALL-LLVM293 294# FLAG1-ALL-GNU: FLAGS 1: 00000001295 296# FLAG1-ALL-LLVM:      Flags 1 [ (0x1)297# FLAG1-ALL-LLVM-NEXT:  ODDSPREG (0x1)298# FLAG1-ALL-LLVM-NEXT: ]299 300## Check how we dump the flags2 field.301 302# RUN: yaml2obj %s -DFLAG2=0x0 -o %t.flag2.empty303# RUN: llvm-readelf -A %t.flag2.empty | FileCheck %s --check-prefix=FLAG2-EMPTY-GNU304# RUN: llvm-readobj -A %t.flag2.empty | FileCheck %s --check-prefix=FLAG2-EMPTY-LLVM305 306# FLAG2-EMPTY-GNU:  FLAGS 2: 00000000307# FLAG2-EMPTY-LLVM: Flags 2: 0x0308 309# RUN: yaml2obj %s -DFLAG2=0xffffffff -o %t.flag2.all310# RUN: llvm-readelf -A %t.flag2.all | FileCheck %s --check-prefix=FLAG2-ALL-GNU311# RUN: llvm-readobj -A %t.flag2.all | FileCheck %s --check-prefix=FLAG2-ALL-LLVM312 313# FLAG2-ALL-GNU:  FLAGS 2: ffffffff314# FLAG2-ALL-LLVM: Flags 2: 0xFFFFFFF315 316## Check what we print when there is no .MIPS.abiflags section in the file.317# RUN: yaml2obj --docnum=2 %s -o %t.nosection318## Note: GNU readelf 2.31.1 prints nothing.319# RUN: llvm-readelf -A %t.nosection 2>&1 | \320# RUN:   FileCheck %s --check-prefix=NOSEC --implicit-check-not={{.}}321# RUN: llvm-readobj -A %t.nosection 2>&1 | \322# RUN:   FileCheck %s --check-prefixes=NOSEC,NOSEC-LLVM --implicit-check-not=warning:323 324# NOSEC-LLVM: There is no .MIPS.abiflags section in the file.325# NOSEC:      There is no .MIPS.options section in the file.326# NOSEC-NEXT: There is no .reginfo section in the file.327 328--- !ELF329FileHeader:330  Class:   ELFCLASS64331  Data:    ELFDATA2LSB332  Type:    ET_REL333  Machine: EM_MIPS334Sections: []335 336## Check we report a warning when we are unable to read the content of the .MIPS.abiflags section.337# RUN: yaml2obj --docnum=3 -DSHOFFSET=0xffffffff %s -o %t.err1338# RUN: llvm-readelf -A %t.err1 2>&1 | FileCheck %s -DFILE=%t.err1 --check-prefix=CONTENT-ERR339# RUN: llvm-readobj -A %t.err1 2>&1 | FileCheck %s -DFILE=%t.err1 --check-prefix=CONTENT-ERR340 341# CONTENT-ERR:      warning: '[[FILE]]': unable to read the .MIPS.abiflags section: section [index 2] has a sh_offset (0xffffffff) + sh_size (0x18) that is greater than the file size (0x2c0)342# CONTENT-ERR-NEXT: There is no .MIPS.options section in the file.343# CONTENT-ERR-NEXT: There is no .reginfo section in the file.344 345--- !ELF346FileHeader:347  Class:   ELFCLASS64348  Data:    ELFDATA2LSB349  Type:    ET_REL350  Machine: EM_MIPS351Sections:352  - Type:   SHT_PROGBITS353    ShName: [[NAME=<none>]]354  - Name:     .MIPS.abiflags355    Type:     SHT_MIPS_ABIFLAGS356    ISA:      MIPS32357    Offset:   0x100358    ShOffset: [[SHOFFSET=0x100]]359    ShSize:   [[SHSIZE=24]]360    ShName: [[ABIFLAGSNAME=<none>]]361  - Type:   SHT_PROGBITS362    ShName: [[NAME=<none>]]363 364## Check we report a warning when the .MIPS.abiflags section has an unexpected size.365# RUN: yaml2obj --docnum=3 -DSHSIZE=23 %s -o %t.err2366# RUN: llvm-readelf -A %t.err2 2>&1 | FileCheck %s -DFILE=%t.err2 --check-prefix=SIZE-ERR367# RUN: llvm-readobj -A %t.err2 2>&1 | FileCheck %s -DFILE=%t.err2 --check-prefix=SIZE-ERR368 369# SIZE-ERR:      warning: '[[FILE]]': unable to read the .MIPS.abiflags section: it has a wrong size (23)370# SIZE-ERR-NEXT: There is no .MIPS.options section in the file.371# SIZE-ERR-NEXT: There is no .reginfo section in the file.372 373## Check that we try to dump the .MIPS.abiflags section when we are able to locate it by name.374# RUN: yaml2obj --docnum=3 -DNAME=0xffff %s -o %t.err3375# RUN: llvm-readelf -A %t.err3 2>&1 | \376# RUN:   FileCheck %s -DFILE=%t.err3 --check-prefixes=NAME-ERR-FOUND,NAME-ERR-FOUND-GNU --implicit-check-not=warning:377# RUN: llvm-readobj -A %t.err3 2>&1 | \378# RUN:   FileCheck %s -DFILE=%t.err3 --check-prefixes=NAME-ERR-FOUND,NAME-ERR-FOUND-LLVM --implicit-check-not=warning:379 380# NAME-ERR-FOUND:           warning: '[[FILE]]': unable to read the name of SHT_PROGBITS section with index 1: a section [index 1] has an invalid sh_name (0xffff) offset which goes past the end of the section name string table381# NAME-ERR-FOUND-GNU-NEXT:  MIPS ABI Flags Version: 0382# NAME-ERR-FOUND-LLVM-NEXT: MIPS ABI Flags {383# NAME-ERR-FOUND:           warning: '[[FILE]]': unable to read the name of SHT_PROGBITS section with index 3: a section [index 3] has an invalid sh_name (0xffff) offset which goes past the end of the section name string table384 385## Check we report a warning when we are unable to find the .MIPS.abiflags section due to an error.386# RUN: yaml2obj --docnum=3 -DABIFLAGSNAME=0xffff %s -o %t.err4387# RUN: llvm-readelf -A %t.err4 2>&1 | \388# RUN:   FileCheck %s -DFILE=%t.err4 --check-prefix=NAME-ERR-NOTFOUND --implicit-check-not=warning: --implicit-check-not="MIPS ABI Flags"389# RUN: llvm-readobj -A %t.err4 2>&1 | \390# RUN:   FileCheck %s -DFILE=%t.err4 --check-prefix=NAME-ERR-NOTFOUND --implicit-check-not=warning: --implicit-check-not="MIPS ABI Flags"391 392# NAME-ERR-NOTFOUND: warning: '[[FILE]]': unable to read the name of SHT_MIPS_ABIFLAGS section with index 2: a section [index 2] has an invalid sh_name (0xffff) offset which goes past the end of the section name string table393