Skip to content

Commit 7196518

Browse files
committed
[ELF,test] Improve -r incompatibility tests
1 parent bc31be7 commit 7196518

File tree

1 file changed

+18
-30
lines changed

1 file changed

+18
-30
lines changed

lld/test/ELF/driver.test

Lines changed: 18 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -3,55 +3,47 @@
33
# RUN: not ld.lld --unknown1 --unkn=own2 -m foo /no/such/file -lnosuchlib \
44
# RUN: 2>&1 | FileCheck -check-prefix=UNKNOWN %s
55

6-
# UNKNOWN: unknown argument '--unknown1'
7-
# UNKNOWN: unknown argument '--unkn=own2'
8-
# UNKNOWN: unknown emulation: foo
9-
# UNKNOWN: cannot open /no/such/file
10-
# UNKNOWN: unable to find library -lnosuchlib
6+
# UNKNOWN: error: unknown argument '--unknown1'
7+
# UNKNOWN: error: unknown argument '--unkn=own2'
8+
# UNKNOWN: error: unknown emulation: foo
9+
# UNKNOWN: error: cannot open /no/such/file
10+
# UNKNOWN: error: unable to find library -lnosuchlib
1111

1212
# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t
1313
# RUN: not ld.lld %t -o /no/such/file 2>&1 | FileCheck -check-prefix=MISSING %s
14-
# MISSING: cannot open output file /no/such/file
14+
# MISSING: error: cannot open output file /no/such/file
1515

1616
# RUN: ld.lld --help 2>&1 | FileCheck -check-prefix=HELP %s
1717
# HELP: USAGE:
1818
# HELP: : supported targets:{{.*}} elf
1919

2020
# RUN: not ld.lld --versin 2>&1 | FileCheck -check-prefix=SPELLVERSION %s
21-
# SPELLVERSION: unknown argument '--versin', did you mean '--version'
21+
# SPELLVERSION: error: unknown argument '--versin', did you mean '--version'
2222

2323
## Attempt to link DSO with -r
2424
# RUN: ld.lld -shared %t -o %t.so
2525
# RUN: not ld.lld -r %t.so %t -o /dev/null 2>&1 | FileCheck -check-prefix=ERR %s
26-
# ERR: attempted static link of dynamic object
26+
# ERR: error: attempted static link of dynamic object
2727

28-
## Attempt to use -r and -shared together
29-
# RUN: not ld.lld -r -shared %t -o /dev/null 2>&1 | FileCheck -check-prefix=ERR2 %s
30-
# ERR2: -r and -shared may not be used together
28+
# RUN: not ld.lld -r -shared -pie --export-dynamic %t -o /dev/null 2>&1 | FileCheck -check-prefix=ERR2 %s
29+
# ERR2: error: -r and -shared may not be used together
30+
# ERR2: error: -r and -pie may not be used together
31+
# ERR2: error: -r and --export-dynamic may not be used together
3132

32-
## Attempt to use -r and --gdb-index together
33-
# RUN: not ld.lld -r --gdb-index %t -o /dev/null 2>&1 | FileCheck -check-prefix=ERR4 %s
34-
# ERR4: -r and --gdb-index may not be used together
33+
# RUN: not ld.lld -r --icf=all --gdb-index %t -o /dev/null 2>&1 | FileCheck -check-prefix=ERR4 %s
34+
# ERR4: error: -r and --gdb-index may not be used together
35+
# ERR4: error: -r and --icf may not be used together
3536

36-
## Attempt to use -r and --icf together
37-
# RUN: not ld.lld -r --icf=all %t -o /dev/null 2>&1 | FileCheck -check-prefix=ERR5 %s
38-
# ERR5: -r and --icf may not be used together
39-
40-
## Attempt to use -r and -pie together
41-
# RUN: not ld.lld -r -pie %t -o /dev/null 2>&1 | FileCheck -check-prefix=ERR6 %s
42-
# ERR6: -r and -pie may not be used together
43-
44-
## Attempt to use -shared and -pie together
4537
# RUN: not ld.lld -shared -pie %t -o /dev/null 2>&1 | FileCheck -check-prefix=ERR7 %s
46-
# ERR7: -shared and -pie may not be used together
38+
# ERR7: error: -shared and -pie may not be used together
4739

4840
## "--output=foo" is equivalent to "-o foo".
4941
# RUN: not ld.lld %t --output=/no/such/file 2>&1 | FileCheck -check-prefix=ERR8 %s
50-
# ERR8: cannot open output file /no/such/file
42+
# ERR8: error: cannot open output file /no/such/file
5143

5244
## "-output=foo" is equivalent to "-o utput=foo".
5345
# RUN: not ld.lld %t -output=/no/such/file 2>&1 | FileCheck -check-prefix=ERR9 %s
54-
# ERR9: cannot open output file utput=/no/such/file
46+
# ERR9: error: cannot open output file utput=/no/such/file
5547

5648
# RUN: ld.lld %t -z foo -o /dev/null 2>&1 | FileCheck -check-prefix=ERR10 %s --implicit-check-not=warning:
5749
# RUN: ld.lld %t -z foo -z rel -z rela -z max-page-size=1 -z common-page-size=1 -o /dev/null --version 2>&1 | \
@@ -68,10 +60,6 @@
6860
# RUN: not ld.lld %t -z max-page-size 2>&1 | FileCheck -check-prefix=ERR11 %s
6961
# ERR11: error: invalid max-page-size:
7062

71-
## Attempt to use -r and --export-dynamic together
72-
# RUN: not ld.lld -r -export-dynamic %t -o /dev/null 2>&1 | FileCheck -check-prefix=ERR12 %s
73-
# ERR12: -r and --export-dynamic may not be used together
74-
7563
.globl _start
7664
_start:
7765
nop

0 commit comments

Comments
 (0)