1# Check MIPS ELF ISA flag calculation if input files have different ISAs. 2 3# RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux \ 4# RUN: -mcpu=mips32 %S/Inputs/mips-dynamic.s -o %t1.o 5# RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux \ 6# RUN: -mcpu=mips32r2 %s -o %t2.o 7# RUN: ld.lld %t1.o %t2.o -o %t.exe 8# RUN: llvm-readobj -h %t.exe | FileCheck -check-prefix=R1R2 %s 9 10# Check that lld does not allow to link incompatible ISAs. 11 12# RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux \ 13# RUN: -mcpu=mips3 %S/Inputs/mips-dynamic.s -o %t1.o 14# RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux \ 15# RUN: -mcpu=mips32 -mattr=+fp64 %s -o %t2.o 16# RUN: not ld.lld %t1.o %t2.o -o %t.exe 2>&1 | FileCheck -check-prefix=R3R32 %s 17 18# Check that lld does not allow to link incompatible ISAs. 19 20# RUN: llvm-mc -filetype=obj -triple=mips64-unknown-linux \ 21# RUN: -mcpu=mips64r6 %S/Inputs/mips-dynamic.s -o %t1.o 22# RUN: llvm-mc -filetype=obj -triple=mips64-unknown-linux \ 23# RUN: -mcpu=octeon %s -o %t2.o 24# RUN: not ld.lld %t1.o %t2.o -o %t.exe 2>&1 \ 25# RUN: | FileCheck -check-prefix=R6OCTEON %s 26 27# Check that lld does not allow to link incompatible floating point ABI. 28 29# RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux \ 30# RUN: -mcpu=mips32 %S/Inputs/mips-dynamic.s -o %t1.o 31# RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux \ 32# RUN: -mcpu=mips32 -mattr=+fp64 %s -o %t2.o 33# RUN: not ld.lld %t1.o %t2.o -o %t.exe 2>&1 | FileCheck -check-prefix=FPABI %s 34 35# Check that lld take in account EF_MIPS_MACH_XXX ISA flags 36 37# RUN: llvm-mc -filetype=obj -triple=mips64-unknown-linux \ 38# RUN: -mcpu=mips64 %S/Inputs/mips-dynamic.s -o %t1.o 39# RUN: llvm-mc -filetype=obj -triple=mips64-unknown-linux \ 40# RUN: -mcpu=octeon %s -o %t2.o 41# RUN: ld.lld %t1.o %t2.o -o %t.exe 42# RUN: llvm-readobj -h %t.exe | FileCheck -check-prefix=OCTEON %s 43 44# Check that lld does not allow to link incompatible ABIs. 45 46# RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux \ 47# RUN: -target-abi n32 %S/Inputs/mips-dynamic.s -o %t1.o 48# RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux \ 49# RUN: -target-abi o32 %s -o %t2.o 50# RUN: not ld.lld %t1.o %t2.o -o %t.exe 2>&1 | FileCheck -check-prefix=N32O32 %s 51 52# Check that lld does not allow to link modules with incompatible NAN flags. 53 54# RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux \ 55# RUN: -mattr=+nan2008 %S/Inputs/mips-dynamic.s -o %t1.o 56# RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux \ 57# RUN: %s -o %t2.o 58# RUN: not ld.lld %t1.o %t2.o -o %t.exe 2>&1 | FileCheck -check-prefix=NAN %s 59 60# REQUIRES: mips 61 62 .option pic0 63 .text 64 .global __start 65__start: 66 nop 67 68# R1R2: Flags [ 69# R1R2-NEXT: EF_MIPS_ABI_O32 70# R1R2-NEXT: EF_MIPS_ARCH_32R2 71# R1R2-NEXT: EF_MIPS_CPIC 72# R1R2-NEXT: ] 73 74# R3R32: target ISA 'mips3' is incompatible with 'mips32': {{.*}}mips-elf-flags-err.s.tmp2.o 75# R6OCTEON: target ISA 'mips64r6' is incompatible with 'octeon': {{.*}}mips-elf-flags-err.s.tmp2.o 76# FPABI: target floating point ABI '-mdouble-float' is incompatible with '-mgp32 -mfp64': {{.*}}mips-elf-flags-err.s.tmp2.o 77 78# OCTEON: Flags [ 79# OCTEON-NEXT: EF_MIPS_ARCH_64R2 80# OCTEON-NEXT: EF_MIPS_CPIC 81# OCTEON-NEXT: EF_MIPS_MACH_OCTEON 82# OCTEON-NEXT: EF_MIPS_PIC 83# OCTEON-NEXT: ] 84 85# N32O32: error: {{.*}}mips-elf-flags-err.s.tmp2.o is incompatible with {{.*}}mips-elf-flags-err.s.tmp1.o 86 87# NAN: target -mnan=2008 is incompatible with -mnan=legacy: {{.*}}mips-elf-flags-err.s.tmp2.o 88