summaryrefslogtreecommitdiffstats
path: root/lld/test
diff options
context:
space:
mode:
authorGeorge Rimar <grimar@accesssoftek.com>2016-03-01 19:38:51 +0000
committerGeorge Rimar <grimar@accesssoftek.com>2016-03-01 19:38:51 +0000
commit262b927d3635b629ceca9bc26703987056c130e7 (patch)
treea358ec4d6ee07726a44c75d7bd107d413a7fd3c0 /lld/test
parent7ea02fc7879ccfa9aba47c0dec7d57e8fbeb3b9e (diff)
downloadbcm5719-llvm-262b927d3635b629ceca9bc26703987056c130e7.tar.gz
bcm5719-llvm-262b927d3635b629ceca9bc26703987056c130e7.zip
[ELF] - handle of command line options incompatible with -r
Patch handles the command line options incompatible with relocatable output. Differential revision: http://reviews.llvm.org/D17758 llvm-svn: 262377
Diffstat (limited to 'lld/test')
-rw-r--r--lld/test/ELF/driver.test17
-rw-r--r--lld/test/ELF/relocatable.s9
2 files changed, 17 insertions, 9 deletions
diff --git a/lld/test/ELF/driver.test b/lld/test/ELF/driver.test
index 1691c2a5517..b542ef1af3d 100644
--- a/lld/test/ELF/driver.test
+++ b/lld/test/ELF/driver.test
@@ -20,6 +20,23 @@
# RUN: ld.lld --version 2>&1 | FileCheck -check-prefix=VERSION %s
# VERSION: LLD
+## Attempt to link DSO with -r
+# RUN: ld.lld -shared %t -o %t.so
+# RUN: not ld.lld -r %t.so %t -o %tfail 2>&1 | FileCheck -check-prefix=ERR %s
+# ERR: Attempted static link of dynamic object
+
+## Attempt to use -r and -shared together
+# RUN: not ld.lld -r -shared %t -o %tfail 2>&1 | FileCheck -check-prefix=ERR2 %s
+# ERR2: -r and -shared may not be used together
+
+## Attempt to use -r and --gc-sections together
+# RUN: not ld.lld -r --gc-sections %t -o %tfail 2>&1 | FileCheck -check-prefix=ERR3 %s
+# ERR3: -r and --gc-sections may not be used together
+
+## Attempt to use -r and --icf together
+# RUN: not ld.lld -r --icf=all %t -o %tfail 2>&1 | FileCheck -check-prefix=ERR4 %s
+# ERR4: -r and --icf may not be used together
+
.globl _start
_start:
nop
diff --git a/lld/test/ELF/relocatable.s b/lld/test/ELF/relocatable.s
index 50ac3a80fec..fd7a4f9314d 100644
--- a/lld/test/ELF/relocatable.s
+++ b/lld/test/ELF/relocatable.s
@@ -15,15 +15,6 @@
# RUN: ld.lld -e main %t -o %texec
# RUN: llvm-readobj -file-headers %texec | FileCheck -check-prefix=CHECKEXE %s
-## Attempt to link DSO with -r
-# RUN: ld.lld -shared %t1.o -o %t.so
-# RUN: not ld.lld -r %t.so %t2.o -o %tfail 2>&1 | FileCheck -check-prefix=ERR %s
-# ERR: Attempted static link of dynamic object
-
-## Attempt to use -r and shared together
-# RUN: not ld.lld -r -shared %t2.o -o %tfail 2>&1 | FileCheck -check-prefix=ERR2 %s
-# ERR2: -r and -shared may not be used together
-
# CHECK: ElfHeader {
# CHECK-NEXT: Ident {
# CHECK-NEXT: Magic: (7F 45 4C 46)
OpenPOWER on IntegriCloud