diff options
Diffstat (limited to 'lld/test/ELF/lto/arm.ll')
-rw-r--r-- | lld/test/ELF/lto/arm.ll | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/lld/test/ELF/lto/arm.ll b/lld/test/ELF/lto/arm.ll new file mode 100644 index 0000000..00d0865 --- /dev/null +++ b/lld/test/ELF/lto/arm.ll @@ -0,0 +1,59 @@ +; REQUIRES: arm +;; Test we can infer the e_machine value EM_ARM from a bitcode file. + +; RUN: split-file %s %t + +; RUN: llvm-as %t/arm.ll -o %t/arm.o +; RUN: ld.lld %t/arm.o -o %t/arm +; RUN: llvm-readobj -h %t/arm | FileCheck %s --check-prefix=ARM +; RUN: llvm-as %t/armeb.ll -o %t/armeb.o +; RUN: not ld.lld %t/armeb.o -o %t/armeb + +; RUN: llvm-as %t/thumb.ll -o %t/thumb.o +; RUN: ld.lld %t/thumb.o -o %t/thumb +; RUN: llvm-readobj -h %t/thumb | FileCheck %s --check-prefix=THUMB +; RUN: llvm-as %t/thumbeb.ll -o %t/thumbeb.o +; RUN: not ld.lld %t/thumbeb.o -o %t/thumbeb + +; ARM: Class: 32-bit +; ARM: DataEncoding: LittleEndian +; ARM: Machine: EM_ARM ( +; ARMEB: Class: 32-bit +; ARMEB: DataEncoding: BigEndian +; ARMEB: Machine: EM_ARM ( + +; THUMB: Class: 32-bit +; THUMB: DataEncoding: LittleEndian +; THUMB: Machine: EM_ARM ( + +;--- arm.ll +target datalayout = "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64" +target triple = "armv7-linux-musleabi" + +define void @_start() { + ret void +} + +;--- thumb.ll +target datalayout = "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64" +target triple = "thumbv8m.base-none-unknown-gnueabi" + +define void @_start() { + ret void +} + +;--- armeb.ll +target datalayout = "E-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64" +target triple = "armebv7-unknown-linux-musleabi" + +define void @_start() { + ret void +} + +;--- thumbeb.ll +target datalayout = "E-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64" +target triple = "thumbebv8m.base-none-unknown-gnueabi" + +define void @_start() { + ret void +} |