• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# REQUIRES: mips
2# 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.o
6# RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux \
7# RUN:         -mcpu=mips32r2 %s -o %t2.o
8# RUN: ld.lld %t1.o %t2.o -o %t.exe
9# RUN: llvm-readobj -h %t.exe | FileCheck -check-prefix=R1R2 %s
10
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.o
15# RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux \
16# RUN:         -mcpu=mips32 -mattr=+fp64 %s -o %t2.o
17# RUN: not ld.lld %t1.o %t2.o -o /dev/null 2>&1 | FileCheck -check-prefix=R3R32 %s
18
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.o
23# RUN: llvm-mc -filetype=obj -triple=mips64-unknown-linux \
24# RUN:         -position-independent -mcpu=octeon %s -o %t2.o
25# RUN: not ld.lld %t1.o %t2.o -o /dev/null 2>&1 \
26# RUN:   | FileCheck -check-prefix=R6OCTEON %s
27
28# Check that lld take in account EF_MIPS_MACH_XXX ISA flags
29
30# RUN: llvm-mc -filetype=obj -triple=mips64-unknown-linux \
31# RUN:         -position-independent -mcpu=mips64 %S/Inputs/mips-dynamic.s -o %t1.o
32# RUN: llvm-mc -filetype=obj -triple=mips64-unknown-linux \
33# RUN:         -position-independent -mcpu=octeon %s -o %t2.o
34# RUN: ld.lld %t1.o %t2.o -o %t.exe
35# RUN: llvm-readobj -h %t.exe | FileCheck -check-prefix=OCTEON %s
36
37  .option pic0
38  .text
39  .global  __start
40__start:
41  nop
42
43# R1R2:      Flags [
44# R1R2-NEXT:   EF_MIPS_ABI_O32
45# R1R2-NEXT:   EF_MIPS_ARCH_32R2
46# R1R2-NEXT:   EF_MIPS_CPIC
47# R1R2-NEXT: ]
48
49# R3R32:      error: incompatible target ISA:
50# R3R32-NEXT: >>> {{.+}}mips-elf-flags-err.s.tmp1.o: mips3
51# R3R32-NEXT: >>> {{.+}}mips-elf-flags-err.s.tmp2.o: mips32
52
53# R6OCTEON:      error: incompatible target ISA:
54# R6OCTEON-NEXT: >>> {{.+}}mips-elf-flags-err.s.tmp1.o: mips64r6
55# R6OCTEON-NEXT: >>> {{.+}}mips-elf-flags-err.s.tmp2.o: mips64r2 (octeon)
56
57# OCTEON:      Flags [
58# OCTEON-NEXT:   EF_MIPS_ARCH_64R2
59# OCTEON-NEXT:   EF_MIPS_CPIC
60# OCTEON-NEXT:   EF_MIPS_MACH_OCTEON
61# OCTEON:      ]
62