• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# REQUIRES: ppc
2# RUN: llvm-mc -filetype=obj -triple=powerpc64-unknown-linux %s -o %tppc64
3# RUN: ld.lld -m elf64ppc %tppc64 -o %t2ppc64
4# RUN: llvm-readobj --file-headers %t2ppc64 | FileCheck --check-prefix=PPC64 %s
5# RUN: ld.lld %tppc64 -o %t3ppc64
6# RUN: llvm-readobj --file-headers %t3ppc64 | FileCheck --check-prefix=PPC64 %s
7# RUN: echo 'OUTPUT_FORMAT(elf64-powerpc)' > %tppc64.script
8# RUN: ld.lld %tppc64.script  %tppc64 -o %t4ppc64
9# RUN: llvm-readobj --file-headers %t4ppc64 | FileCheck --check-prefix=PPC64 %s
10
11# PPC64:      ElfHeader {
12# PPC64-NEXT:   Ident {
13# PPC64-NEXT:     Magic: (7F 45 4C 46)
14# PPC64-NEXT:     Class: 64-bit (0x2)
15# PPC64-NEXT:     DataEncoding: BigEndian (0x2)
16# PPC64-NEXT:     FileVersion: 1
17# PPC64-NEXT:     OS/ABI: SystemV (0x0)
18# PPC64-NEXT:     ABIVersion: 0
19# PPC64-NEXT:     Unused: (00 00 00 00 00 00 00)
20# PPC64-NEXT:   }
21# PPC64-NEXT:   Type: Executable (0x2)
22# PPC64-NEXT:   Machine: EM_PPC64 (0x15)
23# PPC64-NEXT:   Version: 1
24# PPC64-NEXT:   Entry:
25# PPC64-NEXT:   ProgramHeaderOffset: 0x40
26# PPC64-NEXT:   SectionHeaderOffset:
27# PPC64-NEXT:   Flags [ (0x2)
28# PPC64-NEXT:     0x2
29# PPC64-NEXT:   ]
30# PPC64-NEXT:   HeaderSize: 64
31# PPC64-NEXT:   ProgramHeaderEntrySize: 56
32# PPC64-NEXT:   ProgramHeaderCount:
33# PPC64-NEXT:   SectionHeaderEntrySize: 64
34# PPC64-NEXT:   SectionHeaderCount:
35# PPC64-NEXT:   StringTableSectionIndex:
36# PPC64-NEXT: }
37
38# RUN: llvm-mc -filetype=obj -triple=powerpc64-unknown-freebsd %s -o %tppc64fbsd
39# RUN: echo 'OUTPUT_FORMAT(elf64-powerpc-freebsd)' > %tppc64fbsd.script
40# RUN: ld.lld %tppc64fbsd.script  %tppc64fbsd -o %t2ppc64fbsd
41# RUN: llvm-readobj --file-headers %t2ppc64fbsd | FileCheck --check-prefix=PPC64-FBSD %s
42
43# PPC64-FBSD:      ElfHeader {
44# PPC64-FBSD-NEXT:   Ident {
45# PPC64-FBSD-NEXT:     Magic: (7F 45 4C 46)
46# PPC64-FBSD-NEXT:     Class: 64-bit (0x2)
47# PPC64-FBSD-NEXT:     DataEncoding: BigEndian (0x2)
48# PPC64-FBSD-NEXT:     FileVersion: 1
49# PPC64-FBSD-NEXT:     OS/ABI: FreeBSD (0x9)
50# PPC64-FBSD-NEXT:     ABIVersion: 0
51# PPC64-FBSD-NEXT:     Unused: (00 00 00 00 00 00 00)
52# PPC64-FBSD-NEXT:   }
53# PPC64-FBSD-NEXT:   Type: Executable (0x2)
54# PPC64-FBSD-NEXT:   Machine: EM_PPC64 (0x15)
55# PPC64-FBSD-NEXT:   Version: 1
56# PPC64-FBSD-NEXT:   Entry:
57# PPC64-FBSD-NEXT:   ProgramHeaderOffset: 0x40
58# PPC64-FBSD-NEXT:   SectionHeaderOffset:
59# PPC64-FBSD-NEXT:   Flags [ (0x2)
60# PPC64-FBSD-NEXT:     0x2
61# PPC64-FBSD-NEXT:   ]
62# PPC64-FBSD-NEXT:   HeaderSize: 64
63# PPC64-FBSD-NEXT:   ProgramHeaderEntrySize: 56
64# PPC64-FBSD-NEXT:   ProgramHeaderCount:
65# PPC64-FBSD-NEXT:   SectionHeaderEntrySize: 64
66# PPC64-FBSD-NEXT:   SectionHeaderCount:
67# PPC64-FBSD-NEXT:   StringTableSectionIndex:
68# PPC64-FBSD-NEXT: }
69
70# RUN: llvm-mc -filetype=obj -triple=powerpc64le-unknown-linux %s -o %tppc64le
71# RUN: ld.lld -m elf64lppc %tppc64le -o %t2ppc64le
72# RUN: llvm-readobj --file-headers %t2ppc64le | FileCheck --check-prefix=PPC64LE %s
73# RUN: ld.lld %tppc64le -o %t3ppc64le
74# RUN: llvm-readobj --file-headers %t3ppc64le | FileCheck --check-prefix=PPC64LE %s
75# RUN: echo 'OUTPUT_FORMAT(elf64-powerpcle)' > %tppc64le.script
76# RUN: ld.lld %tppc64le.script  %tppc64le -o %t4ppc64le
77# RUN: llvm-readobj --file-headers %t4ppc64le | FileCheck --check-prefix=PPC64LE %s
78
79# PPC64LE:      ElfHeader {
80# PPC64LE-NEXT:   Ident {
81# PPC64LE-NEXT:     Magic: (7F 45 4C 46)
82# PPC64LE-NEXT:     Class: 64-bit (0x2)
83# PPC64LE-NEXT:     DataEncoding: LittleEndian (0x1)
84# PPC64LE-NEXT:     FileVersion: 1
85# PPC64LE-NEXT:     OS/ABI: SystemV (0x0)
86# PPC64LE-NEXT:     ABIVersion: 0
87# PPC64LE-NEXT:     Unused: (00 00 00 00 00 00 00)
88# PPC64LE-NEXT:   }
89# PPC64LE-NEXT:   Type: Executable (0x2)
90# PPC64LE-NEXT:   Machine: EM_PPC64 (0x15)
91# PPC64LE-NEXT:   Version: 1
92# PPC64LE-NEXT:   Entry:
93# PPC64LE-NEXT:   ProgramHeaderOffset: 0x40
94# PPC64LE-NEXT:   SectionHeaderOffset:
95# PPC64LE-NEXT:   Flags [ (0x2)
96# PPC64LE-NEXT:     0x2
97# PPC64LE-NEXT:   ]
98# PPC64LE-NEXT:   HeaderSize: 64
99# PPC64LE-NEXT:   ProgramHeaderEntrySize: 56
100# PPC64LE-NEXT:   ProgramHeaderCount:
101# PPC64LE-NEXT:   SectionHeaderEntrySize: 64
102# PPC64LE-NEXT:   SectionHeaderCount:
103# PPC64LE-NEXT:   StringTableSectionIndex:
104# PPC64LE-NEXT: }
105
106# RUN: llvm-mc -filetype=obj -triple=powerpc-unknown-linux %s -o %tppc32
107# RUN: ld.lld -m elf32ppc %tppc32 -o %t2ppc32
108# RUN: llvm-readobj --file-headers %t2ppc32 | FileCheck --check-prefix=PPC32 %s
109# RUN: ld.lld %tppc32 -o %t3ppc32
110# RUN: llvm-readobj --file-headers %t3ppc32 | FileCheck --check-prefix=PPC32 %s
111# RUN: echo 'OUTPUT_FORMAT(elf32-powerpc)' > %tppc32.script
112# RUN: ld.lld %tppc32.script  %tppc32 -o %t4ppc32
113# RUN: llvm-readobj --file-headers %t4ppc32 | FileCheck --check-prefix=PPC32 %s
114# RUN: ld.lld -m elf32ppclinux %tppc32 -o %t5ppc32
115# RUN: llvm-readobj --file-headers %t5ppc32 | FileCheck --check-prefix=PPC32 %s
116
117# PPC32:      ElfHeader {
118# PPC32-NEXT:   Ident {
119# PPC32-NEXT:     Magic: (7F 45 4C 46)
120# PPC32-NEXT:     Class: 32-bit (0x1)
121# PPC32-NEXT:     DataEncoding: BigEndian (0x2)
122# PPC32-NEXT:     FileVersion: 1
123# PPC32-NEXT:     OS/ABI: SystemV (0x0)
124# PPC32-NEXT:     ABIVersion: 0
125# PPC32-NEXT:     Unused: (00 00 00 00 00 00 00)
126# PPC32-NEXT:   }
127# PPC32-NEXT:   Type: Executable (0x2)
128# PPC32-NEXT:   Machine: EM_PPC (0x14)
129# PPC32-NEXT:   Version: 1
130# PPC32-NEXT:   Entry:
131# PPC32-NEXT:   ProgramHeaderOffset: 0x34
132# PPC32-NEXT:   SectionHeaderOffset:
133# PPC32-NEXT:   Flags [ (0x0)
134# PPC32-NEXT:   ]
135# PPC32-NEXT:   HeaderSize: 52
136# PPC32-NEXT:   ProgramHeaderEntrySize: 32
137# PPC32-NEXT:   ProgramHeaderCount:
138# PPC32-NEXT:   SectionHeaderEntrySize: 40
139# PPC32-NEXT:   SectionHeaderCount:
140# PPC32-NEXT:   StringTableSectionIndex:
141# PPC32-NEXT: }
142
143.globl _start
144_start:
145