[llvm] 64f878d - [Object/yaml2obj/obj2yaml][test] - Split, cleanup and move MIPS abi-flags.yaml test. NFCI.
Georgii Rymar via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 25 02:05:09 PDT 2020
Author: Georgii Rymar
Date: 2020-09-25T12:04:55+03:00
New Revision: 64f878db5022cf9258ff308f15ad07d27c9ca4d9
URL: https://github.com/llvm/llvm-project/commit/64f878db5022cf9258ff308f15ad07d27c9ca4d9
DIFF: https://github.com/llvm/llvm-project/commit/64f878db5022cf9258ff308f15ad07d27c9ca4d9.diff
LOG: [Object/yaml2obj/obj2yaml][test] - Split, cleanup and move MIPS abi-flags.yaml test. NFCI.
We have the `Object/Mips/abi-flags.yaml` which tests how yaml2obj/obj2yaml
handle `SHT_MIPS_ABIFLAGS` sections.
This patch splits it into two tests: one for obj2yaml and one for yaml2obj
and moves the result to right places.
Differential revision: https://reviews.llvm.org/D88231
Added:
llvm/test/tools/obj2yaml/ELF/mips-abi-flags.yaml
llvm/test/tools/yaml2obj/ELF/mips-abi-flags.yaml
Modified:
Removed:
llvm/test/Object/Mips/abi-flags.yaml
################################################################################
diff --git a/llvm/test/Object/Mips/abi-flags.yaml b/llvm/test/Object/Mips/abi-flags.yaml
deleted file mode 100644
index 4fa09d179da0..000000000000
--- a/llvm/test/Object/Mips/abi-flags.yaml
+++ /dev/null
@@ -1,64 +0,0 @@
-# RUN: yaml2obj %s -o %t
-# RUN: llvm-readobj -A %t | FileCheck -check-prefix=OBJ %s
-# RUN: obj2yaml %t | FileCheck -check-prefix=YAML %s
-
-# OBJ: MIPS ABI Flags {
-# OBJ-NEXT: Version: 0
-# OBJ-NEXT: ISA: MIPS64r5
-# OBJ-NEXT: ISA Extension: Cavium Networks Octeon3 (0x13)
-# OBJ-NEXT: ASEs [ (0x103)
-# OBJ-NEXT: DSP (0x1)
-# OBJ-NEXT: DSPR2 (0x2)
-# OBJ-NEXT: VZ (0x100)
-# OBJ-NEXT: ]
-# OBJ-NEXT: FP ABI: Hard float (double precision) (0x1)
-# OBJ-NEXT: GPR size: 64
-# OBJ-NEXT: CPR1 size: 64
-# OBJ-NEXT: CPR2 size: 0
-# OBJ-NEXT: Flags 1 [ (0x1)
-# OBJ-NEXT: ODDSPREG (0x1)
-# OBJ-NEXT: ]
-# OBJ-NEXT: Flags 2: 0x0
-# OBJ-NEXT: }
-
-# YAML: Sections:
-# YAML-NEXT: - Name: .MIPS.abiflags
-# YAML-NEXT: Type: SHT_MIPS_ABIFLAGS
-# YAML-NEXT: AddressAlign: 0x0000000000000008
-# YAML-NEXT: EntSize: 0x0000000000000018
-# YAML-NEXT: ISA: MIPS64
-# YAML-NEXT: ISARevision: 0x05
-# YAML-NEXT: ISAExtension: EXT_OCTEON3
-# YAML-NEXT: ASEs: [ DSP, DSPR2, VIRT ]
-# YAML-NEXT: FpABI: FP_DOUBLE
-# YAML-NEXT: GPRSize: REG_64
-# YAML-NEXT: CPR1Size: REG_64
-# YAML-NEXT: Flags1: [ ODDSPREG ]
-
-!ELF
-FileHeader:
- Class: ELFCLASS64
- Data: ELFDATA2MSB
- Type: ET_REL
- Machine: EM_MIPS
-
-Sections:
-- Name: .MIPS.abiflags
- Type: SHT_MIPS_ABIFLAGS
- AddressAlign: 8
- Version: 0
- ISA: MIPS64
- ISARevision: 5
- ISAExtension: EXT_OCTEON3
- ASEs: [ DSP, DSPR2, VIRT ]
- FpABI: FP_DOUBLE
- GPRSize: REG_64
- CPR1Size: REG_64
- CPR2Size: REG_NONE
- Flags1: [ ODDSPREG ]
- Flags2: 0x0
-
-Symbols:
- - Name: .MIPS.abiflags
- Type: STT_SECTION
- Section: .MIPS.abiflags
diff --git a/llvm/test/tools/obj2yaml/ELF/mips-abi-flags.yaml b/llvm/test/tools/obj2yaml/ELF/mips-abi-flags.yaml
new file mode 100644
index 000000000000..e51e1c214ce7
--- /dev/null
+++ b/llvm/test/tools/obj2yaml/ELF/mips-abi-flags.yaml
@@ -0,0 +1,41 @@
+## Check how obj2yaml dumps SHT_MIPS_ABIFLAGS sections.
+
+# RUN: yaml2obj %s -o %t
+# RUN: obj2yaml %t | FileCheck %s
+
+# CHECK: Sections:
+# CHECK-NEXT: - Name: .MIPS.abiflags
+# CHECK-NEXT: Type: SHT_MIPS_ABIFLAGS
+# CHECK-NEXT: AddressAlign: 0x0000000000000008
+# CHECK-NEXT: EntSize: 0x0000000000000018
+# CHECK-NEXT: ISA: MIPS64
+# CHECK-NEXT: ISARevision: 0x05
+# CHECK-NEXT: ISAExtension: EXT_OCTEON3
+# CHECK-NEXT: ASEs: [ DSP, DSPR2, VIRT ]
+# CHECK-NEXT: FpABI: FP_DOUBLE
+# CHECK-NEXT: GPRSize: REG_64
+# CHECK-NEXT: CPR1Size: REG_64
+# CHECK-NEXT: Flags1: [ ODDSPREG ]
+# CHECK-NEXT: ...
+
+--- !ELF
+FileHeader:
+ Class: ELFCLASS64
+ Data: ELFDATA2MSB
+ Type: ET_REL
+ Machine: EM_MIPS
+Sections:
+ - Name: .MIPS.abiflags
+ Type: SHT_MIPS_ABIFLAGS
+ AddressAlign: 8
+ Version: 0
+ ISA: MIPS64
+ ISARevision: 5
+ ISAExtension: EXT_OCTEON3
+ ASEs: [ DSP, DSPR2, VIRT ]
+ FpABI: FP_DOUBLE
+ GPRSize: REG_64
+ CPR1Size: REG_64
+ CPR2Size: REG_NONE
+ Flags1: [ ODDSPREG ]
+ Flags2: 0x0
diff --git a/llvm/test/tools/yaml2obj/ELF/mips-abi-flags.yaml b/llvm/test/tools/yaml2obj/ELF/mips-abi-flags.yaml
new file mode 100644
index 000000000000..b635e7161502
--- /dev/null
+++ b/llvm/test/tools/yaml2obj/ELF/mips-abi-flags.yaml
@@ -0,0 +1,45 @@
+## Test how yaml2obj creates SHT_MIPS_ABIFLAGS sections.
+
+# RUN: yaml2obj %s -o %t
+# RUN: llvm-readobj -A %t | FileCheck %s
+
+# CHECK: MIPS ABI Flags {
+# CHECK-NEXT: Version: 0
+# CHECK-NEXT: ISA: MIPS64r5
+# CHECK-NEXT: ISA Extension: Cavium Networks Octeon3 (0x13)
+# CHECK-NEXT: ASEs [ (0x103)
+# CHECK-NEXT: DSP (0x1)
+# CHECK-NEXT: DSPR2 (0x2)
+# CHECK-NEXT: VZ (0x100)
+# CHECK-NEXT: ]
+# CHECK-NEXT: FP ABI: Hard float (double precision) (0x1)
+# CHECK-NEXT: GPR size: 64
+# CHECK-NEXT: CPR1 size: 64
+# CHECK-NEXT: CPR2 size: 0
+# CHECK-NEXT: Flags 1 [ (0x1)
+# CHECK-NEXT: ODDSPREG (0x1)
+# CHECK-NEXT: ]
+# CHECK-NEXT: Flags 2: 0x0
+# CHECK-NEXT: }
+
+--- !ELF
+FileHeader:
+ Class: ELFCLASS64
+ Data: ELFDATA2MSB
+ Type: ET_REL
+ Machine: EM_MIPS
+Sections:
+ - Name: .MIPS.abiflags
+ Type: SHT_MIPS_ABIFLAGS
+ AddressAlign: 8
+ Version: 0
+ ISA: MIPS64
+ ISARevision: 5
+ ISAExtension: EXT_OCTEON3
+ ASEs: [ DSP, DSPR2, VIRT ]
+ FpABI: FP_DOUBLE
+ GPRSize: REG_64
+ CPR1Size: REG_64
+ CPR2Size: REG_NONE
+ Flags1: [ ODDSPREG ]
+ Flags2: 0x0
More information about the llvm-commits
mailing list