68 lines · plain
1# REQUIRES: x862 3# RUN: not ld.lld --unknown1 --unkn=own2 -m foo /no/such/file -lnosuchlib \4# RUN: 2>&1 | FileCheck -check-prefix=UNKNOWN %s5 6# UNKNOWN: error: unknown argument '--unknown1'7# UNKNOWN: error: unknown argument '--unkn=own2'8# UNKNOWN: error: unknown emulation: foo9# UNKNOWN: error: cannot open /no/such/file10# UNKNOWN: error: unable to find library -lnosuchlib11 12# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t13# RUN: not ld.lld %t -o /no/such/file 2>&1 | FileCheck -check-prefix=MISSING %s14# MISSING: error: cannot open output file /no/such/file15 16# RUN: ld.lld --help 2>&1 | FileCheck -check-prefix=HELP %s17# HELP: USAGE:18# HELP: : supported targets:{{.*}} elf19 20# RUN: not ld.lld --versin 2>&1 | FileCheck -check-prefix=SPELLVERSION %s21# SPELLVERSION: error: unknown argument '--versin', did you mean '--version'22 23## Attempt to link DSO with -r24# RUN: ld.lld -shared %t -o %t.so25# RUN: not ld.lld -r %t.so %t -o /dev/null 2>&1 | FileCheck -check-prefix=ERR %s26# ERR: error: attempted static link of dynamic object27 28# RUN: not ld.lld -r -shared -pie --export-dynamic %t -o /dev/null 2>&1 | FileCheck -check-prefix=ERR2 %s29# ERR2: error: -r and -shared may not be used together30# ERR2: error: -r and -pie may not be used together31# ERR2: error: -r and --export-dynamic may not be used together32 33# RUN: not ld.lld -r --icf=all --gdb-index --debug-names %t -o /dev/null 2>&1 | FileCheck -check-prefix=ERR4 %s34# ERR4: error: -r and --gdb-index may not be used together35# ERR4: error: -r and --icf may not be used together36# ERR4: error: -r and --debug-names may not be used together37 38# RUN: not ld.lld -shared -pie %t -o /dev/null 2>&1 | FileCheck -check-prefix=ERR7 %s39# ERR7: error: -shared and -pie may not be used together40 41## "--output=foo" is equivalent to "-o foo".42# RUN: not ld.lld %t --output=/no/such/file 2>&1 | FileCheck -check-prefix=ERR8 %s43# ERR8: error: cannot open output file /no/such/file44 45## "-output=foo" is equivalent to "-o utput=foo".46# RUN: not ld.lld %t -output=/no/such/file 2>&1 | FileCheck -check-prefix=ERR9 %s47# ERR9: error: cannot open output file utput=/no/such/file48 49# RUN: ld.lld %t -z foo -o /dev/null 2>&1 | FileCheck -check-prefix=ERR10 %s --implicit-check-not=warning:50# RUN: ld.lld %t -z foo -z rel -z rela -z max-page-size=1 -z common-page-size=1 -z dynamic-undefined-weak \51# RUN: -z nodynamic-undefined-weak -o /dev/null --version 2>&1 | \52# RUN: FileCheck -check-prefix=ERR10 %s --implicit-check-not=warning:53# ERR10: warning: unknown -z value: foo54 55## Check we report "unknown -z value" error even with -v.56# RUN: ld.lld %t -z foo -z rel -o /dev/null -v 2>&1 | FileCheck -check-prefix=ERR10 %s --implicit-check-not=warning:57 58## Note: in GNU ld, --fatal-warning still leads to a warning.59# RUN: not ld.lld %t -z foo --fatal-warnings 2>&1 | FileCheck --check-prefix=ERR10-FATAL %s60# ERR10-FATAL: error: unknown -z value: foo61 62# RUN: not ld.lld %t -z max-page-size 2>&1 | FileCheck -check-prefix=ERR11 %s63# ERR11: error: invalid max-page-size:64 65.globl _start66_start:67 nop68