diff options
author | Fangrui Song <i@maskray.me> | 2023-11-17 00:26:26 -0800 |
---|---|---|
committer | Fangrui Song <i@maskray.me> | 2023-11-17 00:26:26 -0800 |
commit | 47b8763f8a814c0e755e154516537d8deb57e4b0 (patch) | |
tree | 100fd152382ef0574bc40e73b8c1c843f7973164 | |
parent | d8ab8b95baa43fbc1dfedf83ca2e5ef7cbed74ee (diff) | |
download | llvm-47b8763f8a814c0e755e154516537d8deb57e4b0.zip llvm-47b8763f8a814c0e755e154516537d8deb57e4b0.tar.gz llvm-47b8763f8a814c0e755e154516537d8deb57e4b0.tar.bz2 |
[ELF][test] gitBitcodeMachineKind: test EM_ARM
-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 +} |