Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lld / test / ELF / emulation-arm.s
blobb061bbb9f3f5be0ae07a5006387076c8d49d40a0
1 # REQUIRES: arm
2 # RUN: llvm-mc -filetype=obj -triple=armv7-unknown-linux %s -o %tarm
3 # RUN: ld.lld -m armelf %tarm -o %t2arm
4 # RUN: llvm-readobj --file-headers %t2arm | FileCheck --check-prefix=ARM %s
5 # RUN: ld.lld -m armelf_linux_eabi %tarm -o %t3arm
6 # RUN: llvm-readobj --file-headers %t3arm | FileCheck --check-prefix=ARM %s
7 # RUN: ld.lld %tarm -o %t4arm
8 # RUN: llvm-readobj --file-headers %t4arm | FileCheck --check-prefix=ARM %s
9 # RUN: echo 'OUTPUT_FORMAT(elf32-littlearm)' > %t5arm.script
10 # RUN: ld.lld %t5arm.script %tarm -o %t5arm
11 # RUN: llvm-readobj --file-headers %t5arm | FileCheck --check-prefix=ARM %s
12 # ARM: ElfHeader {
13 # ARM-NEXT: Ident {
14 # ARM-NEXT: Magic: (7F 45 4C 46)
15 # ARM-NEXT: Class: 32-bit (0x1)
16 # ARM-NEXT: DataEncoding: LittleEndian (0x1)
17 # ARM-NEXT: FileVersion: 1
18 # ARM-NEXT: OS/ABI: SystemV (0x0)
19 # ARM-NEXT: ABIVersion: 0
20 # ARM-NEXT: Unused: (00 00 00 00 00 00 00)
21 # ARM-NEXT: }
22 # ARM-NEXT: Type: Executable (0x2)
23 # ARM-NEXT: Machine: EM_ARM (0x28)
24 # ARM-NEXT: Version: 1
26 # RUN: llvm-mc -arm-add-build-attributes -filetype=obj -triple=armv7aeb-none-linux-gnueabi %s -o %t.o
27 # RUN: ld.lld -marmelfb_linux_eabi %t.o -o %t1
28 # echo 'OUTPUT_FORMAT(elf32-bigarm)' > %t6arm.script
29 # ld.lld %tarm -o %t6arm
30 # RUN: llvm-readobj -h %t1 | FileCheck %s --check-prefix=ARMEB
31 # RUN: llvm-readobj -h %t1 | FileCheck %s --check-prefix=BE8
33 # RUN: ld.lld --be8 -marmelfb_linux_eabi %t.o -o %t1
34 # echo 'OUTPUT_FORMAT(elf32-bigarm)' > %t6arm.script
35 # ld.lld --be8 %tarm -o %t6arm
36 # RUN: llvm-readobj -h %t1 | FileCheck %s --check-prefix=ARMEB8
38 # ARMEB: ElfHeader {
39 # ARMEB-NEXT: Ident {
40 # ARMEB-NEXT: Magic: (7F 45 4C 46)
41 # ARMEB-NEXT: Class: 32-bit (0x1)
42 # ARMEB-NEXT: DataEncoding: BigEndian (0x2)
43 # ARMEB-NEXT: FileVersion: 1
44 # ARMEB-NEXT: OS/ABI: SystemV (0x0)
45 # ARMEB-NEXT: ABIVersion: 0
46 # ARMEB-NEXT: Unused: (00 00 00 00 00 00 00)
47 # ARMEB-NEXT: }
48 # ARMEB-NEXT: Type: Executable (0x2)
49 # ARMEB-NEXT: Machine: EM_ARM (0x28)
50 # ARMEB-NEXT: Version: 1
52 ## Ensure that the EF_ARM_BE8 flag is not set for be32
53 ## This will have to be modified on the be8 is implemented
54 # ARMEB: Flags [ (0x5000200)
55 # ARMEB-NEXT: 0x200
56 # ARMEB-NEXT: 0x1000000
57 # ARMEB-NEXT: 0x4000000
58 # ARMEB-NEXT: ]
60 # BE8-NOT: 0x800000
62 # ARMEB8: ElfHeader {
63 # ARMEB8-NEXT: Ident {
64 # ARMEB8-NEXT: Magic: (7F 45 4C 46)
65 # ARMEB8-NEXT: Class: 32-bit (0x1)
66 # ARMEB8-NEXT: DataEncoding: BigEndian (0x2)
67 # ARMEB8-NEXT: FileVersion: 1
68 # ARMEB8-NEXT: OS/ABI: SystemV (0x0)
69 # ARMEB8-NEXT: ABIVersion: 0
70 # ARMEB8-NEXT: Unused: (00 00 00 00 00 00 00)
71 # ARMEB8-NEXT: }
72 # ARMEB8-NEXT: Type: Executable (0x2)
73 # ARMEB8-NEXT: Machine: EM_ARM (0x28)
74 # ARMEB8-NEXT: Version: 1
76 ## Ensure that the EF_ARM_BE8 flag is set for be8
77 # ARMEB8: Flags [ (0x5800200)
78 # ARMEB8-NEXT: 0x200
79 # ARMEB8-NEXT: 0x800000
80 # ARMEB8-NEXT: 0x1000000
81 # ARMEB8-NEXT: 0x4000000
82 # ARMEB8-NEXT: ]
84 .globl _start
85 _start: