[llvm] [SPARC][Utilities] Add names for SPARC ELF flags in LLVM binary utilities (PR #102843)
Sergei Barannikov via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 14 04:57:40 PDT 2024
================
@@ -0,0 +1,50 @@
+## Test various combinations of ELF flag values for SPARC.
+
+# RUN: yaml2obj %s -o %t -DCLASS_NAME="ELFCLASS32" -DMACHINE_NAME="EM_SPARC" -DFLAG_NAME=""
+# RUN: llvm-readobj -h %t | FileCheck %s --check-prefixes=LLVM-COMMON -DFLAG_VALUE=0x0
+# RUN: llvm-readelf -h %t | FileCheck %s --match-full-lines --check-prefix=GNU -DFLAG_VALUE=0x0 -DGNU_FLAG_NAME=""
+
+# RUN: yaml2obj %s -o %t -DCLASS_NAME="ELFCLASS32" -DMACHINE_NAME="EM_SPARC32PLUS" -DFLAG_NAME="EF_SPARC_32PLUS"
+# RUN: llvm-readobj -h %t | FileCheck %s --check-prefixes=LLVM-COMMON,LLVM-FLAG0 -DFLAG0_NAME=EF_SPARC_32PLUS -DFLAG_VALUE=0x100
+# RUN: llvm-readelf -h %t | FileCheck %s --match-full-lines --check-prefix=GNU -DFLAG_VALUE=0x100 -DGNU_FLAG_NAME=", V8+ ABI"
+
+# RUN: yaml2obj %s -o %t -DCLASS_NAME="ELFCLASS32" -DMACHINE_NAME="EM_SPARC32PLUS" -DFLAG_NAME="EF_SPARC_32PLUS, EF_SPARC_SUN_US1"
+# RUN: llvm-readobj -h %t | FileCheck %s --check-prefixes=LLVM-COMMON,LLVM-FLAG0,LLVM-FLAG1 -DFLAG0_NAME=EF_SPARC_32PLUS -DFLAG1_NAME=EF_SPARC_SUN_US1 -DFLAG_VALUE=0x300
+# RUN: llvm-readelf -h %t | FileCheck %s --match-full-lines --check-prefix=GNU -DFLAG_VALUE=0x300 -DGNU_FLAG_NAME=", V8+ ABI, Sun UltraSPARC I extensions"
+
+# RUN: yaml2obj %s -o %t -DCLASS_NAME="ELFCLASS32" -DMACHINE_NAME="EM_SPARC32PLUS" -DFLAG_NAME="EF_SPARC_32PLUS, EF_SPARC_SUN_US1, EF_SPARC_HAL_R1, EF_SPARC_SUN_US3"
+# RUN: llvm-readobj -h %t | FileCheck %s --check-prefixes=LLVM-COMMON,LLVM-FLAG0,LLVM-FLAG1,LLVM-FLAG2,LLVM-FLAG3 -DFLAG0_NAME=EF_SPARC_32PLUS -DFLAG1_NAME=EF_SPARC_HAL_R1 -DFLAG2_NAME=EF_SPARC_SUN_US1 -DFLAG3_NAME=EF_SPARC_SUN_US3 -DFLAG_VALUE=0xF00
----------------
s-barannikov wrote:
(nit) you can split long lines like this (backslash and RUN on the next line)
```suggestion
# RUN: llvm-readobj -h %t | FileCheck %s --check-prefixes=LLVM-COMMON,LLVM-FLAG0,LLVM-FLAG1,LLVM-FLAG2,LLVM-FLAG3 \
# RUN: -DFLAG0_NAME=EF_SPARC_32PLUS -DFLAG1_NAME=EF_SPARC_HAL_R1 \
# RUN: -DFLAG2_NAME=EF_SPARC_SUN_US1 -DFLAG3_NAME=EF_SPARC_SUN_US3 \
# RUN: -DFLAG_VALUE=0xF00
```
https://github.com/llvm/llvm-project/pull/102843
More information about the llvm-commits
mailing list