[lld] r293275 - [lld][mips] Correct tests for mips64 implying PIC.

Simon Dardis via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 27 03:01:10 PST 2017


Author: sdardis
Date: Fri Jan 27 05:01:10 2017
New Revision: 293275

URL: http://llvm.org/viewvc/llvm-project?rev=293275&view=rev
Log:
[lld][mips] Correct tests for mips64 implying PIC.

Currently LLVM can only generate PIC code for MIPS64 with the N64 as
it uses the idiom "isPositionIndependent() || IsABI_N64()" throughout the
MIPS backend. r293164 changed this, causing test failures for LLD.

This patch changes the tests minimally to preserve existing test coverage
and one case where the test was "right" in the wrong circumstance.

Reviewers: atanasyan

Differential Revision: https://reviews.llvm.org/D29194


Modified:
    lld/trunk/test/ELF/emulation.s
    lld/trunk/test/ELF/mips-elf-flags-err.s
    lld/trunk/test/ELF/mips-elf-flags.s

Modified: lld/trunk/test/ELF/emulation.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/emulation.s?rev=293275&r1=293274&r2=293275&view=diff
==============================================================================
--- lld/trunk/test/ELF/emulation.s (original)
+++ lld/trunk/test/ELF/emulation.s Fri Jan 27 05:01:10 2017
@@ -274,7 +274,8 @@
 # MIPSEL-NEXT:     EF_MIPS_CPIC
 # MIPSEL-NEXT:   ]
 
-# RUN: llvm-mc -filetype=obj -triple=mips64-unknown-linux %s -o %tmips64
+# RUN: llvm-mc -filetype=obj -triple=mips64-unknown-linux -position-independent \
+# RUN:         %s -o %tmips64
 # RUN: ld.lld -m elf64btsmip -e _start %tmips64 -o %t2mips64
 # RUN: llvm-readobj -file-headers %t2mips64 | FileCheck --check-prefix=MIPS64 %s
 # RUN: ld.lld %tmips64 -e _start -o %t3mips64
@@ -301,7 +302,8 @@
 # MIPS64-NEXT:     EF_MIPS_PIC
 # MIPS64-NEXT:   ]
 
-# RUN: llvm-mc -filetype=obj -triple=mips64el-unknown-linux %s -o %tmips64el
+# RUN: llvm-mc -filetype=obj -triple=mips64el-unknown-linux \
+# RUN:         -position-independent %s -o %tmips64el
 # RUN: ld.lld -m elf64ltsmip -e _start %tmips64el -o %t2mips64el
 # RUN: llvm-readobj -file-headers %t2mips64el | FileCheck --check-prefix=MIPS64EL %s
 # RUN: ld.lld %tmips64el -e _start -o %t3mips64el

Modified: lld/trunk/test/ELF/mips-elf-flags-err.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/mips-elf-flags-err.s?rev=293275&r1=293274&r2=293275&view=diff
==============================================================================
--- lld/trunk/test/ELF/mips-elf-flags-err.s (original)
+++ lld/trunk/test/ELF/mips-elf-flags-err.s Fri Jan 27 05:01:10 2017
@@ -20,7 +20,7 @@
 # RUN: llvm-mc -filetype=obj -triple=mips64-unknown-linux \
 # RUN:         -mcpu=mips64r6 %S/Inputs/mips-dynamic.s -o %t1.o
 # RUN: llvm-mc -filetype=obj -triple=mips64-unknown-linux \
-# RUN:         -mcpu=octeon %s -o %t2.o
+# RUN:         -position-independent -mcpu=octeon %s -o %t2.o
 # RUN: not ld.lld %t1.o %t2.o -o %t.exe 2>&1 \
 # RUN:   | FileCheck -check-prefix=R6OCTEON %s
 
@@ -35,9 +35,9 @@
 # Check that lld take in account EF_MIPS_MACH_XXX ISA flags
 
 # RUN: llvm-mc -filetype=obj -triple=mips64-unknown-linux \
-# RUN:         -mcpu=mips64 %S/Inputs/mips-dynamic.s -o %t1.o
+# RUN:         -position-independent -mcpu=mips64 %S/Inputs/mips-dynamic.s -o %t1.o
 # RUN: llvm-mc -filetype=obj -triple=mips64-unknown-linux \
-# RUN:         -mcpu=octeon %s -o %t2.o
+# RUN:         -position-independent -mcpu=octeon %s -o %t2.o
 # RUN: ld.lld %t1.o %t2.o -o %t.exe
 # RUN: llvm-readobj -h %t.exe | FileCheck -check-prefix=OCTEON %s
 
@@ -79,8 +79,7 @@ __start:
 # OCTEON-NEXT:   EF_MIPS_ARCH_64R2
 # OCTEON-NEXT:   EF_MIPS_CPIC
 # OCTEON-NEXT:   EF_MIPS_MACH_OCTEON
-# OCTEON-NEXT:   EF_MIPS_PIC
-# OCTEON-NEXT: ]
+# OCTEON:      ]
 
 # N32O32: error: {{.*}}mips-elf-flags-err.s.tmp2.o is incompatible with {{.*}}mips-elf-flags-err.s.tmp1.o
 

Modified: lld/trunk/test/ELF/mips-elf-flags.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/mips-elf-flags.s?rev=293275&r1=293274&r2=293275&view=diff
==============================================================================
--- lld/trunk/test/ELF/mips-elf-flags.s (original)
+++ lld/trunk/test/ELF/mips-elf-flags.s Fri Jan 27 05:01:10 2017
@@ -30,7 +30,7 @@
 # RUN:   | FileCheck -check-prefix=EXE-R6 %s
 
 # RUN: llvm-mc -filetype=obj -triple=mips64-unknown-linux \
-# RUN:         -mcpu=octeon %s -o %t.o
+# RUN:         -position-independent -mcpu=octeon %s -o %t.o
 # RUN: ld.lld %t.o -o %t.exe
 # RUN: llvm-readobj -h -mips-abi-flags %t.exe \
 # RUN:   | FileCheck -check-prefix=OCTEON %s




More information about the llvm-commits mailing list