Skip to content

Commit 47b8763

Browse files
committed
[ELF][test] gitBitcodeMachineKind: test EM_ARM
1 parent d8ab8b9 commit 47b8763

File tree

1 file changed

+59
-0
lines changed

1 file changed

+59
-0
lines changed

lld/test/ELF/lto/arm.ll

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
; REQUIRES: arm
2+
;; Test we can infer the e_machine value EM_ARM from a bitcode file.
3+
4+
; RUN: split-file %s %t
5+
6+
; RUN: llvm-as %t/arm.ll -o %t/arm.o
7+
; RUN: ld.lld %t/arm.o -o %t/arm
8+
; RUN: llvm-readobj -h %t/arm | FileCheck %s --check-prefix=ARM
9+
; RUN: llvm-as %t/armeb.ll -o %t/armeb.o
10+
; RUN: not ld.lld %t/armeb.o -o %t/armeb
11+
12+
; RUN: llvm-as %t/thumb.ll -o %t/thumb.o
13+
; RUN: ld.lld %t/thumb.o -o %t/thumb
14+
; RUN: llvm-readobj -h %t/thumb | FileCheck %s --check-prefix=THUMB
15+
; RUN: llvm-as %t/thumbeb.ll -o %t/thumbeb.o
16+
; RUN: not ld.lld %t/thumbeb.o -o %t/thumbeb
17+
18+
; ARM: Class: 32-bit
19+
; ARM: DataEncoding: LittleEndian
20+
; ARM: Machine: EM_ARM (
21+
; ARMEB: Class: 32-bit
22+
; ARMEB: DataEncoding: BigEndian
23+
; ARMEB: Machine: EM_ARM (
24+
25+
; THUMB: Class: 32-bit
26+
; THUMB: DataEncoding: LittleEndian
27+
; THUMB: Machine: EM_ARM (
28+
29+
;--- arm.ll
30+
target datalayout = "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64"
31+
target triple = "armv7-linux-musleabi"
32+
33+
define void @_start() {
34+
ret void
35+
}
36+
37+
;--- thumb.ll
38+
target datalayout = "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64"
39+
target triple = "thumbv8m.base-none-unknown-gnueabi"
40+
41+
define void @_start() {
42+
ret void
43+
}
44+
45+
;--- armeb.ll
46+
target datalayout = "E-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64"
47+
target triple = "armebv7-unknown-linux-musleabi"
48+
49+
define void @_start() {
50+
ret void
51+
}
52+
53+
;--- thumbeb.ll
54+
target datalayout = "E-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64"
55+
target triple = "thumbebv8m.base-none-unknown-gnueabi"
56+
57+
define void @_start() {
58+
ret void
59+
}

0 commit comments

Comments
 (0)