1 ## Check llvm-readobj's ability to decode all possible LoongArch e_flags field
4 ## Not all combinations covered here exist in reality (such as the v0 ILP32*
5 ## objects) but they are included nevertheless for completeness.
7 # RUN: yaml2obj %s -o %t-lp64s -DCLASS=64 -DABI_MODIFIER=SOFT -DOBJABI_VER=0
8 # RUN: llvm-readobj -h %t-lp64s | FileCheck --check-prefixes=READOBJ-LP64,READOBJ-SOFT-V0 %s
9 # RUN: llvm-readelf -h %t-lp64s | FileCheck --check-prefixes=READELF-LP64,READELF-SOFT-V0 --match-full-lines %s
11 # RUN: yaml2obj %s -o %t-lp64f -DCLASS=64 -DABI_MODIFIER=SINGLE -DOBJABI_VER=0
12 # RUN: llvm-readobj -h %t-lp64f | FileCheck --check-prefixes=READOBJ-LP64,READOBJ-SINGLE-V0 %s
13 # RUN: llvm-readelf -h %t-lp64f | FileCheck --check-prefixes=READELF-LP64,READELF-SINGLE-V0 --match-full-lines %s
15 # RUN: yaml2obj %s -o %t-lp64d -DCLASS=64 -DABI_MODIFIER=DOUBLE -DOBJABI_VER=0
16 # RUN: llvm-readobj -h %t-lp64d | FileCheck --check-prefixes=READOBJ-LP64,READOBJ-DOUBLE-V0 %s
17 # RUN: llvm-readelf -h %t-lp64d | FileCheck --check-prefixes=READELF-LP64,READELF-DOUBLE-V0 --match-full-lines %s
19 # RUN: yaml2obj %s -o %t-ilp32s -DCLASS=32 -DABI_MODIFIER=SOFT -DOBJABI_VER=0
20 # RUN: llvm-readobj -h %t-ilp32s | FileCheck --check-prefixes=READOBJ-ILP32,READOBJ-SOFT-V0 %s
21 # RUN: llvm-readelf -h %t-ilp32s | FileCheck --check-prefixes=READELF-ILP32,READELF-SOFT-V0 --match-full-lines %s
23 # RUN: yaml2obj %s -o %t-ilp32f -DCLASS=32 -DABI_MODIFIER=SINGLE -DOBJABI_VER=0
24 # RUN: llvm-readobj -h %t-ilp32f | FileCheck --check-prefixes=READOBJ-ILP32,READOBJ-SINGLE-V0 %s
25 # RUN: llvm-readelf -h %t-ilp32f | FileCheck --check-prefixes=READELF-ILP32,READELF-SINGLE-V0 --match-full-lines %s
27 # RUN: yaml2obj %s -o %t-ilp32d -DCLASS=32 -DABI_MODIFIER=DOUBLE -DOBJABI_VER=0
28 # RUN: llvm-readobj -h %t-ilp32d | FileCheck --check-prefixes=READOBJ-ILP32,READOBJ-DOUBLE-V0 %s
29 # RUN: llvm-readelf -h %t-ilp32d | FileCheck --check-prefixes=READELF-ILP32,READELF-DOUBLE-V0 --match-full-lines %s
31 # RUN: yaml2obj %s -o %t-lp64s -DCLASS=64 -DABI_MODIFIER=SOFT -DOBJABI_VER=1
32 # RUN: llvm-readobj -h %t-lp64s | FileCheck --check-prefixes=READOBJ-LP64,READOBJ-SOFT-V1 %s
33 # RUN: llvm-readelf -h %t-lp64s | FileCheck --check-prefixes=READELF-LP64,READELF-SOFT-V1 --match-full-lines %s
35 # RUN: yaml2obj %s -o %t-lp64f -DCLASS=64 -DABI_MODIFIER=SINGLE -DOBJABI_VER=1
36 # RUN: llvm-readobj -h %t-lp64f | FileCheck --check-prefixes=READOBJ-LP64,READOBJ-SINGLE-V1 %s
37 # RUN: llvm-readelf -h %t-lp64f | FileCheck --check-prefixes=READELF-LP64,READELF-SINGLE-V1 --match-full-lines %s
39 # RUN: yaml2obj %s -o %t-lp64d -DCLASS=64 -DABI_MODIFIER=DOUBLE -DOBJABI_VER=1
40 # RUN: llvm-readobj -h %t-lp64d | FileCheck --check-prefixes=READOBJ-LP64,READOBJ-DOUBLE-V1 %s
41 # RUN: llvm-readelf -h %t-lp64d | FileCheck --check-prefixes=READELF-LP64,READELF-DOUBLE-V1 --match-full-lines %s
43 # RUN: yaml2obj %s -o %t-ilp32s -DCLASS=32 -DABI_MODIFIER=SOFT -DOBJABI_VER=1
44 # RUN: llvm-readobj -h %t-ilp32s | FileCheck --check-prefixes=READOBJ-ILP32,READOBJ-SOFT-V1 %s
45 # RUN: llvm-readelf -h %t-ilp32s | FileCheck --check-prefixes=READELF-ILP32,READELF-SOFT-V1 --match-full-lines %s
47 # RUN: yaml2obj %s -o %t-ilp32f -DCLASS=32 -DABI_MODIFIER=SINGLE -DOBJABI_VER=1
48 # RUN: llvm-readobj -h %t-ilp32f | FileCheck --check-prefixes=READOBJ-ILP32,READOBJ-SINGLE-V1 %s
49 # RUN: llvm-readelf -h %t-ilp32f | FileCheck --check-prefixes=READELF-ILP32,READELF-SINGLE-V1 --match-full-lines %s
51 # RUN: yaml2obj %s -o %t-ilp32d -DCLASS=32 -DABI_MODIFIER=DOUBLE -DOBJABI_VER=1
52 # RUN: llvm-readobj -h %t-ilp32d | FileCheck --check-prefixes=READOBJ-ILP32,READOBJ-DOUBLE-V1 %s
53 # RUN: llvm-readelf -h %t-ilp32d | FileCheck --check-prefixes=READELF-ILP32,READELF-DOUBLE-V1 --match-full-lines %s
55 # READOBJ-LP64: Class: 64-bit (0x2)
56 # READELF-LP64: Class: ELF64
57 # READOBJ-ILP32: Class: 32-bit (0x1)
58 # READELF-ILP32: Class: ELF32
60 # READOBJ-SOFT-V0: Flags [ (0x1)
61 # READOBJ-SOFT-V0-NEXT: EF_LOONGARCH_ABI_SOFT_FLOAT (0x1)
62 # READOBJ-SOFT-V0-NEXT: ]
64 # READOBJ-SINGLE-V0: Flags [ (0x2)
65 # READOBJ-SINGLE-V0-NEXT: EF_LOONGARCH_ABI_SINGLE_FLOAT (0x2)
66 # READOBJ-SINGLE-V0-NEXT: ]
68 # READOBJ-DOUBLE-V0: Flags [ (0x3)
69 # READOBJ-DOUBLE-V0-NEXT: EF_LOONGARCH_ABI_DOUBLE_FLOAT (0x3)
70 # READOBJ-DOUBLE-V0-NEXT: ]
72 # READOBJ-SOFT-V1: Flags [ (0x41)
73 # READOBJ-SOFT-V1-NEXT: EF_LOONGARCH_ABI_SOFT_FLOAT (0x1)
74 # READOBJ-SOFT-V1-NEXT: EF_LOONGARCH_OBJABI_V1 (0x40)
75 # READOBJ-SOFT-V1-NEXT: ]
77 # READOBJ-SINGLE-V1: Flags [ (0x42)
78 # READOBJ-SINGLE-V1-NEXT: EF_LOONGARCH_ABI_SINGLE_FLOAT (0x2)
79 # READOBJ-SINGLE-V1-NEXT: EF_LOONGARCH_OBJABI_V1 (0x40)
80 # READOBJ-SINGLE-V1-NEXT: ]
82 # READOBJ-DOUBLE-V1: Flags [ (0x43)
83 # READOBJ-DOUBLE-V1-NEXT: EF_LOONGARCH_ABI_DOUBLE_FLOAT (0x3)
84 # READOBJ-DOUBLE-V1-NEXT: EF_LOONGARCH_OBJABI_V1 (0x40)
85 # READOBJ-DOUBLE-V1-NEXT: ]
87 # READELF-SOFT-V0: Flags: 0x1, SOFT-FLOAT
88 # READELF-SINGLE-V0: Flags: 0x2, SINGLE-FLOAT
89 # READELF-DOUBLE-V0: Flags: 0x3, DOUBLE-FLOAT
90 # READELF-SOFT-V1: Flags: 0x41, SOFT-FLOAT, OBJ-v1
91 # READELF-SINGLE-V1: Flags: 0x42, SINGLE-FLOAT, OBJ-v1
92 # READELF-DOUBLE-V1: Flags: 0x43, DOUBLE-FLOAT, OBJ-v1
96 Class: ELFCLASS[[CLASS]]
101 EF_LOONGARCH_ABI_[[ABI_MODIFIER]]_FLOAT,
102 EF_LOONGARCH_OBJABI_V[[OBJABI_VER]],