2018-06-27 00:58:19 +08:00
|
|
|
# REQUIRES: mips
|
2015-12-19 13:51:49 +08:00
|
|
|
# Check generation of MIPS specific ELF header flags.
|
|
|
|
|
2016-08-06 13:11:41 +08:00
|
|
|
# RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux \
|
|
|
|
# RUN: %S/Inputs/mips-dynamic.s -o %t-so.o
|
2017-03-17 22:27:55 +08:00
|
|
|
# RUN: ld.lld %t-so.o --gc-sections -shared -o %t.so
|
2019-10-03 20:08:04 +08:00
|
|
|
# RUN: llvm-readobj -h -A %t.so | FileCheck -check-prefix=SO %s
|
2016-08-12 01:07:43 +08:00
|
|
|
|
2016-08-06 13:11:41 +08:00
|
|
|
# RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux %s -o %t.o
|
2015-12-19 13:51:49 +08:00
|
|
|
# RUN: ld.lld %t.o -o %t.exe
|
2019-10-03 20:08:04 +08:00
|
|
|
# RUN: llvm-readobj -h -A %t.exe | FileCheck -check-prefix=EXE %s
|
2016-08-12 01:07:43 +08:00
|
|
|
|
2016-07-21 04:15:24 +08:00
|
|
|
# RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux \
|
|
|
|
# RUN: -mcpu=mips32r2 %s -o %t-r2.o
|
|
|
|
# RUN: ld.lld %t-r2.o -o %t-r2.exe
|
2019-10-03 20:08:04 +08:00
|
|
|
# RUN: llvm-readobj -h -A %t-r2.exe | FileCheck -check-prefix=EXE-R2 %s
|
2016-08-12 01:07:43 +08:00
|
|
|
|
2016-08-12 01:07:46 +08:00
|
|
|
# RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux \
|
|
|
|
# RUN: -mcpu=mips32r2 %s -o %t-r2.o
|
|
|
|
# RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux \
|
|
|
|
# RUN: -mcpu=mips32r5 %S/Inputs/mips-dynamic.s -o %t-r5.o
|
|
|
|
# RUN: ld.lld %t-r2.o %t-r5.o -o %t-r5.exe
|
2019-10-03 20:08:04 +08:00
|
|
|
# RUN: llvm-readobj -h -A %t-r5.exe | FileCheck -check-prefix=EXE-R5 %s
|
2016-08-12 01:07:46 +08:00
|
|
|
|
2016-07-21 04:15:24 +08:00
|
|
|
# RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux \
|
|
|
|
# RUN: -mcpu=mips32r6 %s -o %t-r6.o
|
|
|
|
# RUN: ld.lld %t-r6.o -o %t-r6.exe
|
2019-10-03 20:08:04 +08:00
|
|
|
# RUN: llvm-readobj -h -A %t-r6.exe | FileCheck -check-prefix=EXE-R6 %s
|
2015-12-19 13:51:49 +08:00
|
|
|
|
2016-08-12 01:07:46 +08:00
|
|
|
# RUN: llvm-mc -filetype=obj -triple=mips64-unknown-linux \
|
2017-01-27 19:01:10 +08:00
|
|
|
# RUN: -position-independent -mcpu=octeon %s -o %t.o
|
2016-08-12 01:07:46 +08:00
|
|
|
# RUN: ld.lld %t.o -o %t.exe
|
2019-10-03 20:08:04 +08:00
|
|
|
# RUN: llvm-readobj -h -A %t.exe | FileCheck -check-prefix=OCTEON %s
|
2016-08-12 01:07:46 +08:00
|
|
|
|
2017-10-02 22:56:41 +08:00
|
|
|
# RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux %s -o %t.o
|
|
|
|
# RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux \
|
|
|
|
# RUN: -mattr=micromips %S/Inputs/mips-fpic.s -o %t-mm.o
|
|
|
|
# RUN: ld.lld %t.o %t-mm.o -o %t.exe
|
2019-10-03 20:08:04 +08:00
|
|
|
# RUN: llvm-readobj -h -A %t.exe | FileCheck -check-prefix=MICRO %s
|
2017-10-02 22:56:41 +08:00
|
|
|
|
2015-12-19 13:51:49 +08:00
|
|
|
.text
|
|
|
|
.globl __start
|
|
|
|
__start:
|
|
|
|
nop
|
|
|
|
|
|
|
|
# SO: Flags [
|
|
|
|
# SO-NEXT: EF_MIPS_ABI_O32
|
2016-07-21 04:15:24 +08:00
|
|
|
# SO-NEXT: EF_MIPS_ARCH_32
|
2015-12-19 13:51:49 +08:00
|
|
|
# SO-NEXT: EF_MIPS_CPIC
|
|
|
|
# SO-NEXT: EF_MIPS_PIC
|
|
|
|
# SO-NEXT: ]
|
2016-08-12 14:28:49 +08:00
|
|
|
# SO: MIPS ABI Flags {
|
|
|
|
# SO-NEXT: Version: 0
|
|
|
|
# SO-NEXT: ISA: MIPS32
|
|
|
|
# SO-NEXT: ISA Extension: None
|
|
|
|
# SO-NEXT: ASEs [
|
|
|
|
# SO-NEXT: ]
|
|
|
|
# SO-NEXT: FP ABI: Hard float (double precision)
|
|
|
|
# SO-NEXT: GPR size: 32
|
|
|
|
# SO-NEXT: CPR1 size: 32
|
|
|
|
# SO-NEXT: CPR2 size: 0
|
|
|
|
# SO-NEXT: Flags 1 [
|
|
|
|
# SO-NEXT: ODDSPREG
|
|
|
|
# SO-NEXT: ]
|
|
|
|
# SO-NEXT: Flags 2: 0x0
|
|
|
|
# SO-NEXT: }
|
2015-12-19 13:51:49 +08:00
|
|
|
|
|
|
|
# EXE: Flags [
|
|
|
|
# EXE-NEXT: EF_MIPS_ABI_O32
|
2016-07-21 04:15:24 +08:00
|
|
|
# EXE-NEXT: EF_MIPS_ARCH_32
|
2015-12-19 13:51:49 +08:00
|
|
|
# EXE-NEXT: EF_MIPS_CPIC
|
|
|
|
# EXE-NEXT: ]
|
2016-08-12 14:28:49 +08:00
|
|
|
# EXE: MIPS ABI Flags {
|
|
|
|
# EXE-NEXT: Version: 0
|
|
|
|
# EXE-NEXT: ISA: MIPS32
|
|
|
|
# EXE-NEXT: ISA Extension: None
|
|
|
|
# EXE-NEXT: ASEs [
|
|
|
|
# EXE-NEXT: ]
|
|
|
|
# EXE-NEXT: FP ABI: Hard float (double precision)
|
|
|
|
# EXE-NEXT: GPR size: 32
|
|
|
|
# EXE-NEXT: CPR1 size: 32
|
|
|
|
# EXE-NEXT: CPR2 size: 0
|
|
|
|
# EXE-NEXT: Flags 1 [
|
|
|
|
# EXE-NEXT: ODDSPREG
|
|
|
|
# EXE-NEXT: ]
|
|
|
|
# EXE-NEXT: Flags 2: 0x0
|
|
|
|
# EXE-NEXT: }
|
2016-07-21 04:15:24 +08:00
|
|
|
|
|
|
|
# EXE-R2: Flags [
|
|
|
|
# EXE-R2-NEXT: EF_MIPS_ABI_O32
|
|
|
|
# EXE-R2-NEXT: EF_MIPS_ARCH_32R2
|
|
|
|
# EXE-R2-NEXT: EF_MIPS_CPIC
|
|
|
|
# EXE-R2-NEXT: ]
|
2016-08-12 14:28:49 +08:00
|
|
|
# EXE-R2: MIPS ABI Flags {
|
|
|
|
# EXE-R2-NEXT: Version: 0
|
|
|
|
# EXE-R2-NEXT: ISA: MIPS32r2
|
|
|
|
# EXE-R2-NEXT: ISA Extension: None
|
|
|
|
# EXE-R2-NEXT: ASEs [
|
|
|
|
# EXE-R2-NEXT: ]
|
|
|
|
# EXE-R2-NEXT: FP ABI: Hard float (double precision)
|
|
|
|
# EXE-R2-NEXT: GPR size: 32
|
|
|
|
# EXE-R2-NEXT: CPR1 size: 32
|
|
|
|
# EXE-R2-NEXT: CPR2 size: 0
|
|
|
|
# EXE-R2-NEXT: Flags 1 [
|
|
|
|
# EXE-R2-NEXT: ODDSPREG
|
|
|
|
# EXE-R2-NEXT: ]
|
|
|
|
# EXE-R2-NEXT: Flags 2: 0x0
|
|
|
|
# EXE-R2-NEXT: }
|
2016-07-21 04:15:24 +08:00
|
|
|
|
2016-08-12 01:07:46 +08:00
|
|
|
# EXE-R5: Flags [
|
|
|
|
# EXE-R5-NEXT: EF_MIPS_ABI_O32
|
|
|
|
# EXE-R5-NEXT: EF_MIPS_ARCH_32R2
|
|
|
|
# EXE-R5-NEXT: EF_MIPS_CPIC
|
|
|
|
# EXE-R5-NEXT: ]
|
2016-08-12 14:28:49 +08:00
|
|
|
# EXE-R5: MIPS ABI Flags {
|
|
|
|
# EXE-R5-NEXT: Version: 0
|
|
|
|
# EXE-R5-NEXT: ISA: MIPS32r5
|
|
|
|
# EXE-R5-NEXT: ISA Extension: None
|
|
|
|
# EXE-R5-NEXT: ASEs [
|
|
|
|
# EXE-R5-NEXT: ]
|
|
|
|
# EXE-R5-NEXT: FP ABI: Hard float (double precision)
|
|
|
|
# EXE-R5-NEXT: GPR size: 32
|
|
|
|
# EXE-R5-NEXT: CPR1 size: 32
|
|
|
|
# EXE-R5-NEXT: CPR2 size: 0
|
|
|
|
# EXE-R5-NEXT: Flags 1 [
|
|
|
|
# EXE-R5-NEXT: ODDSPREG
|
|
|
|
# EXE-R5-NEXT: ]
|
|
|
|
# EXE-R5-NEXT: Flags 2: 0x0
|
|
|
|
# EXE-R5-NEXT: }
|
2016-08-12 01:07:46 +08:00
|
|
|
|
2016-07-21 04:15:24 +08:00
|
|
|
# EXE-R6: Flags [
|
|
|
|
# EXE-R6-NEXT: EF_MIPS_ABI_O32
|
|
|
|
# EXE-R6-NEXT: EF_MIPS_ARCH_32R6
|
|
|
|
# EXE-R6-NEXT: EF_MIPS_CPIC
|
2016-08-06 13:11:41 +08:00
|
|
|
# EXE-R6-NEXT: EF_MIPS_NAN2008
|
2016-07-21 04:15:24 +08:00
|
|
|
# EXE-R6-NEXT: ]
|
2016-08-12 14:28:49 +08:00
|
|
|
# EXE-R6: MIPS ABI Flags {
|
|
|
|
# EXE-R6-NEXT: Version: 0
|
|
|
|
# EXE-R6-NEXT: ISA: MIPS32
|
|
|
|
# EXE-R6-NEXT: ISA Extension: None
|
|
|
|
# EXE-R6-NEXT: ASEs [
|
|
|
|
# EXE-R6-NEXT: ]
|
|
|
|
# EXE-R6-NEXT: FP ABI: Hard float (32-bit CPU, 64-bit FPU)
|
|
|
|
# EXE-R6-NEXT: GPR size: 32
|
|
|
|
# EXE-R6-NEXT: CPR1 size: 64
|
|
|
|
# EXE-R6-NEXT: CPR2 size: 0
|
|
|
|
# EXE-R6-NEXT: Flags 1 [
|
|
|
|
# EXE-R6-NEXT: ODDSPREG
|
|
|
|
# EXE-R6-NEXT: ]
|
|
|
|
# EXE-R6-NEXT: Flags 2: 0x0
|
|
|
|
# EXE-R6-NEXT: }
|
2016-08-12 01:07:46 +08:00
|
|
|
|
|
|
|
# OCTEON: Flags [
|
|
|
|
# OCTEON-NEXT: EF_MIPS_ARCH_64R2
|
|
|
|
# OCTEON-NEXT: EF_MIPS_CPIC
|
|
|
|
# OCTEON-NEXT: EF_MIPS_MACH_OCTEON
|
|
|
|
# OCTEON-NEXT: EF_MIPS_PIC
|
|
|
|
# OCTEON-NEXT: ]
|
2016-08-12 14:28:49 +08:00
|
|
|
# OCTEON: MIPS ABI Flags {
|
|
|
|
# OCTEON-NEXT: Version: 0
|
|
|
|
# OCTEON-NEXT: ISA: MIPS64r2
|
|
|
|
# OCTEON-NEXT: ISA Extension: Cavium Networks Octeon
|
|
|
|
# OCTEON-NEXT: ASEs [
|
|
|
|
# OCTEON-NEXT: ]
|
|
|
|
# OCTEON-NEXT: FP ABI: Hard float (double precision)
|
|
|
|
# OCTEON-NEXT: GPR size: 64
|
|
|
|
# OCTEON-NEXT: CPR1 size: 64
|
|
|
|
# OCTEON-NEXT: CPR2 size: 0
|
|
|
|
# OCTEON-NEXT: Flags 1 [
|
|
|
|
# OCTEON-NEXT: ODDSPREG
|
|
|
|
# OCTEON-NEXT: ]
|
|
|
|
# OCTEON-NEXT: Flags 2: 0x0
|
|
|
|
# OCTEON-NEXT: }
|
2017-10-02 22:56:41 +08:00
|
|
|
|
|
|
|
# MICRO: Flags [
|
|
|
|
# MICRO-NEXT: EF_MIPS_ABI_O32
|
|
|
|
# MICRO-NEXT: EF_MIPS_ARCH_32
|
|
|
|
# MICRO-NEXT: EF_MIPS_CPIC
|
|
|
|
# MICRO-NEXT: EF_MIPS_MICROMIPS
|
|
|
|
# MICRO-NEXT: ]
|
|
|
|
# MICRO: MIPS ABI Flags {
|
|
|
|
# MICRO-NEXT: Version: 0
|
|
|
|
# MICRO-NEXT: ISA: MIPS32
|
|
|
|
# MICRO-NEXT: ISA Extension: None
|
|
|
|
# MICRO-NEXT: ASEs [
|
|
|
|
# MICRO-NEXT: microMIPS
|
|
|
|
# MICRO-NEXT: ]
|
|
|
|
# MICRO-NEXT: FP ABI: Hard float (double precision)
|
|
|
|
# MICRO-NEXT: GPR size: 32
|
|
|
|
# MICRO-NEXT: CPR1 size: 32
|
|
|
|
# MICRO-NEXT: CPR2 size: 0
|
|
|
|
# MICRO-NEXT: Flags 1 [
|
|
|
|
# MICRO-NEXT: ODDSPREG
|
|
|
|
# MICRO-NEXT: ]
|
|
|
|
# MICRO-NEXT: Flags 2: 0x0
|
|
|
|
# MICRO-NEXT: }
|