2016-02-03 06:48:04 +08:00
|
|
|
# REQUIRES: x86
|
|
|
|
|
2019-07-05 20:31:32 +08:00
|
|
|
# RUN: not ld.lld --unknown1 --unkn=own2 -m foo /no/such/file -lnosuchlib \
|
2016-02-28 11:18:07 +08:00
|
|
|
# RUN: 2>&1 | FileCheck -check-prefix=UNKNOWN %s
|
2016-02-03 05:13:09 +08:00
|
|
|
|
2019-05-07 21:48:30 +08:00
|
|
|
# UNKNOWN: unknown argument '--unknown1'
|
2019-07-05 20:31:32 +08:00
|
|
|
# UNKNOWN: unknown argument '--unkn=own2'
|
2016-03-12 16:31:34 +08:00
|
|
|
# UNKNOWN: unknown emulation: foo
|
2016-03-11 22:43:02 +08:00
|
|
|
# UNKNOWN: cannot open /no/such/file
|
2016-03-12 16:31:34 +08:00
|
|
|
# UNKNOWN: unable to find library -lnosuchlib
|
2016-02-03 06:48:04 +08:00
|
|
|
|
|
|
|
# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t
|
2016-02-28 11:18:07 +08:00
|
|
|
# RUN: not ld.lld %t -o /no/such/file 2>&1 | FileCheck -check-prefix=MISSING %s
|
2017-03-14 01:24:52 +08:00
|
|
|
# MISSING: cannot open output file /no/such/file
|
2016-02-03 06:48:04 +08:00
|
|
|
|
2016-02-28 11:18:09 +08:00
|
|
|
# RUN: ld.lld --help 2>&1 | FileCheck -check-prefix=HELP %s
|
|
|
|
# HELP: USAGE:
|
2017-03-23 09:16:57 +08:00
|
|
|
# HELP: : supported targets:{{.*}} elf
|
2016-02-28 11:18:09 +08:00
|
|
|
|
2016-11-20 02:14:24 +08:00
|
|
|
# RUN: ld.lld --version 2>&1 | FileCheck -check-prefix=VERSION %s
|
2017-12-05 08:03:41 +08:00
|
|
|
# RUN: ld.lld -v 2>&1 | FileCheck -check-prefix=VERSION %s
|
|
|
|
# RUN: not ld.lld -v xyz 2>&1 | FileCheck -check-prefix=VERSION %s
|
2017-03-23 02:04:57 +08:00
|
|
|
# VERSION: LLD {{.*}} (compatible with GNU linkers)
|
2016-02-03 06:48:04 +08:00
|
|
|
|
2019-05-07 21:48:30 +08:00
|
|
|
# RUN: not ld.lld --versin 2>&1 | FileCheck -check-prefix=SPELLVERSION %s
|
|
|
|
# SPELLVERSION: unknown argument '--versin', did you mean '--version'
|
|
|
|
|
2016-03-02 03:38:51 +08:00
|
|
|
## Attempt to link DSO with -r
|
|
|
|
# RUN: ld.lld -shared %t -o %t.so
|
2019-10-08 16:03:44 +08:00
|
|
|
# RUN: not ld.lld -r %t.so %t -o /dev/null 2>&1 | FileCheck -check-prefix=ERR %s
|
2016-03-12 16:31:34 +08:00
|
|
|
# ERR: attempted static link of dynamic object
|
2016-03-02 03:38:51 +08:00
|
|
|
|
|
|
|
## Attempt to use -r and -shared together
|
2019-10-08 16:03:44 +08:00
|
|
|
# RUN: not ld.lld -r -shared %t -o /dev/null 2>&1 | FileCheck -check-prefix=ERR2 %s
|
2016-03-02 03:38:51 +08:00
|
|
|
# ERR2: -r and -shared may not be used together
|
|
|
|
|
2018-07-19 06:02:48 +08:00
|
|
|
## Attempt to use -r and --gdb-index together
|
2019-10-08 16:03:44 +08:00
|
|
|
# RUN: not ld.lld -r --gdb-index %t -o /dev/null 2>&1 | FileCheck -check-prefix=ERR4 %s
|
2018-07-19 06:02:48 +08:00
|
|
|
# ERR4: -r and --gdb-index may not be used together
|
|
|
|
|
2016-03-02 03:38:51 +08:00
|
|
|
## Attempt to use -r and --icf together
|
2019-10-08 16:03:44 +08:00
|
|
|
# RUN: not ld.lld -r --icf=all %t -o /dev/null 2>&1 | FileCheck -check-prefix=ERR5 %s
|
2018-07-19 06:02:48 +08:00
|
|
|
# ERR5: -r and --icf may not be used together
|
2016-03-02 03:38:51 +08:00
|
|
|
|
2016-03-17 13:57:33 +08:00
|
|
|
## Attempt to use -r and -pie together
|
2019-10-08 16:03:44 +08:00
|
|
|
# RUN: not ld.lld -r -pie %t -o /dev/null 2>&1 | FileCheck -check-prefix=ERR6 %s
|
2018-07-19 06:02:48 +08:00
|
|
|
# ERR6: -r and -pie may not be used together
|
2016-03-17 13:57:33 +08:00
|
|
|
|
|
|
|
## Attempt to use -shared and -pie together
|
2019-10-08 16:03:44 +08:00
|
|
|
# RUN: not ld.lld -shared -pie %t -o /dev/null 2>&1 | FileCheck -check-prefix=ERR7 %s
|
2018-07-19 06:02:48 +08:00
|
|
|
# ERR7: -shared and -pie may not be used together
|
2016-03-17 13:57:33 +08:00
|
|
|
|
2016-09-09 08:25:56 +08:00
|
|
|
## "--output=foo" is equivalent to "-o foo".
|
2018-07-19 06:02:48 +08:00
|
|
|
# RUN: not ld.lld %t --output=/no/such/file 2>&1 | FileCheck -check-prefix=ERR8 %s
|
|
|
|
# ERR8: cannot open output file /no/such/file
|
2016-09-09 08:25:56 +08:00
|
|
|
|
|
|
|
## "-output=foo" is equivalent to "-o utput=foo".
|
2018-07-19 06:02:48 +08:00
|
|
|
# RUN: not ld.lld %t -output=/no/such/file 2>&1 | FileCheck -check-prefix=ERR9 %s
|
|
|
|
# ERR9: cannot open output file utput=/no/such/file
|
2016-09-09 08:25:56 +08:00
|
|
|
|
2018-07-19 06:02:48 +08:00
|
|
|
# RUN: not ld.lld %t -z foo 2>&1 | FileCheck -check-prefix=ERR10 %s
|
2019-02-14 02:48:39 +08:00
|
|
|
# RUN: not ld.lld %t -z foo --version 2>&1 | FileCheck -check-prefix=ERR10 %s
|
2018-07-19 06:02:48 +08:00
|
|
|
# ERR10: unknown -z value: foo
|
2018-06-27 15:22:27 +08:00
|
|
|
|
2018-10-15 22:21:43 +08:00
|
|
|
## Check we report "unknown -z value" error even with -v.
|
|
|
|
# RUN: not ld.lld %t -z foo -v 2>&1 | FileCheck -check-prefix=ERR10 %s
|
|
|
|
|
2018-07-19 06:02:48 +08:00
|
|
|
# RUN: not ld.lld %t -z max-page-size 2>&1 | FileCheck -check-prefix=ERR11 %s
|
|
|
|
# ERR11: unknown -z value: max-page-size
|
2018-06-27 15:56:23 +08:00
|
|
|
|
2019-10-08 16:03:40 +08:00
|
|
|
## Attempt to use -r and --export-dynamic together
|
2019-10-08 16:03:44 +08:00
|
|
|
# RUN: not ld.lld -r -export-dynamic %t -o /dev/null 2>&1 | FileCheck -check-prefix=ERR12 %s
|
2019-10-08 16:03:40 +08:00
|
|
|
# ERR12: -r and --export-dynamic may not be used together
|
|
|
|
|
2016-02-03 06:48:04 +08:00
|
|
|
.globl _start
|
|
|
|
_start:
|
|
|
|
nop
|