Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lld / test / ELF / emulation-loongarch.s
blob343e836274a3e637ca9d1d4bfd1d521a9e3d6035
1 # REQUIRES: loongarch
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
12 # LA32: ElfHeader {
13 # LA32-NEXT: Ident {
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)
21 # LA32-NEXT: }
22 # LA32-NEXT: Type: Executable (0x2)
23 # LA32-NEXT: Machine: EM_LOONGARCH (0x102)
24 # LA32-NEXT: Version: 1
25 # LA32-NEXT: Entry:
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)
31 # LA32-NEXT: ]
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:
38 # LA32-NEXT: }
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
49 # LA64: ElfHeader {
50 # LA64-NEXT: Ident {
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)
58 # LA64-NEXT: }
59 # LA64-NEXT: Type: Executable (0x2)
60 # LA64-NEXT: Machine: EM_LOONGARCH (0x102)
61 # LA64-NEXT: Version: 1
62 # LA64-NEXT: Entry:
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)
68 # LA64-NEXT: ]
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:
75 # LA64-NEXT: }
77 .globl _start
78 _start: