[PATCH] D29194: [lld][mips] Correct tests for mips64 implying PIC.
Simon Dardis via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 26 12:30:43 PST 2017
sdardis created this revision.
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.
https://reviews.llvm.org/D29194
Files:
test/ELF/emulation.s
test/ELF/mips-elf-flags-err.s
test/ELF/mips-elf-flags.s
Index: test/ELF/mips-elf-flags.s
===================================================================
--- test/ELF/mips-elf-flags.s
+++ test/ELF/mips-elf-flags.s
@@ -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
Index: test/ELF/mips-elf-flags-err.s
===================================================================
--- test/ELF/mips-elf-flags-err.s
+++ test/ELF/mips-elf-flags-err.s
@@ -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 @@
# 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
Index: test/ELF/emulation.s
===================================================================
--- test/ELF/emulation.s
+++ test/ELF/emulation.s
@@ -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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D29194.85947.patch
Type: text/x-patch
Size: 3029 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170126/d1a916b1/attachment.bin>
More information about the llvm-commits
mailing list