62 lines · plain
1# REQUIRES: mips2# Check MIPS ELF ISA flag calculation if input files have different ISAs.3 4# RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux \5# RUN: -mcpu=mips32 %S/Inputs/mips-dynamic.s -o %t1.o6# RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux \7# RUN: -mcpu=mips32r2 %s -o %t2.o8# RUN: ld.lld %t1.o %t2.o -o %t.exe9# RUN: llvm-readobj -h %t.exe | FileCheck -check-prefix=R1R2 %s10 11# Check that lld does not allow to link incompatible ISAs.12 13# RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux \14# RUN: -mcpu=mips3 %S/Inputs/mips-dynamic.s -o %t1.o15# RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux \16# RUN: -mcpu=mips32 -mattr=+fp64 %s -o %t2.o17# RUN: not ld.lld %t1.o %t2.o -o /dev/null 2>&1 | FileCheck -check-prefix=R3R32 %s18 19# Check that lld does not allow to link incompatible ISAs.20 21# RUN: llvm-mc -filetype=obj -triple=mips64-unknown-linux \22# RUN: -mcpu=mips64r6 %S/Inputs/mips-dynamic.s -o %t1.o23# RUN: llvm-mc -filetype=obj -triple=mips64-unknown-linux \24# RUN: -position-independent -mcpu=octeon %s -o %t2.o25# RUN: not ld.lld %t1.o %t2.o -o /dev/null 2>&1 \26# RUN: | FileCheck -check-prefix=R6OCTEON %s27 28# Check that lld take in account EF_MIPS_MACH_XXX ISA flags29 30# RUN: llvm-mc -filetype=obj -triple=mips64-unknown-linux \31# RUN: -position-independent -mcpu=mips64 %S/Inputs/mips-dynamic.s -o %t1.o32# RUN: llvm-mc -filetype=obj -triple=mips64-unknown-linux \33# RUN: -position-independent -mcpu=octeon %s -o %t2.o34# RUN: ld.lld %t1.o %t2.o -o %t.exe35# RUN: llvm-readobj -h %t.exe | FileCheck -check-prefix=OCTEON %s36 37 .option pic038 .text39 .global __start40__start:41 nop42 43# R1R2: Flags [44# R1R2-NEXT: EF_MIPS_ABI_O3245# R1R2-NEXT: EF_MIPS_ARCH_32R246# R1R2-NEXT: EF_MIPS_CPIC47# R1R2-NEXT: ]48 49# R3R32: error: incompatible target ISA:50# R3R32-NEXT: >>> {{.+}}mips-elf-flags-err.s.tmp1.o: mips351# R3R32-NEXT: >>> {{.+}}mips-elf-flags-err.s.tmp2.o: mips3252 53# R6OCTEON: error: incompatible target ISA:54# R6OCTEON-NEXT: >>> {{.+}}mips-elf-flags-err.s.tmp1.o: mips64r655# R6OCTEON-NEXT: >>> {{.+}}mips-elf-flags-err.s.tmp2.o: mips64r2 (octeon)56 57# OCTEON: Flags [58# OCTEON-NEXT: EF_MIPS_ARCH_64R259# OCTEON-NEXT: EF_MIPS_CPIC60# OCTEON-NEXT: EF_MIPS_MACH_OCTEON61# OCTEON: ]62