aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorRui Ueyama <ruiu@google.com>2019-10-08 08:03:40 +0000
committerRui Ueyama <ruiu@google.com>2019-10-08 08:03:40 +0000
commitdecee5e4e9972c7014ad2cebe4326511c0f1949f (patch)
treea8480544bd0f1a1224d08bea952139c105957b76 /test
parentfd5a9c648e11812a9f88bc0b7bc59e6315f2317c (diff)
Report error if -export-dynamic is used with -r
The combination of the two flags doesn't make sense. And other linkers seem to just ignore --export-dynamic if --relocatable is given, but we probably should report it as an error to let users know that is an invalid combination. Fixes https://bugs.llvm.org/show_bug.cgi?id=43552 Differential Revision: https://reviews.llvm.org/D68441 git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@374022 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/ELF/driver.test4
-rw-r--r--test/ELF/lto/relocation-model.ll6
2 files changed, 4 insertions, 6 deletions
diff --git a/test/ELF/driver.test b/test/ELF/driver.test
index 77f9828a0..c6fbacf0b 100644
--- a/test/ELF/driver.test
+++ b/test/ELF/driver.test
@@ -72,6 +72,10 @@
# RUN: not ld.lld %t -z max-page-size 2>&1 | FileCheck -check-prefix=ERR11 %s
# ERR11: unknown -z value: max-page-size
+## Attempt to use -r and --export-dynamic together
+# RUN: not ld.lld -r -export-dynamic %t -o %tfail 2>&1 | FileCheck -check-prefix=ERR12 %s
+# ERR12: -r and --export-dynamic may not be used together
+
.globl _start
_start:
nop
diff --git a/test/ELF/lto/relocation-model.ll b/test/ELF/lto/relocation-model.ll
index beb693ebe..45e21db64 100644
--- a/test/ELF/lto/relocation-model.ll
+++ b/test/ELF/lto/relocation-model.ll
@@ -14,9 +14,6 @@
; RUN: ld.lld %t.o -o %t-out -save-temps --export-dynamic --noinhibit-exec
; RUN: llvm-readobj -r %t-out.lto.o | FileCheck %s --check-prefix=STATIC
-; RUN: ld.lld %t.o -o %t-out -save-temps -r --export-dynamic
-; RUN: llvm-readobj -r %t-out.lto.o | FileCheck %s --check-prefix=STATIC
-
;; PIC source.
@@ -29,9 +26,6 @@
; RUN: ld.lld %t.pic.o -o %t-out -save-temps --export-dynamic --noinhibit-exec
; RUN: llvm-readobj -r %t-out.lto.o | FileCheck %s --check-prefix=STATIC
-; RUN: ld.lld %t.pic.o -o %t-out -save-temps -r --export-dynamic
-; RUN: llvm-readobj -r %t-out.lto.o | FileCheck %s --check-prefix=PIC
-
;; Explicit flag.