summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/COFF/pdb-type-server-missing.yaml7
-rw-r--r--test/ELF/Inputs/mips-gp-dips-corrupt-ver.s14
-rwxr-xr-xtest/ELF/Inputs/mips-gp-dips-corrupt-ver.sobin0 -> 2160 bytes
-rw-r--r--test/ELF/mips-gp-disp-ver.s15
-rw-r--r--test/ELF/pie.s2
5 files changed, 32 insertions, 6 deletions
diff --git a/test/COFF/pdb-type-server-missing.yaml b/test/COFF/pdb-type-server-missing.yaml
index 91bb04f5622f..fbbb46f6b4fd 100644
--- a/test/COFF/pdb-type-server-missing.yaml
+++ b/test/COFF/pdb-type-server-missing.yaml
@@ -1,13 +1,10 @@
# This is an object compiled with /Zi (see the LF_TYPESERVER2 record) without an
# adjacent type server PDB. Test that LLD fails gracefully on it.
-# FIXME: Ideally we'd do what MSVC does, which is to warn and drop all debug
-# info in the object with the missing PDB.
-
# RUN: yaml2obj %s -o %t.obj
-# RUN: not lld-link %t.obj -out:%t.exe -debug -pdb:%t.pdb -nodefaultlib -entry:main 2>&1 | FileCheck %s
+# RUN: lld-link %t.obj -out:%t.exe -debug -pdb:%t.pdb -nodefaultlib -entry:main 2>&1 | FileCheck %s
-# CHECK: error: Type server PDB was not found
+# CHECK: warning: Type server PDB for {{.*}}.obj is invalid, ignoring debug info.
--- !COFF
header:
diff --git a/test/ELF/Inputs/mips-gp-dips-corrupt-ver.s b/test/ELF/Inputs/mips-gp-dips-corrupt-ver.s
new file mode 100644
index 000000000000..42bd32a1e73a
--- /dev/null
+++ b/test/ELF/Inputs/mips-gp-dips-corrupt-ver.s
@@ -0,0 +1,14 @@
+# Source file for mips-gp-dips-corrupt-ver.so
+#
+# % cat gpdisp.ver
+# LLD_1.0.0 { global: foo; };
+#
+# % as mips-gp-dips-corrupt-ver.s -o mips-gp-dips-corrupt-ver.o
+# % ld -shared -o mips-gp-dips-corrupt-ver.so \
+# --version-script gpdisp.ver mips-gp-dips-corrupt-ver.o
+
+ .global foo
+ .text
+foo:
+ lui $t0, %hi(_gp_disp)
+ addi $t0, $t0, %lo(_gp_disp)
diff --git a/test/ELF/Inputs/mips-gp-dips-corrupt-ver.so b/test/ELF/Inputs/mips-gp-dips-corrupt-ver.so
new file mode 100755
index 000000000000..289ffa538f0c
--- /dev/null
+++ b/test/ELF/Inputs/mips-gp-dips-corrupt-ver.so
Binary files differ
diff --git a/test/ELF/mips-gp-disp-ver.s b/test/ELF/mips-gp-disp-ver.s
new file mode 100644
index 000000000000..134a056a3620
--- /dev/null
+++ b/test/ELF/mips-gp-disp-ver.s
@@ -0,0 +1,15 @@
+# MIPS BFD linker puts _gp_disp symbol into DSO files and assigns zero
+# version definition index to it. This value means 'unversioned local symbol'
+# while _gp_disp is a section global symbol. We have to handle this bug
+# in the LLD because BFD linker is used for building MIPS toolchain
+# libraries. This test checks such handling.
+
+# RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux %s -o %t.o
+# RUN: ld.lld %t.o %S/Inputs/mips-gp-dips-corrupt-ver.so
+
+# REQUIRES: mips
+
+ .global __start
+ .text
+__start:
+ lw $t0, %got(foo)($gp)
diff --git a/test/ELF/pie.s b/test/ELF/pie.s
index 5964db5c9399..3efd6e337c64 100644
--- a/test/ELF/pie.s
+++ b/test/ELF/pie.s
@@ -48,7 +48,7 @@
# CHECK: Type: PT_DYNAMIC
## Check -nopie
-# RUN: ld.lld -nopie %t1.o -o %t2
+# RUN: ld.lld -no-pie %t1.o -o %t2
# RUN: llvm-readobj -file-headers -r %t2 | FileCheck %s --check-prefix=NOPIE
# NOPIE-NOT: Type: SharedObject