2016-02-03 06:48:04 +08:00
|
|
|
# REQUIRES: x86
|
|
|
|
|
2016-03-03 08:09:02 +08:00
|
|
|
# RUN: not ld.lld --unknown1 --unknown2 -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
|
|
|
|
2016-03-11 22:43:02 +08:00
|
|
|
# UNKNOWN: warning: unknown argument: --unknown1
|
|
|
|
# UNKNOWN: warning: unknown argument: --unknown2
|
|
|
|
# UNKNOWN: unknown argument(s) found
|
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
|
2016-03-11 22:43:02 +08:00
|
|
|
# MISSING: failed to open /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:
|
|
|
|
|
2016-02-28 11:18:07 +08:00
|
|
|
# RUN: ld.lld --version 2>&1 | FileCheck -check-prefix=VERSION %s
|
|
|
|
# VERSION: LLD
|
2016-02-03 06:48:04 +08:00
|
|
|
|
2016-03-02 03:38:51 +08:00
|
|
|
## 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
|
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
|
|
|
|
# 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
|
|
|
|
|
2016-03-17 13:57:33 +08:00
|
|
|
## Attempt to use -r and -pie together
|
|
|
|
# RUN: not ld.lld -r -pie %t -o %tfail 2>&1 | FileCheck -check-prefix=ERR5 %s
|
|
|
|
# ERR5: -r and -pie may not be used together
|
|
|
|
|
|
|
|
## Attempt to use -shared and -pie together
|
|
|
|
# RUN: not ld.lld -shared -pie %t -o %tfail 2>&1 | FileCheck -check-prefix=ERR6 %s
|
|
|
|
# ERR6: -shared and -pie may not be used together
|
|
|
|
|
2016-02-03 06:48:04 +08:00
|
|
|
.globl _start
|
|
|
|
_start:
|
|
|
|
nop
|