# Check generation of .MIPS.abiflags section under the following conditions: # - There are multiple input object files # - Every input file has valid .MIPS.abiflags section # - .MIPS.abiflags sections have different and incompatible FP ABI # # The .MIPS.abiflags section in the output file should reproduce result # of merging FP ABI flags but the linker must show a warning. # RUN: yaml2obj -format=elf -docnum 1 %s > %t-xx.o # RUN: yaml2obj -format=elf -docnum 2 %s > %t-dbl.o # RUN: yaml2obj -format=elf -docnum 3 %s > %t-sgl.o # RUN: yaml2obj -format=elf -docnum 4 %s > %t-soft.o # RUN: yaml2obj -format=elf -docnum 5 %s > %t-64.o # RUN: yaml2obj -format=elf -docnum 6 %s > %t-64a.o # RUN: lld -flavor gnu -target mipsel -shared -o %t1 %t-xx.o %t-sgl.o 2>&1 \ # RUN: | FileCheck -check-prefix=XX-SINGLE-WARN %s # XX-SINGLE-WARN: FP ABI {{-mfpxx|-msingle-float}} is incompatible with {{-msingle-float|-mfpxx}} # RUN: lld -flavor gnu -target mipsel -shared -o %t2 %t-xx.o %t-soft.o 2>&1 \ # RUN: | FileCheck -check-prefix=XX-SOFT-WARN %s # XX-SOFT-WARN: FP ABI {{-mfpxx|-msoft-float}} is incompatible with {{-msoft-float|-mfpxx}} # RUN: lld -flavor gnu -target mipsel -shared -o %t3 %t-dbl.o %t-sgl.o 2>&1 \ # RUN: | FileCheck -check-prefix=DOUBLE-SINGLE-WARN %s # DOUBLE-SINGLE-WARN: FP ABI {{-mdouble-float|-msingle-float}} is incompatible with {{-msingle-float|-mdouble-float}} # RUN: lld -flavor gnu -target mipsel -shared -o %t4 %t-dbl.o %t-soft.o 2>&1 \ # RUN: | FileCheck -check-prefix=DOUBLE-SOFT-WARN %s # DOUBLE-SOFT-WARN: FP ABI {{-mdouble-float|-msoft-float}} is incompatible with {{-msoft-float|-mdouble-float}} # RUN: lld -flavor gnu -target mipsel -shared -o %t5 %t-dbl.o %t-64.o 2>&1 \ # RUN: | FileCheck -check-prefix=DOUBLE-64-WARN %s # DOUBLE-64-WARN: FP ABI {{-mdouble-float|-mgp32 -mfp64}} is incompatible with {{-mgp32 -mfp64|-mdouble-float}} # RUN: lld -flavor gnu -target mipsel -shared -o %t6 %t-dbl.o %t-64a.o 2>&1 \ # RUN: | FileCheck -check-prefix=DOUBLE-64A-WARN %s # DOUBLE-64A-WARN: FP ABI {{-mdouble-float|-mgp32 -mfp64 -mno-odd-spreg}} is incompatible with {{-mgp32 -mfp64 -mno-odd-spreg|-mdouble-float}} # RUN: lld -flavor gnu -target mipsel -shared -o %t7 %t-sgl.o %t-soft.o 2>&1 \ # RUN: | FileCheck -check-prefix=SINGLE-SOFT-WARN %s # SINGLE-SOFT-WARN: FP ABI {{-msingle-float|-msoft-float}} is incompatible with {{-msoft-float|-msingle-float}} # RUN: lld -flavor gnu -target mipsel -shared -o %t8 %t-sgl.o %t-64.o 2>&1 \ # RUN: | FileCheck -check-prefix=SINGLE-64-WARN %s # SINGLE-64-WARN: FP ABI {{-msingle-float|-mgp32 -mfp64}} is incompatible with {{-mgp32 -mfp64|-msingle-float}} # RUN: lld -flavor gnu -target mipsel -shared -o %t9 %t-sgl.o %t-64a.o 2>&1 \ # RUN: | FileCheck -check-prefix=SINGLE-64A-WARN %s # SINGLE-64A-WARN: FP ABI {{-msingle-float|-mgp32 -mfp64 -mno-odd-spreg}} is incompatible with {{-mgp32 -mfp64 -mno-odd-spreg|-msingle-float}} # RUN: lld -flavor gnu -target mipsel -shared -o %t10 %t-soft.o %t-64.o 2>&1 \ # RUN: | FileCheck -check-prefix=SOFT-64-WARN %s # SOFT-64-WARN: FP ABI {{-msoft-float|-mgp32 -mfp64}} is incompatible with {{-mgp32 -mfp64|-msoft-float}} # RUN: lld -flavor gnu -target mipsel -shared -o %t11 %t-soft.o %t-64a.o 2>&1 \ # RUN: | FileCheck -check-prefix=SOFT-64A-WARN %s # SOFT-64A-WARN: FP ABI {{-msoft-float|-mgp32 -mfp64 -mno-odd-spreg}} is incompatible with {{-mgp32 -mfp64 -mno-odd-spreg|-msoft-float}} # xx.o --- FileHeader: Class: ELFCLASS32 Data: ELFDATA2LSB Type: ET_REL Machine: EM_MIPS Flags: [EF_MIPS_CPIC, EF_MIPS_PIC, EF_MIPS_ABI_O32, EF_MIPS_ARCH_32] Sections: - Name: .MIPS.abiflags Type: SHT_MIPS_ABIFLAGS AddressAlign: 8 ISA: MIPS32 ISARevision: 1 FpABI: FP_XX GPRSize: REG_32 CPR1Size: REG_32 # double.o --- FileHeader: Class: ELFCLASS32 Data: ELFDATA2LSB Type: ET_REL Machine: EM_MIPS Flags: [EF_MIPS_CPIC, EF_MIPS_PIC, EF_MIPS_ABI_O32, EF_MIPS_ARCH_32] Sections: - Name: .MIPS.abiflags Type: SHT_MIPS_ABIFLAGS AddressAlign: 8 ISA: MIPS32 ISARevision: 1 FpABI: FP_DOUBLE GPRSize: REG_32 CPR1Size: REG_32 # single.o --- FileHeader: Class: ELFCLASS32 Data: ELFDATA2LSB Type: ET_REL Machine: EM_MIPS Flags: [EF_MIPS_CPIC, EF_MIPS_PIC, EF_MIPS_ABI_O32, EF_MIPS_ARCH_32] Sections: - Name: .MIPS.abiflags Type: SHT_MIPS_ABIFLAGS AddressAlign: 8 ISA: MIPS32 ISARevision: 1 FpABI: FP_SINGLE GPRSize: REG_32 CPR1Size: REG_32 # soft.o --- FileHeader: Class: ELFCLASS32 Data: ELFDATA2LSB Type: ET_REL Machine: EM_MIPS Flags: [EF_MIPS_CPIC, EF_MIPS_PIC, EF_MIPS_ABI_O32, EF_MIPS_ARCH_32] Sections: - Name: .MIPS.abiflags Type: SHT_MIPS_ABIFLAGS AddressAlign: 8 ISA: MIPS32 ISARevision: 1 FpABI: FP_SOFT GPRSize: REG_32 CPR1Size: REG_NONE # 64.o --- FileHeader: Class: ELFCLASS32 Data: ELFDATA2LSB Type: ET_REL Machine: EM_MIPS Flags: [EF_MIPS_CPIC, EF_MIPS_PIC, EF_MIPS_ABI_O32, EF_MIPS_ARCH_32R2] Sections: - Name: .MIPS.abiflags Type: SHT_MIPS_ABIFLAGS AddressAlign: 8 ISA: MIPS32 ISARevision: 2 FpABI: FP_64 GPRSize: REG_32 CPR1Size: REG_64 Flags1: [ODDSPREG] # 64a.o --- FileHeader: Class: ELFCLASS32 Data: ELFDATA2LSB Type: ET_REL Machine: EM_MIPS Flags: [EF_MIPS_CPIC, EF_MIPS_PIC, EF_MIPS_ABI_O32, EF_MIPS_ARCH_32R2] Sections: - Name: .MIPS.abiflags Type: SHT_MIPS_ABIFLAGS AddressAlign: 8 ISA: MIPS32 ISARevision: 2 FpABI: FP_64A GPRSize: REG_32 CPR1Size: REG_64 Flags1: [] ...