xref: /llvm-project-15.0.7/lld/test/ELF/lto/ppc.ll (revision abd80ecf)
1; REQUIRES: ppc
2;; Test we can infer the e_machine value EM_PPC/EM_PPC64 from a bitcode file.
3
4; RUN: split-file %s %t
5; RUN: llvm-as %t/32le.ll -o %t/32le.o
6; RUN: ld.lld %t/32le.o -o %t/32le
7; RUN: llvm-readobj -h %t/32le | FileCheck %s --check-prefix=LE32
8
9; RUN: llvm-as %t/32be.ll -o %t/32be.o
10; RUN: ld.lld %t/32be.o -o %t/32be
11; RUN: llvm-readobj -h %t/32be | FileCheck %s --check-prefix=BE32
12
13; RUN: llvm-as %t/64.ll -o %t/64.o
14; RUN: ld.lld %t/64.o -o %t/64
15; RUN: llvm-readobj -h %t/64 | FileCheck %s --check-prefix=LE64
16
17; LE32:   Class: 32-bit
18; LE32:   DataEncoding: LittleEndian
19; LE32: Machine: EM_PPC (
20
21; BE32:   Class: 32-bit
22; BE32:   DataEncoding: BigEndian
23; BE32: Machine: EM_PPC (
24
25; LE64:   Class: 64-bit
26; LE64:   DataEncoding: LittleEndian
27; LE64: Machine: EM_PPC64
28
29;--- 32le.ll
30target datalayout = "e-m:e-p:32:32-i64:64-n32"
31target triple = "powerpcle-pc-freebsd"
32
33define void @_start() {
34  ret void
35}
36
37;--- 32be.ll
38target datalayout = "E-m:e-p:32:32-i64:64-n32"
39target triple = "powerpc-unknown-linux-gnu"
40
41define void @_start() {
42  ret void
43}
44
45;--- 64.ll
46target datalayout = "e-m:e-i64:64-n32:64-S128-v256:256:256-v512:512:512"
47target triple = "powerpc64le-unknown-linux-gnu"
48
49define void @_start() {
50  ret void
51}
52