1# REQUIRES: mips
2#
3# Check warning and errors in case of input
4# files with incompatible ELF header flags.
5
6# RUN: yaml2obj --docnum=1 %s -o %t-n64.o
7# RUN: yaml2obj --docnum=2 %s -o %t-o64.o
8# RUN: yaml2obj --docnum=3 %s -o %t-n32.o
9# RUN: yaml2obj --docnum=4 %s -o %t-o32.o
10# RUN: yaml2obj --docnum=5 %s -o %t-eabi64.o
11# RUN: yaml2obj --docnum=6 %s -o %t-eabi32.o
12
13# RUN: not ld.lld %t-n64.o %t-eabi64.o -shared -o /dev/null 2>&1 \
14# RUN:   | FileCheck -check-prefixes=MM64,N64EABI64 %s
15#
16# RUN: not ld.lld %t-n64.o %t-o64.o -shared -o /dev/null 2>&1 \
17# RUN:   | FileCheck -check-prefixes=MM64,N64O64 %s
18
19# RUN: not ld.lld %t-o32.o %t-eabi32.o -shared -o /dev/null 2>&1 \
20# RUN:   | FileCheck -check-prefixes=O32EABI32,FP64,CPIC1 %s
21
22# RUN: not ld.lld %t-eabi32.o %t-o32.o -shared -o /dev/null 2>&1 \
23# RUN:   | FileCheck -check-prefix=CPIC2 %s
24
25# MM64: {{.*}}n64.o: microMIPS 64-bit is not supported
26
27# N64EABI64: {{.*}}eabi64.o: ABI 'eabi64' is incompatible with target ABI 'n64'
28# N64O64: {{.*}}o64.o: ABI 'o64' is incompatible with target ABI 'n64'
29# O32EABI32: {{.*}}eabi32.o: ABI 'eabi32' is incompatible with target ABI 'o32'
30
31# NAN: {{.*}}o32.o: -mnan=legacy is incompatible with target -mnan=2008
32# FP64: {{.*}}eabi32.o: -mfp64 is incompatible with target -mfp32
33
34# CPIC1: {{.*}}tmp-eabi32.o: linking non-abicalls code with abicalls code {{.*}}o32.o
35# CPIC2: {{.*}}tmp-o32.o: linking abicalls code with non-abicalls code {{.*}}eabi32.o
36
37# n64.o
38--- !ELF
39FileHeader:
40  Class:    ELFCLASS64
41  Data:     ELFDATA2MSB
42  Type:     ET_REL
43  Machine:  EM_MIPS
44  Flags:    [ EF_MIPS_ARCH_64, EF_MIPS_MICROMIPS ]
45
46# o64.o
47--- !ELF
48FileHeader:
49  Class:    ELFCLASS64
50  Data:     ELFDATA2MSB
51  Type:     ET_REL
52  Machine:  EM_MIPS
53  Flags:    [ EF_MIPS_ABI_O64, EF_MIPS_ARCH_64 ]
54
55# n32.o
56--- !ELF
57FileHeader:
58  Class:    ELFCLASS32
59  Data:     ELFDATA2MSB
60  Type:     ET_REL
61  Machine:  EM_MIPS
62  Flags:    [ EF_MIPS_ARCH_64, EF_MIPS_ABI2, EF_MIPS_NAN2008 ]
63
64# o32.o
65--- !ELF
66FileHeader:
67  Class:    ELFCLASS32
68  Data:     ELFDATA2MSB
69  Type:     ET_REL
70  Machine:  EM_MIPS
71  Flags:    [ EF_MIPS_ARCH_32, EF_MIPS_ABI_O32, EF_MIPS_CPIC ]
72
73# eabi64.o
74--- !ELF
75FileHeader:
76  Class:    ELFCLASS64
77  Data:     ELFDATA2MSB
78  Type:     ET_REL
79  Machine:  EM_MIPS
80  Flags:    [ EF_MIPS_ARCH_64, EF_MIPS_ABI_EABI64 ]
81
82# eabi32.o
83--- !ELF
84FileHeader:
85  Class:    ELFCLASS32
86  Data:     ELFDATA2MSB
87  Type:     ET_REL
88  Machine:  EM_MIPS
89  Flags:    [ EF_MIPS_ARCH_32, EF_MIPS_ABI_EABI32, EF_MIPS_FP64 ]
90