xref: /llvm-project/lld/test/ELF/lto/aarch64.ll (revision abd80ecf6ed8f013b8c78fb00a2637dfc81e50cb)
1; REQUIRES: aarch64
2;; Test we can infer the e_machine value EM_AARCH64 from a bitcode file.
3
4; RUN: split-file %s %t
5; RUN: llvm-as %t/le.s -o %t/le.o
6; RUN: ld.lld %t/le.o -o %t/le
7; RUN: llvm-readobj -h %t/le | FileCheck %s --check-prefixes=CHECK,LE
8
9; RUN: llvm-as %t/be.s -o %t/be.o
10; RUN: ld.lld %t/be.o -o %t/be
11; RUN: llvm-readobj -h %t/be | FileCheck %s --check-prefixes=CHECK,BE
12
13; CHECK:   Class: 64-bit
14; LE:      DataEncoding: LittleEndian
15; BE:      DataEncoding: BigEndian
16; CHECK: Machine: EM_AARCH64
17
18;--- le.s
19target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
20target triple = "aarch64-unknown-linux-gnu"
21
22define void @_start() {
23entry:
24  ret void
25}
26
27;--- be.s
28target datalayout = "E-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
29target triple = "aarch64_be-unknown-linux-gnu"
30
31define void @_start() {
32entry:
33  ret void
34}
35