3 # RUN: llvm-mc -filetype=obj -triple=loongarch32 %s -o %t.o
4 # RUN: ld.lld %t.o -o %t
5 # RUN: llvm-readobj --file-headers %t | FileCheck --check-prefix=LA32 %s
6 # RUN: ld.lld -m elf32loongarch %t.o -o %t
7 # RUN: llvm-readobj --file-headers %t | FileCheck --check-prefix=LA32 %s
8 # RUN: echo 'OUTPUT_FORMAT(elf32-loongarch)' > %t.script
9 # RUN: ld.lld %t.script %t.o -o %t
10 # RUN: llvm-readobj --file-headers %t | FileCheck --check-prefix=LA32 %s
14 # LA32-NEXT: Magic: (7F 45 4C 46)
15 # LA32-NEXT: Class: 32-bit (0x1)
16 # LA32-NEXT: DataEncoding: LittleEndian (0x1)
17 # LA32-NEXT: FileVersion: 1
18 # LA32-NEXT: OS/ABI: SystemV (0x0)
19 # LA32-NEXT: ABIVersion: 0
20 # LA32-NEXT: Unused: (00 00 00 00 00 00 00)
22 # LA32-NEXT: Type: Executable (0x2)
23 # LA32-NEXT: Machine: EM_LOONGARCH (0x102)
24 # LA32-NEXT: Version: 1
26 # LA32-NEXT: ProgramHeaderOffset: 0x34
27 # LA32-NEXT: SectionHeaderOffset:
28 # LA32-NEXT: Flags [ (0x43)
29 # LA32-NEXT: EF_LOONGARCH_ABI_DOUBLE_FLOAT (0x3)
30 # LA32-NEXT: EF_LOONGARCH_OBJABI_V1 (0x40)
32 # LA32-NEXT: HeaderSize: 52
33 # LA32-NEXT: ProgramHeaderEntrySize: 32
34 # LA32-NEXT: ProgramHeaderCount:
35 # LA32-NEXT: SectionHeaderEntrySize: 40
36 # LA32-NEXT: SectionHeaderCount:
37 # LA32-NEXT: StringTableSectionIndex:
40 # RUN: llvm-mc -filetype=obj -triple=loongarch64 %s -o %t.o
41 # RUN: ld.lld %t.o -o %t
42 # RUN: llvm-readobj --file-headers %t | FileCheck --check-prefix=LA64 %s
43 # RUN: ld.lld -m elf64loongarch %t.o -o %t
44 # RUN: llvm-readobj --file-headers %t | FileCheck --check-prefix=LA64 %s
45 # RUN: echo 'OUTPUT_FORMAT(elf64-loongarch)' > %t.script
46 # RUN: ld.lld %t.script %t.o -o %t
47 # RUN: llvm-readobj --file-headers %t | FileCheck --check-prefix=LA64 %s
51 # LA64-NEXT: Magic: (7F 45 4C 46)
52 # LA64-NEXT: Class: 64-bit (0x2)
53 # LA64-NEXT: DataEncoding: LittleEndian (0x1)
54 # LA64-NEXT: FileVersion: 1
55 # LA64-NEXT: OS/ABI: SystemV (0x0)
56 # LA64-NEXT: ABIVersion: 0
57 # LA64-NEXT: Unused: (00 00 00 00 00 00 00)
59 # LA64-NEXT: Type: Executable (0x2)
60 # LA64-NEXT: Machine: EM_LOONGARCH (0x102)
61 # LA64-NEXT: Version: 1
63 # LA64-NEXT: ProgramHeaderOffset: 0x40
64 # LA64-NEXT: SectionHeaderOffset:
65 # LA64-NEXT: Flags [ (0x43)
66 # LA64-NEXT: EF_LOONGARCH_ABI_DOUBLE_FLOAT (0x3)
67 # LA64-NEXT: EF_LOONGARCH_OBJABI_V1 (0x40)
69 # LA64-NEXT: HeaderSize: 64
70 # LA64-NEXT: ProgramHeaderEntrySize: 56
71 # LA64-NEXT: ProgramHeaderCount:
72 # LA64-NEXT: SectionHeaderEntrySize: 64
73 # LA64-NEXT: SectionHeaderCount:
74 # LA64-NEXT: StringTableSectionIndex: