forked from OSchip/llvm-project
[test] Use host platform specific error message substitution in lit tests
On z/OS, the following error message is not matched correctly in lit tests. ``` EDC5129I No such file or directory. ``` This patch uses a lit config substitution to check for platform specific error messages. Reviewed By: muiez, jhenderson Differential Revision: https://reviews.llvm.org/D95246
This commit is contained in:
parent
6e52eebc2a
commit
42a21778f6
|
@ -7,7 +7,7 @@
|
|||
// RUN: %clang_cc1 -triple x86_64 -S -fbasic-block-sections=list=%S/Inputs/basic-block-sections.funcnames -o - < %s | FileCheck %s --check-prefix=BB_WORLD --check-prefix=BB_LIST
|
||||
// RUN: %clang_cc1 -triple x86_64 -S -fbasic-block-sections=all -funique-basic-block-section-names -o - < %s | FileCheck %s --check-prefix=UNIQUE
|
||||
// RUN: rm -f %t
|
||||
// RUN: not %clang_cc1 -fbasic-block-sections=list= -emit-obj -o %t %s 2>&1 | FileCheck %s --check-prefix=ERROR
|
||||
// RUN: not %clang_cc1 -fbasic-block-sections=list= -emit-obj -o %t %s 2>&1 | FileCheck -DMSG=%errc_ENOENT %s --check-prefix=ERROR
|
||||
// RUN: not ls %t
|
||||
|
||||
int world(int a) {
|
||||
|
@ -41,4 +41,4 @@ int another(int a) {
|
|||
//
|
||||
// UNIQUE: .section .text.world.world.__part.1,
|
||||
// UNIQUE: .section .text.another.another.__part.1,
|
||||
// ERROR: error: unable to load basic block sections function list: '{{[Nn]}}o such file or directory'
|
||||
// ERROR: error: unable to load basic block sections function list: '[[MSG]]'
|
||||
|
|
|
@ -7,11 +7,11 @@
|
|||
// RUN: sed -e "s|@DIR@|%/T|g" %S/Inputs/sanitizer-blacklist-vfsoverlay.yaml | sed -e "s|@REAL_FILE@|%/t-func.blacklist|g" | sed -e "s|@NONEXISTENT_FILE@|%/t-nonexistent.blacklist|g" > %t-vfsoverlay.yaml
|
||||
// RUN: %clang_cc1 -fsanitize=unsigned-integer-overflow -ivfsoverlay %t-vfsoverlay.yaml -fsanitize-blacklist=%/T/only-virtual-file.blacklist -emit-llvm %s -o - | FileCheck %s --check-prefix=FUNC
|
||||
|
||||
// RUN: not %clang_cc1 -fsanitize=unsigned-integer-overflow -ivfsoverlay %t-vfsoverlay.yaml -fsanitize-blacklist=%/T/invalid-virtual-file.blacklist -emit-llvm %s -o - 2>&1 | FileCheck %s --check-prefix=INVALID-MAPPED-FILE
|
||||
// INVALID-MAPPED-FILE: invalid-virtual-file.blacklist': {{[Nn]}}o such file or directory
|
||||
// RUN: not %clang_cc1 -fsanitize=unsigned-integer-overflow -ivfsoverlay %t-vfsoverlay.yaml -fsanitize-blacklist=%/T/invalid-virtual-file.blacklist -emit-llvm %s -o - 2>&1 | FileCheck -DMSG=%errc_ENOENT %s --check-prefix=INVALID-MAPPED-FILE
|
||||
// INVALID-MAPPED-FILE: invalid-virtual-file.blacklist': [[MSG]]
|
||||
|
||||
// RUN: not %clang_cc1 -fsanitize=unsigned-integer-overflow -ivfsoverlay %t-vfsoverlay.yaml -fsanitize-blacklist=%t-nonexistent.blacklist -emit-llvm %s -o - 2>&1 | FileCheck %s --check-prefix=INVALID
|
||||
// INVALID: nonexistent.blacklist': {{[Nn]}}o such file or directory
|
||||
// RUN: not %clang_cc1 -fsanitize=unsigned-integer-overflow -ivfsoverlay %t-vfsoverlay.yaml -fsanitize-blacklist=%t-nonexistent.blacklist -emit-llvm %s -o - 2>&1 | FileCheck -DMSG=%errc_ENOENT %s --check-prefix=INVALID
|
||||
// INVALID: nonexistent.blacklist': [[MSG]]
|
||||
|
||||
unsigned i;
|
||||
|
||||
|
|
|
@ -70,9 +70,11 @@
|
|||
// RUN: not clang-offload-bundler -type=i -targets=host-%itanium_abi_triple,openmp-powerpc64le-ibm-linux-gnu,openmp-x86_64-pc-linux-gnu -outputs=%t.i,%t.tgt1 -inputs=%t.bundle.i -unbundle 2>&1 | FileCheck %s --check-prefix CK-ERR4
|
||||
// CK-ERR4: error: number of output files and targets should match in unbundling mode
|
||||
|
||||
// RUN: not clang-offload-bundler -type=i -targets=host-%itanium_abi_triple,openmp-powerpc64le-ibm-linux-gnu,openmp-x86_64-pc-linux-gnu -inputs=%t.i,%t.tgt1,%t.tgt2.notexist -outputs=%t.bundle.i 2>&1 | FileCheck %s -DFILE=%t.tgt2.notexist --check-prefix CK-ERR5
|
||||
// RUN: not clang-offload-bundler -type=i -targets=host-%itanium_abi_triple,openmp-powerpc64le-ibm-linux-gnu,openmp-x86_64-pc-linux-gnu -outputs=%t.i,%t.tgt1,%t.tgt2 -inputs=%t.bundle.i.notexist -unbundle 2>&1 | FileCheck %s -DFILE=%t.bundle.i.notexist --check-prefix CK-ERR5
|
||||
// CK-ERR5: error: '[[FILE]]': {{N|n}}o such file or directory
|
||||
// RUN: not clang-offload-bundler -type=i -targets=host-%itanium_abi_triple,openmp-powerpc64le-ibm-linux-gnu,openmp-x86_64-pc-linux-gnu -inputs=%t.i,%t.tgt1,%t.tgt2.notexist -outputs=%t.bundle.i 2>&1 | \
|
||||
// RUN: FileCheck %s -DFILE=%t.tgt2.notexist -DMSG=%errc_ENOENT --check-prefix CK-ERR5
|
||||
// RUN: not clang-offload-bundler -type=i -targets=host-%itanium_abi_triple,openmp-powerpc64le-ibm-linux-gnu,openmp-x86_64-pc-linux-gnu -outputs=%t.i,%t.tgt1,%t.tgt2 -inputs=%t.bundle.i.notexist -unbundle 2>&1 | \
|
||||
// RUN: FileCheck %s -DFILE=%t.bundle.i.notexist -DMSG=%errc_ENOENT --check-prefix CK-ERR5
|
||||
// CK-ERR5: error: '[[FILE]]': [[MSG]]
|
||||
|
||||
// RUN: not clang-offload-bundler -type=invalid -targets=host-%itanium_abi_triple,openmp-powerpc64le-ibm-linux-gnu,openmp-x86_64-pc-linux-gnu -inputs=%t.i,%t.tgt1,%t.tgt2 -outputs=%t.bundle.i 2>&1 | FileCheck %s -DTYPE=invalid --check-prefix CK-ERR6
|
||||
// CK-ERR6: error: '[[TYPE]]': invalid file type specified
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: not %clang_cc1 -emit-llvm -o %t.doesnotexist/somename %s 2> %t
|
||||
// RUN: FileCheck -check-prefix=OUTPUTFAIL -input-file=%t %s
|
||||
// RUN: FileCheck -check-prefix=OUTPUTFAIL -DMSG=%errc_ENOENT -input-file=%t %s
|
||||
|
||||
// OUTPUTFAIL: error: unable to open output file '{{.*}}doesnotexist{{.}}somename': '{{[nN]}}o such file or directory'
|
||||
// OUTPUTFAIL: error: unable to open output file '{{.*}}doesnotexist{{.}}somename': '[[MSG]]'
|
||||
|
|
|
@ -4,5 +4,5 @@
|
|||
// ... here come some json values ...
|
||||
// CHECK: }
|
||||
|
||||
// RUN: %clang_cc1 -emit-llvm -o %t -stats-file=%t.doesnotexist/bla %s 2>&1 | FileCheck -check-prefix=OUTPUTFAIL %s
|
||||
// OUTPUTFAIL: warning: unable to open statistics output file '{{.*}}doesnotexist{{.}}bla': '{{[Nn]}}o such file or directory'
|
||||
// RUN: %clang_cc1 -emit-llvm -o %t -stats-file=%t.doesnotexist/bla %s 2>&1 | FileCheck -DMSG=%errc_ENOENT -check-prefix=OUTPUTFAIL %s
|
||||
// OUTPUTFAIL: warning: unable to open statistics output file '{{.*}}doesnotexist{{.}}bla': '[[MSG]]'
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# RUN: not lld-link nosuchfile.obj >& %t.log
|
||||
# RUN: FileCheck -check-prefix=MISSING %s < %t.log
|
||||
MISSING: 'nosuchfile.obj': {{[Nn]}}o such file or directory
|
||||
# RUN: FileCheck -DMSG=%errc_ENOENT -check-prefix=MISSING %s < %t.log
|
||||
MISSING: 'nosuchfile.obj': [[MSG]]
|
||||
|
||||
# RUN: lld-link --version | FileCheck -check-prefix=VERSION %s
|
||||
VERSION: {{LLD [0-9]+\.[0-9]+}}
|
||||
|
|
|
@ -5,6 +5,6 @@
|
|||
# RUN: env LLD_IN_TEST=1 not lld-link /out:%t.exe /entry:main \
|
||||
# RUN: /manifest:embed \
|
||||
# RUN: /manifestuac:"level='requireAdministrator'" \
|
||||
# RUN: /manifestinput:%p/Inputs/manifestinput.test %t.obj 2>&1 | FileCheck %s
|
||||
# RUN: /manifestinput:%p/Inputs/manifestinput.test %t.obj 2>&1 | FileCheck -DMSG=%errc_ENOENT %s
|
||||
|
||||
# CHECK: error: unable to find mt.exe in PATH: {{[Nn]}}o such file or directory
|
||||
# CHECK: error: unable to find mt.exe in PATH: [[MSG]]
|
||||
|
|
|
@ -3,11 +3,11 @@
|
|||
|
||||
# RUN: not lld-link /out:%t.exe /entry:main /subsystem:console \
|
||||
# RUN: hello64.obj /defaultlib:std64.lib >& %t.log
|
||||
# RUN: FileCheck -check-prefix=CHECK1 %s < %t.log
|
||||
# RUN: FileCheck -DMSG=%errc_ENOENT -check-prefix=CHECK1 %s < %t.log
|
||||
|
||||
# RUN: not lld-link /out:%t.exe /entry:main /subsystem:console \
|
||||
# RUN: hello64 /defaultlib:std64.lib >& %t.log
|
||||
# RUN: FileCheck -check-prefix=CHECK2 %s < %t.log
|
||||
# RUN: FileCheck -DMSG=%errc_ENOENT -check-prefix=CHECK2 %s < %t.log
|
||||
|
||||
# RUN: lld-link /libpath:%T /out:%t.exe /entry:main \
|
||||
# RUN: /subsystem:console hello64.obj /defaultlib:std64.lib \
|
||||
|
@ -19,8 +19,8 @@
|
|||
# RUN: /nodefaultlib:std64.lib >& %t.log || true
|
||||
# RUN: FileCheck -check-prefix=CHECK3 %s < %t.log
|
||||
|
||||
CHECK1: error: could not open 'hello64.obj': {{[Nn]}}o such file or directory
|
||||
CHECK2: error: could not open 'hello64': {{[Nn]}}o such file or directory
|
||||
CHECK1: error: could not open 'hello64.obj': [[MSG]]
|
||||
CHECK2: error: could not open 'hello64': [[MSG]]
|
||||
CHECK3: error: undefined symbol: MessageBoxA
|
||||
CHECK3-NEXT: >>> referenced by {{.*}}hello64.obj:(main)
|
||||
|
||||
|
|
|
@ -20,10 +20,10 @@
|
|||
# Test an invalid path reference to a PDB type server; as a fallback LLD should try to load the PDB in the same path as the OBJ
|
||||
# RUN: yaml2obj %S/Inputs/pdb-type-server-invalid-path.yaml -o %t3.obj
|
||||
# RUN: cp %S/Inputs/pdb-diff-cl.pdb %T
|
||||
# RUN: lld-link %t3.obj -out:%t3.exe -debug -pdb:%t3.pdb -nodefaultlib -entry:main 2>&1 | FileCheck %s -check-prefix=INVALID-PATH -allow-empty
|
||||
# RUN: lld-link %t3.obj -out:%t3.exe -debug -pdb:%t3.pdb -nodefaultlib -entry:main 2>&1 | FileCheck -DMSG=%errc_ENOENT %s -check-prefix=INVALID-PATH -allow-empty
|
||||
|
||||
# INVALID-PATH-NOT: warning: Cannot use debug info for '{{.*}}3.obj' [LNK4099]
|
||||
# INVALID-PATH-NOT: failed to load reference 'c:\some_invalid_path_AABB98765\pdb-diff-cl.pdb': {{[Nn]}}o such file or directory
|
||||
# INVALID-PATH-NOT: failed to load reference 'c:\some_invalid_path_AABB98765\pdb-diff-cl.pdb': [[MSG]]
|
||||
|
||||
--- !COFF
|
||||
header:
|
||||
|
|
|
@ -4,23 +4,23 @@
|
|||
|
||||
# RUN: yaml2obj %s -o %t1.obj
|
||||
# RUN: yaml2obj %p/Inputs/pdb-type-server-missing-2.yaml -o %t2.obj
|
||||
# RUN: lld-link %t1.obj %t2.obj -out:%t.exe -debug -pdb:%t.pdb -nodefaultlib -entry:main 2>&1 | FileCheck %s -check-prefix=WARN
|
||||
# RUN: lld-link %t1.obj %t2.obj -out:%t.exe -debug:ghash -pdb:%t.pdb -nodefaultlib -entry:main 2>&1 | FileCheck %s -check-prefix=WARN
|
||||
# RUN: lld-link %t1.obj %t2.obj -out:%t.exe -debug -pdb:%t.pdb -nodefaultlib -entry:main /ignore:4099 2>&1 | FileCheck %s -check-prefix=IGNORE -allow-empty
|
||||
# RUN: not lld-link %t1.obj %t2.obj -out:%t.exe -debug -pdb:%t.pdb -nodefaultlib -entry:main /WX 2>&1 | FileCheck %s -check-prefix=ERR
|
||||
# RUN: lld-link %t1.obj %t2.obj -out:%t.exe -debug -pdb:%t.pdb -nodefaultlib -entry:main /ignore:4099 /WX 2>&1 | FileCheck %s -check-prefix=IGNORE-ERR -allow-empty
|
||||
# RUN: lld-link %t1.obj %t2.obj -out:%t.exe -debug -pdb:%t.pdb -nodefaultlib -entry:main 2>&1 | FileCheck -DMSG=%errc_ENOENT %s -check-prefix=WARN
|
||||
# RUN: lld-link %t1.obj %t2.obj -out:%t.exe -debug:ghash -pdb:%t.pdb -nodefaultlib -entry:main 2>&1 | FileCheck -DMSG=%errc_ENOENT %s -check-prefix=WARN
|
||||
# RUN: lld-link %t1.obj %t2.obj -out:%t.exe -debug -pdb:%t.pdb -nodefaultlib -entry:main /ignore:4099 2>&1 | FileCheck -DMSG=%errc_ENOENT %s -check-prefix=IGNORE -allow-empty
|
||||
# RUN: not lld-link %t1.obj %t2.obj -out:%t.exe -debug -pdb:%t.pdb -nodefaultlib -entry:main /WX 2>&1 | FileCheck -DMSG=%errc_ENOENT %s -check-prefix=ERR
|
||||
# RUN: lld-link %t1.obj %t2.obj -out:%t.exe -debug -pdb:%t.pdb -nodefaultlib -entry:main /ignore:4099 /WX 2>&1 | FileCheck -DMSG=%errc_ENOENT %s -check-prefix=IGNORE-ERR -allow-empty
|
||||
|
||||
# WARN: warning: Cannot use debug info for '{{.*}}.obj' [LNK4099]
|
||||
# WARN-NEXT: {{N|n}}o such file or directory
|
||||
# WARN-NEXT: [[MSG]]
|
||||
|
||||
# IGNORE-NOT: warning: Cannot use debug info for '{{.*}}.obj' [LNK4099]
|
||||
# IGNORE-NOT: {{N|n}}o such file or directory
|
||||
# IGNORE-NOT: [[MSG]]
|
||||
|
||||
# ERR: error: Cannot use debug info for '{{.*}}.obj' [LNK4099]
|
||||
# ERR-NEXT: {{N|n}}o such file or directory
|
||||
# ERR-NEXT: [[MSG]]
|
||||
|
||||
# IGNORE-ERR-NOT: error: Cannot use debug info for '{{.*}}.obj' [LNK4099]
|
||||
# IGNORE-ERR-NOT: {{N|n}}o such file or directory
|
||||
# IGNORE-ERR-NOT: [[MSG]]
|
||||
|
||||
--- !COFF
|
||||
header:
|
||||
|
|
|
@ -8,18 +8,18 @@
|
|||
# RUN: rm %t.o
|
||||
|
||||
# Test error when loading symbols from missing thin archive member.
|
||||
# RUN: not ld.lld --entry=_Z1fi %t-no-syms.a -o /dev/null 2>&1 | FileCheck %s --check-prefix=ERR1
|
||||
# ERR1: {{.*}}-no-syms.a: could not get the buffer for a child of the archive: '{{.*}}.o': {{[Nn]}}o such file or directory
|
||||
# RUN: not ld.lld --entry=_Z1fi %t-no-syms.a -o /dev/null 2>&1 | FileCheck -DMSG=%errc_ENOENT %s --check-prefix=ERR1
|
||||
# ERR1: {{.*}}-no-syms.a: could not get the buffer for a child of the archive: '{{.*}}.o': [[MSG]]
|
||||
|
||||
# Test error when thin archive has symbol table but member is missing.
|
||||
# RUN: not ld.lld --entry=_Z1fi -m elf_amd64_fbsd %t-syms.a -o /dev/null 2>&1 | FileCheck %s --check-prefix=ERR2
|
||||
# ERR2: {{.*}}-syms.a: could not get the buffer for the member defining symbol f(int): '{{.*}}.o': {{[Nn]}}o such file or directory
|
||||
# RUN: not ld.lld --entry=_Z1fi --no-demangle -m elf_amd64_fbsd %t-syms.a -o /dev/null 2>&1 | FileCheck %s --check-prefix=ERR2MANGLE
|
||||
# ERR2MANGLE: {{.*}}-syms.a: could not get the buffer for the member defining symbol _Z1fi: '{{.*}}.o': {{[Nn]}}o such file or directory
|
||||
# RUN: not ld.lld --entry=_Z1fi -m elf_amd64_fbsd %t-syms.a -o /dev/null 2>&1 | FileCheck -DMSG=%errc_ENOENT %s --check-prefix=ERR2
|
||||
# ERR2: {{.*}}-syms.a: could not get the buffer for the member defining symbol f(int): '{{.*}}.o': [[MSG]]
|
||||
# RUN: not ld.lld --entry=_Z1fi --no-demangle -m elf_amd64_fbsd %t-syms.a -o /dev/null 2>&1 | FileCheck -DMSG=%errc_ENOENT %s --check-prefix=ERR2MANGLE
|
||||
# ERR2MANGLE: {{.*}}-syms.a: could not get the buffer for the member defining symbol _Z1fi: '{{.*}}.o': [[MSG]]
|
||||
|
||||
# Test error when thin archive is linked using --whole-archive but member is missing.
|
||||
# RUN: not ld.lld --entry=_Z1fi --whole-archive %t-syms.a -o /dev/null 2>&1 | FileCheck %s --check-prefix=ERR3
|
||||
# ERR3: {{.*}}-syms.a: could not get the buffer for a child of the archive: '{{.*}}.o': {{[Nn]}}o such file or directory
|
||||
# RUN: not ld.lld --entry=_Z1fi --whole-archive %t-syms.a -o /dev/null 2>&1 | FileCheck -DMSG=%errc_ENOENT %s --check-prefix=ERR3
|
||||
# ERR3: {{.*}}-syms.a: could not get the buffer for a child of the archive: '{{.*}}.o': [[MSG]]
|
||||
|
||||
.global _Z1fi
|
||||
_Z1fi:
|
||||
|
|
|
@ -219,16 +219,16 @@ _start:
|
|||
# INVRSP: invalid response file quoting: patatino
|
||||
|
||||
# RUN: not ld.lld %t.foo -o /dev/null 2>&1 | \
|
||||
# RUN: FileCheck --check-prefix=MISSING %s
|
||||
# MISSING: cannot open {{.*}}.foo: {{[Nn]}}o such file or directory
|
||||
# RUN: FileCheck -DMSG=%errc_ENOENT --check-prefix=MISSING %s
|
||||
# MISSING: cannot open {{.*}}.foo: [[MSG]]
|
||||
|
||||
# RUN: not ld.lld -o /dev/null 2>&1 | \
|
||||
# RUN: FileCheck --check-prefix=NO_INPUT %s
|
||||
# NO_INPUT: ld.lld{{.*}}: no input files
|
||||
|
||||
# RUN: not ld.lld %t.no.such.file -o /dev/null 2>&1 | \
|
||||
# RUN: FileCheck --check-prefix=CANNOT_OPEN %s
|
||||
# CANNOT_OPEN: cannot open {{.*}}.no.such.file: {{[Nn]}}o such file or directory
|
||||
# RUN: FileCheck -DMSG=%errc_ENOENT --check-prefix=CANNOT_OPEN %s
|
||||
# CANNOT_OPEN: cannot open {{.*}}.no.such.file: [[MSG]]
|
||||
|
||||
# RUN: not ld.lld --foo 2>&1 | FileCheck --check-prefix=UNKNOWN %s
|
||||
# UNKNOWN: unknown argument '--foo'
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
# RUN: mkdir -p %t.dir
|
||||
# RUN: cd %t.dir
|
||||
|
||||
# RUN: not ld.lld --reproduce repro.tar abc -o t 2>&1 | FileCheck %s
|
||||
# CHECK: cannot open abc: {{N|n}}o such file or directory
|
||||
# RUN: not ld.lld --reproduce repro.tar abc -o t 2>&1 | FileCheck -DMSG=%errc_ENOENT %s
|
||||
# CHECK: cannot open abc: [[MSG]]
|
||||
|
||||
# RUN: tar xOf repro.tar repro/response.txt | FileCheck --check-prefix=RSP %s
|
||||
# RSP: abc
|
||||
|
|
|
@ -41,9 +41,9 @@
|
|||
|
||||
## Show that a nonexistent symbol ordering file causes an error.
|
||||
# RUN: not ld.lld --symbol-ordering-file=%t.nonexistent %t.o -o %t3.out 2>&1 | \
|
||||
# RUN: FileCheck %s --check-prefix=ERR -DFILE=%t.nonexistent
|
||||
# RUN: FileCheck -DMSG=%errc_ENOENT %s --check-prefix=ERR -DFILE=%t.nonexistent
|
||||
|
||||
# ERR: error: cannot open [[FILE]]: {{[Nn]}}o such file or directory
|
||||
# ERR: error: cannot open [[FILE]]: [[MSG]]
|
||||
|
||||
## Show that an empty ordering file can be handled (symbols remain in their
|
||||
## normal order).
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# REQUIRES: x86
|
||||
# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t.o
|
||||
# RUN: not %lld -filelist nonexistent %t.o -o %t 2>&1 | FileCheck %s
|
||||
# CHECK: cannot open nonexistent: {{N|n}}o such file or directory
|
||||
# RUN: not %lld -filelist nonexistent %t.o -o %t 2>&1 | FileCheck -DMSG=%errc_ENOENT %s
|
||||
# CHECK: cannot open nonexistent: [[MSG]]
|
||||
|
||||
.globl _main
|
||||
|
||||
|
|
|
@ -537,6 +537,16 @@ RUN lines:
|
|||
|
||||
Example: ``%:s: C\Desktop Files\foo_test.s.tmp``
|
||||
|
||||
``%errc_<ERRCODE>``
|
||||
|
||||
Some error messages may be substituted to allow different spellings
|
||||
based on the host platform.
|
||||
|
||||
The following error codes are currently supported: ENOENT, EISDIR.
|
||||
|
||||
Example: ``Linux %errc_ENOENT: No such file or directory``
|
||||
|
||||
Example: ``Windows %errc_ENOENT: no such file or directory``
|
||||
|
||||
**LLVM-specific substitutions:**
|
||||
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
RUN: llvm-symbolizer --obj=unexisting-file 0x1234 2>&1 | FileCheck %s
|
||||
RUN: llvm-symbolizer --obj=unexisting-file 0x1234 2>&1 | FileCheck -DMSG=%errc_ENOENT %s
|
||||
|
||||
CHECK: LLVMSymbolizer: error reading file: {{[Nn]}}o such file or directory
|
||||
CHECK: LLVMSymbolizer: error reading file: [[MSG]]
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# RUN: not llvm-mc -arch=hexagon -filetype=asm junk123.s 2>%t ; FileCheck %s < %t
|
||||
# RUN: not llvm-mc -arch=hexagon -filetype=asm junk123.s 2>%t ; FileCheck -DMSG=%errc_ENOENT %s < %t
|
||||
#
|
||||
|
||||
# CHECK: junk123.s: {{[N|n]}}o such file or directory
|
||||
# CHECK: junk123.s: [[MSG]]
|
||||
|
|
|
@ -6,6 +6,6 @@ RUN: rm -f test.a
|
|||
RUN: llvm-ar rc test.a foo
|
||||
RUN: rm foo
|
||||
RUN: mkdir foo
|
||||
RUN: not llvm-ar x test.a foo 2>&1 | FileCheck %s
|
||||
RUN: not llvm-ar x test.a foo 2>&1 | FileCheck -DMSG=%errc_EISDIR %s
|
||||
|
||||
CHECK: foo: {{[Ii]}}s a directory
|
||||
CHECK: foo: [[MSG]]
|
||||
|
|
|
@ -57,5 +57,5 @@ THINEXTRACT: extracting from a thin archive is not supported
|
|||
RUN: llvm-ar p %p/Inputs/thin.a evenlen | FileCheck %s --check-prefix=EVENLEN
|
||||
EVENLEN: evenlen
|
||||
|
||||
RUN: not llvm-ar p %p/Inputs/thin-path.a t/test2.o 2>&1 | FileCheck %s --check-prefix=MISSING
|
||||
MISSING: error: {{N|n}}o such file or directory
|
||||
RUN: not llvm-ar p %p/Inputs/thin-path.a t/test2.o 2>&1 | FileCheck %s --DMSG=%errc_ENOENT --check-prefix=MISSING
|
||||
MISSING: error: [[MSG]]
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
;RUN: rm -rf %t && mkdir -p %t
|
||||
;RUN: not llvm-ar r %t/test.a . 2>&1 | FileCheck %s
|
||||
;CHECK: .: {{I|i}}s a directory
|
||||
;RUN: not llvm-ar r %t/test.a . 2>&1 | FileCheck -DMSG=%errc_EISDIR %s
|
||||
;CHECK: .: [[MSG]]
|
||||
|
||||
;RUN: rm -f %t/test.a
|
||||
;RUN: touch %t/a-very-long-file-name
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
RUN: env RC_DEBUG_OPTIONS=1 dsymutil -f %p/../Inputs/basic.macho.x86_64 -o - | llvm-dwarfdump -v - | FileCheck %s
|
||||
RUN: env RC_DEBUG_OPTIONS=1 dsymutil -f %p/../Inputs/basic.macho.x86_64 -o - | llvm-dwarfdump -v - | FileCheck -DMSG=%errc_ENOENT %s
|
||||
|
||||
CHECK: .debug_info contents:
|
||||
CHECK: Compile Unit:
|
||||
|
@ -8,7 +8,7 @@ CHECK: DW_AT_name {{.*}}"/Inputs/basic1.macho.x86_64.o"
|
|||
CHECK: DW_TAG_constant [2]
|
||||
CHECK: DW_AT_name {{.*}}"dsymutil_warning"
|
||||
CHECK: DW_AT_artificial [DW_FORM_flag] (0x01)
|
||||
CHECK: DW_AT_const_value {{.*}}"unable to open object file: {{[Nn]}}o such file or directory"
|
||||
CHECK: DW_AT_const_value {{.*}}"unable to open object file: [[MSG]]"
|
||||
CHECK: NULL
|
||||
CHECK: Compile Unit:
|
||||
CHECK: DW_TAG_compile_unit [1] *
|
||||
|
@ -17,7 +17,7 @@ CHECK: DW_AT_name {{.*}}"/Inputs/basic2.macho.x86_64.o"
|
|||
CHECK: DW_TAG_constant [2]
|
||||
CHECK: DW_AT_name {{.*}}"dsymutil_warning"
|
||||
CHECK: DW_AT_artificial [DW_FORM_flag] (0x01)
|
||||
CHECK: DW_AT_const_value {{.*}}"unable to open object file: {{[Nn]}}o such file or directory"
|
||||
CHECK: DW_AT_const_value {{.*}}"unable to open object file: [[MSG]]"
|
||||
CHECK: NULL
|
||||
CHECK: Compile Unit:
|
||||
CHECK: DW_TAG_compile_unit [1] *
|
||||
|
@ -26,5 +26,5 @@ CHECK: DW_AT_name {{.*}}"/Inputs/basic3.macho.x86_64.o"
|
|||
CHECK: DW_TAG_constant [2]
|
||||
CHECK: DW_AT_name {{.*}}"dsymutil_warning"
|
||||
CHECK: DW_AT_artificial [DW_FORM_flag] (0x01)
|
||||
CHECK: DW_AT_const_value {{.*}}"unable to open object file: {{[Nn]}}o such file or directory"
|
||||
CHECK: DW_AT_const_value {{.*}}"unable to open object file: [[MSG]]"
|
||||
CHECK: NULL
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
# RUN: dsymutil -no-output -oso-prepend-path=%p -y %s 2>&1 | FileCheck %s
|
||||
# RUN: dsymutil -no-output -oso-prepend-path=%p -y %s 2>&1 | FileCheck -DMSG=%errc_ENOENT %s
|
||||
|
||||
# This is the archive member part of basic-archive.macho.x86_64 debug map with corrupted timestamps.
|
||||
|
||||
# CHECK: warning: {{.*}}libbasic.a(basic2.macho.x86_64.o): {{[Nn]o}} such file
|
||||
# CHECK: warning: {{.*}}libbasic.a(basic3.macho.x86_64.o): {{[Nn]o}} such file
|
||||
# CHECK: warning: {{.*}}libbasic.a(basic2.macho.x86_64.o): [[MSG]]
|
||||
# CHECK: warning: {{.*}}libbasic.a(basic3.macho.x86_64.o): [[MSG]]
|
||||
|
||||
---
|
||||
triple: 'x86_64-apple-darwin'
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
RUN: dsymutil -dump-debug-map -oso-prepend-path=%p %p/Inputs/basic.macho.x86_64 | FileCheck %s
|
||||
RUN: dsymutil -dump-debug-map -oso-prepend-path=%p %p/Inputs/basic-lto.macho.x86_64 | FileCheck %s --check-prefix=CHECK-LTO
|
||||
RUN: dsymutil -verbose -dump-debug-map -oso-prepend-path=%p %p/Inputs/basic-archive.macho.x86_64 2>&1 | FileCheck %s --check-prefix=CHECK-ARCHIVE
|
||||
RUN: dsymutil -dump-debug-map %p/Inputs/basic.macho.x86_64 2>&1 | FileCheck %s --check-prefix=NOT-FOUND
|
||||
RUN: not dsymutil -dump-debug-map %p/Inputs/inexistant 2>&1 | FileCheck %s --check-prefix=NO-EXECUTABLE
|
||||
RUN: dsymutil -dump-debug-map %p/Inputs/basic.macho.x86_64 2>&1 | FileCheck -DMSG=%errc_ENOENT %s --check-prefix=NOT-FOUND
|
||||
RUN: not dsymutil -dump-debug-map %p/Inputs/inexistant 2>&1 | FileCheck -DMSG=%errc_ENOENT %s --check-prefix=NO-EXECUTABLE
|
||||
|
||||
|
||||
Check that We can parse the debug map of the basic executable.
|
||||
|
@ -72,9 +72,9 @@ Check that we warn about missing object files (this presumes that the files aren
|
|||
present in the machine's /Inputs/ folder, which should be a pretty safe bet).
|
||||
|
||||
warning: (x86_64) /Inputs/basic1.macho.x86_64.o unable to open object file:
|
||||
NOT-FOUND: warning: (x86_64) {{.*}}/Inputs/basic1.macho.x86_64.o unable to open object file: {{[Nn]o}} such file
|
||||
NOT-FOUND: warning: (x86_64) {{.*}}/Inputs/basic2.macho.x86_64.o unable to open object file: {{[Nn]o}} such file
|
||||
NOT-FOUND: warning: (x86_64) {{.*}}/Inputs/basic3.macho.x86_64.o unable to open object file: {{[Nn]o}} such file
|
||||
NOT-FOUND: warning: (x86_64) {{.*}}/Inputs/basic1.macho.x86_64.o unable to open object file: [[MSG]]
|
||||
NOT-FOUND: warning: (x86_64) {{.*}}/Inputs/basic2.macho.x86_64.o unable to open object file: [[MSG]]
|
||||
NOT-FOUND: warning: (x86_64) {{.*}}/Inputs/basic3.macho.x86_64.o unable to open object file: [[MSG]]
|
||||
NOT-FOUND: ---
|
||||
NOT-FOUND-NEXT: triple: 'x86_64-apple-darwin'
|
||||
NOT-FOUND-NEXT: binary-path:{{.*}}/Inputs/basic.macho.x86_64
|
||||
|
@ -82,5 +82,5 @@ NOT-FOUND-NEXT: ...
|
|||
|
||||
Check that we correctly error out on invalid executable.
|
||||
|
||||
NO-EXECUTABLE: cannot parse{{.*}}/inexistant': {{[Nn]o}} such file
|
||||
NO-EXECUTABLE: cannot parse{{.*}}/inexistant': [[MSG]]
|
||||
NO-EXECUTABLE-NOT: ---
|
||||
|
|
|
@ -7,6 +7,6 @@
|
|||
## Passing in a directory:
|
||||
# RUN: mkdir -p %t/tmpDir
|
||||
# RUN: not llvm-ar p %t/tmpDir 2>&1 | \
|
||||
# RUN: FileCheck %s --check-prefix=IS-DIR -DARCHIVE=%t/tmpDir
|
||||
# RUN: FileCheck %s --check-prefix=IS-DIR -DARCHIVE=%t/tmpDir -DMSG=%errc_EISDIR
|
||||
|
||||
# IS-DIR: error: unable to open '[[ARCHIVE]]': {{[iI]}}s a directory
|
||||
# IS-DIR: error: unable to open '[[ARCHIVE]]': [[MSG]]
|
||||
|
|
|
@ -12,6 +12,6 @@
|
|||
## File has been deleted.
|
||||
# RUN: llvm-ar qT %t-archive.a %t-temp.txt
|
||||
# RUN: rm %t-temp.txt
|
||||
# RUN: not llvm-ar p %t-archive.a 2>&1 | FileCheck %s --check-prefix=DELETED
|
||||
# RUN: not llvm-ar p %t-archive.a 2>&1 | FileCheck -DMSG=%errc_ENOENT %s --check-prefix=DELETED
|
||||
|
||||
# DELETED: error: {{[Nn]}}o such file or directory
|
||||
# DELETED: error: [[MSG]]
|
||||
|
|
|
@ -82,9 +82,9 @@
|
|||
## Member does not exist:
|
||||
# RUN: llvm-ar rc %t/missing.a %t/1.o %t/2.o %t/3.o
|
||||
# RUN: not llvm-ar m %t/missing.a %t/missing.txt 2>&1 \
|
||||
# RUN: | FileCheck %s --check-prefix=MISSING-FILE -DFILE=%t/missing.txt
|
||||
# RUN: | FileCheck %s --check-prefix=MISSING-FILE -DFILE=%t/missing.txt -DMSG=%errc_ENOENT
|
||||
|
||||
# MISSING-FILE: error: [[FILE]]: {{[nN]}}o such file or directory
|
||||
# MISSING-FILE: error: [[FILE]]: [[MSG]]
|
||||
|
||||
--- !ELF
|
||||
FileHeader:
|
||||
|
|
|
@ -73,9 +73,9 @@
|
|||
|
||||
## Archive does not exist:
|
||||
# RUN: not llvm-ar p %t/missing.a 2>&1 \
|
||||
# RUN: | FileCheck %s --check-prefix=MISSING-ARCHIVE -DARCHIVE=%t/missing.a
|
||||
# RUN: | FileCheck -DMSG=%errc_ENOENT %s --check-prefix=MISSING-ARCHIVE -DARCHIVE=%t/missing.a
|
||||
|
||||
# MISSING-ARCHIVE: error: unable to load '[[ARCHIVE]]': {{[nN]}}o such file or directory
|
||||
# MISSING-ARCHIVE: error: unable to load '[[ARCHIVE]]': [[MSG]]
|
||||
|
||||
## Member does not exist:
|
||||
# RUN: not llvm-ar p %t/archive.a %t-missing.txt 2>&1 \
|
||||
|
|
|
@ -58,9 +58,9 @@
|
|||
|
||||
## Member does not exist:
|
||||
# RUN: not llvm-ar qc %t/missing.a %t/missing.txt 2>&1 \
|
||||
# RUN: | FileCheck %s --check-prefix=MISSING-FILE -DFILE=%t/missing.txt
|
||||
# RUN: | FileCheck %s --check-prefix=MISSING-FILE -DFILE=%t/missing.txt -DMSG=%errc_ENOENT
|
||||
|
||||
# MISSING-FILE: error: [[FILE]]: {{[nN]}}o such file or directory
|
||||
# MISSING-FILE: error: [[FILE]]: [[MSG]]
|
||||
|
||||
## Create and append members to a thin archive:
|
||||
# RUN: llvm-ar qcT %t/thin-multiple.a %t/1.o
|
||||
|
|
|
@ -89,9 +89,9 @@
|
|||
## Member does not exist:
|
||||
# RUN: llvm-ar rc %t/missing.a %t/1.o %t/2.o %t/3.o
|
||||
# RUN: not llvm-ar r %t/missing.a %t/missing.txt 2>&1 \
|
||||
# RUN: | FileCheck %s --check-prefix=MISSING-FILE -DFILE=%t/missing.txt
|
||||
# RUN: | FileCheck %s --check-prefix=MISSING-FILE -DFILE=%t/missing.txt -DMSG=%errc_ENOENT
|
||||
|
||||
# MISSING-FILE: error: [[FILE]]: {{[Nn]}}o such file or directory
|
||||
# MISSING-FILE: error: [[FILE]]: [[MSG]]
|
||||
|
||||
## Create and Replace member of thin archive:
|
||||
# RUN: llvm-ar rcT %t/thin.a %t/1.o %t/2.o %t/3.o
|
||||
|
|
|
@ -33,9 +33,9 @@
|
|||
|
||||
# RUN: echo -e 'rc %/t.a blah\\foo' > %t-rsp.txt
|
||||
# RUN: not llvm-ar --rsp-quoting=windows @%t-rsp.txt 2>&1 | \
|
||||
# RUN: FileCheck %s --check-prefix=WIN
|
||||
# WIN: error: blah\foo: {{[Nn]}}o such file or directory
|
||||
# RUN: FileCheck -DMSG=%errc_ENOENT %s --check-prefix=WIN
|
||||
# WIN: error: blah\foo: [[MSG]]
|
||||
|
||||
# RUN: not llvm-ar -rsp-quoting posix @%t-rsp.txt 2>&1 | \
|
||||
# RUN: FileCheck %s --check-prefix=POSIX
|
||||
# POSIX: error: blahfoo: {{[Nn]}}o such file or directory
|
||||
# RUN: FileCheck -DMSG=%errc_ENOENT %s --check-prefix=POSIX
|
||||
# POSIX: error: blahfoo: [[MSG]]
|
||||
|
|
|
@ -62,5 +62,5 @@ ELF-I386-NEXT: _ZTV1A[8]: _ZN1A1fEv
|
|||
|
||||
MIXEDARCOFF-I386: ??_7S@@6B@[0]: ??_R4S@@6B@
|
||||
|
||||
RUN: not llvm-cxxdump %t.blah 2>&1 | FileCheck --check-prefix=ENOENT %s
|
||||
ENOENT: {{.*}}.blah: error: {{[Nn]}}o such file or directory
|
||||
RUN: not llvm-cxxdump %t.blah 2>&1 | FileCheck -DMSG=%errc_ENOENT --check-prefix=ENOENT %s
|
||||
ENOENT: {{.*}}.blah: error: [[MSG]]
|
||||
|
|
|
@ -63,25 +63,25 @@
|
|||
## Check that an error is thrown when a file in the filelist doesn't exist in the cwd and no dirname is specified:
|
||||
# RUN: echo 'no-such-file' > %t.invalid-list.txt
|
||||
# RUN: not llvm-libtool-darwin -static -o %t.lib -filelist %t.invalid-list.txt 2>&1 | \
|
||||
# RUN: FileCheck %s --check-prefix=FILE-ERROR -DFILE=no-such-file
|
||||
# RUN: FileCheck %s --check-prefix=FILE-ERROR -DFILE=no-such-file -DMSG=%errc_ENOENT
|
||||
|
||||
# FILE-ERROR: error: '[[FILE]]': {{[nN]}}o such file or directory
|
||||
# FILE-ERROR: error: '[[FILE]]': [[MSG]]
|
||||
|
||||
## Check that an error is thrown when the directory exists but does not contain the requested file:
|
||||
# RUN: not llvm-libtool-darwin -static -o %t.lib -filelist %t.invalid-list.txt,%t/dirname 2>&1 | \
|
||||
# RUN: FileCheck %s --check-prefix=DIR-ERROR -DDIR=%t/dirname -DFILE=no-such-file
|
||||
# RUN: FileCheck %s --check-prefix=DIR-ERROR -DDIR=%t/dirname -DFILE=no-such-file -DMSG=%errc_ENOENT
|
||||
|
||||
# DIR-ERROR: error: '[[DIR]]{{[/\\]}}[[FILE]]': {{[nN]}}o such file or directory
|
||||
# DIR-ERROR: error: '[[DIR]]{{[/\\]}}[[FILE]]': [[MSG]]
|
||||
|
||||
## Check that an error is thrown when a file is in the cwd but dirname is specified:
|
||||
# RUN: yaml2obj %S/Inputs/input2.yaml -o %basename_t.tmp-input2.o
|
||||
# RUN: echo %basename_t.tmp-input2.o > %t.files-cwd.txt
|
||||
# RUN: not llvm-libtool-darwin -static -o %t.lib -filelist %t.files-cwd.txt,%t/dirname 2>&1 | \
|
||||
# RUN: FileCheck %s --check-prefix=DIR-ERROR -DDIR=%t/dirname -DFILE=%basename_t.tmp-input2.o
|
||||
# RUN: FileCheck %s --check-prefix=DIR-ERROR -DDIR=%t/dirname -DFILE=%basename_t.tmp-input2.o -DMSG=%errc_ENOENT
|
||||
|
||||
## Check that an error is thrown when the directory doesn't exist:
|
||||
# RUN: not llvm-libtool-darwin -static -o %t.lib -filelist %t.files-cwd.txt,%t/Invalid-Dir 2>&1 | \
|
||||
# RUN: FileCheck %s --check-prefix=DIR-ERROR -DDIR=%t/Invalid-Dir -DFILE=%basename_t.tmp-input2.o
|
||||
# RUN: FileCheck %s --check-prefix=DIR-ERROR -DDIR=%t/Invalid-Dir -DFILE=%basename_t.tmp-input2.o -DMSG=%errc_ENOENT
|
||||
|
||||
## Check that an error is thrown when the filelist is empty:
|
||||
# RUN: touch %t.empty-list
|
||||
|
@ -102,7 +102,7 @@
|
|||
# RUN: echo %t-input2.o > %t.space-line.txt
|
||||
# RUN: echo " " >> %t.space-line.txt
|
||||
# RUN: not llvm-libtool-darwin -static -o %t.lib -filelist %t.space-line.txt 2>&1 | \
|
||||
# RUN: FileCheck %s --check-prefix=FILE-ERROR -DFILE=' ' --strict-whitespace
|
||||
# RUN: FileCheck %s --check-prefix=FILE-ERROR -DFILE=' ' -DMSG=%errc_ENOENT --strict-whitespace
|
||||
|
||||
## Filelist option specified more than once:
|
||||
# RUN: touch %t.list1.txt and %t.list2.txt
|
||||
|
|
|
@ -26,9 +26,9 @@
|
|||
|
||||
## Input file not found:
|
||||
# RUN: not llvm-libtool-darwin -static -o %t.lib %t.missing 2>&1 | \
|
||||
# RUN: FileCheck %s --check-prefix=NO-FILE -DFILE=%t.missing
|
||||
# RUN: FileCheck %s --check-prefix=NO-FILE -DFILE=%t.missing -DMSG=%errc_ENOENT
|
||||
|
||||
# NO-FILE: error: '[[FILE]]': {{[nN]}}o such file or directory
|
||||
# NO-FILE: error: '[[FILE]]': [[MSG]]
|
||||
|
||||
## Input file is not an object file:
|
||||
# RUN: touch %t.invalid
|
||||
|
|
|
@ -13,5 +13,5 @@
|
|||
# # RUN: not llvm-lipo -arch i3866 %t-32.o -create -o /dev/null 2>&1 | FileCheck --check-prefix=INVALID_ARCH %s
|
||||
# INVALID_ARCH: error: Invalid architecture: i3866
|
||||
#
|
||||
# RUN: not llvm-lipo -arch i386 %t-33.o -create -o /dev/null 2>&1 | FileCheck --check-prefix=INVALID_FILE %s
|
||||
# INVALID_FILE: {{[nN]}}o such file or directory
|
||||
# RUN: not llvm-lipo -arch i386 %t-33.o -create -o /dev/null 2>&1 | FileCheck -DMSG=%errc_ENOENT --check-prefix=INVALID_FILE %s
|
||||
# INVALID_FILE: [[MSG]]
|
||||
|
|
|
@ -11,8 +11,8 @@
|
|||
# RUN: not llvm-lipo %t-universal.o %t-universal.o -replace i386 %t-32.o -o %t.o 2>&1 | FileCheck --check-prefix=INPUT_ARGS %s
|
||||
# INPUT_ARGS: error: replace expects a single input file
|
||||
|
||||
# RUN: not llvm-lipo %t-universal.o -replace i386 %t-33.o -o %t.o 2>&1 | FileCheck --check-prefix=INVALID_FILE %s
|
||||
# INVALID_FILE: {{[nN]}}o such file or directory
|
||||
# RUN: not llvm-lipo %t-universal.o -replace i386 %t-33.o -o %t.o 2>&1 | FileCheck -DMSG=%errc_ENOENT --check-prefix=INVALID_FILE %s
|
||||
# INVALID_FILE: [[MSG]]
|
||||
|
||||
# RUN: not llvm-lipo %t-universal.o -replace i3866 %t-32.o -o %t.o 2>&1 | FileCheck --check-prefix=INVALID_ARCH %s
|
||||
# INVALID_ARCH: error: Invalid architecture: i3866
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
; RUN: not llvm-lto foobar 2>&1 | FileCheck %s
|
||||
; CHECK: llvm-lto: error loading file 'foobar': {{N|n}}o such file or directory
|
||||
; RUN: not llvm-lto foobar 2>&1 | FileCheck -DMSG=%errc_ENOENT %s
|
||||
; CHECK: llvm-lto: error loading file 'foobar': [[MSG]]
|
||||
|
||||
; RUN: not llvm-lto --list-symbols-only %S/Inputs/empty.bc 2>&1 | FileCheck %s --check-prefix=CHECK-LIST
|
||||
; CHECK-LIST: llvm-lto: error loading file '{{.*}}/Inputs/empty.bc': The file was not recognized as a valid object file
|
||||
|
|
|
@ -21,5 +21,5 @@ define void @patatino() {
|
|||
|
||||
; Try to save statistics to an invalid file.
|
||||
; RUN: not llvm-lto2 run %t1.bc -o %t.o -r %t1.bc,patatino,px \
|
||||
; RUN: -stats-file=%t2/foo.stats 2>&1 | FileCheck --check-prefix=ERROR %s
|
||||
; ERROR: LTO::run failed: {{[Nn]}}o such file or directory
|
||||
; RUN: -stats-file=%t2/foo.stats 2>&1 | FileCheck -DMSG=%errc_ENOENT --check-prefix=ERROR %s
|
||||
; ERROR: LTO::run failed: [[MSG]]
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
# RUN: not llvm-mc %t.blah -o /dev/null 2>&1 | FileCheck --check-prefix=ENOENT %s
|
||||
# RUN: not llvm-mc %t.blah -o /dev/null 2>&1 | FileCheck -DMSG=%errc_ENOENT --check-prefix=ENOENT %s
|
||||
|
||||
# ENOENT: {{.*}}.blah: {{[Nn]}}o such file or directory
|
||||
# ENOENT: {{.*}}.blah: [[MSG]]
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
# RUN: not llvm-mca %t.blah -o /dev/null 2>&1 | FileCheck --check-prefix=ENOENT %s
|
||||
# RUN: not llvm-mca %t.blah -o /dev/null 2>&1 | FileCheck -DMSG=%errc_ENOENT --check-prefix=ENOENT %s
|
||||
|
||||
# ENOENT: {{.*}}.blah: {{[Nn]}}o such file or directory
|
||||
# ENOENT: {{.*}}.blah: [[MSG]]
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
# RUN: not llvm-ml %t.blah.asm /Fo /dev/null 2>&1 | FileCheck --check-prefix=ENOENT %s
|
||||
# RUN: not llvm-ml %t.blah.asm /Fo /dev/null 2>&1 | FileCheck -DMSG=%errc_ENOENT --check-prefix=ENOENT %s
|
||||
|
||||
# ENOENT: {{.*}}.blah.asm: {{[Nn]}}o such file or directory
|
||||
# ENOENT: {{.*}}.blah.asm: [[MSG]]
|
||||
|
|
|
@ -59,9 +59,9 @@
|
|||
|
||||
## Test that llvm-objcopy produces an error if the file with section contents
|
||||
## to be added does not exist.
|
||||
# RUN: not llvm-objcopy --add-section=.another.section=%t2 %t %t3 2>&1 | FileCheck -DFILE1=%t -DFILE2=%t2 %s --check-prefixes=ERR1
|
||||
# RUN: not llvm-objcopy --add-section=.another.section=%t2 %t %t3 2>&1 | FileCheck -DFILE1=%t -DFILE2=%t2 -DMSG=%errc_ENOENT %s --check-prefixes=ERR1
|
||||
|
||||
# ERR1: error: '[[FILE1]]': '[[FILE2]]': {{[Nn]}}o such file or directory
|
||||
# ERR1: error: '[[FILE1]]': '[[FILE2]]': [[MSG]]
|
||||
|
||||
## Another negative test for invalid --add-sections command line argument.
|
||||
# RUN: not llvm-objcopy --add-section=.another.section %t %t3 2>&1 | FileCheck %s --check-prefixes=ERR2
|
||||
|
|
|
@ -37,9 +37,9 @@ Sections:
|
|||
|
||||
## Test that llvm-objcopy produces an error if the file with section contents
|
||||
## to be added does not exist.
|
||||
# RUN: not llvm-objcopy --add-section=.section.name=%t.missing %t %t.out 2>&1 | FileCheck -DFILE1=%t -DFILE2=%t.missing %s --check-prefixes=ERR1
|
||||
# RUN: not llvm-objcopy --add-section=.section.name=%t.missing %t %t.out 2>&1 | FileCheck -DFILE1=%t -DFILE2=%t.missing -DMSG=%errc_ENOENT %s --check-prefixes=ERR1
|
||||
|
||||
# ERR1: error: '[[FILE1]]': '[[FILE2]]': {{[Nn]}}o such file or directory
|
||||
# ERR1: error: '[[FILE1]]': '[[FILE2]]': [[MSG]]
|
||||
|
||||
## Negative test for invalid --add-sections argument - missing '='.
|
||||
# RUN: not llvm-objcopy --add-section=.section.name %t %t.out 2>&1 | FileCheck %s --check-prefixes=ERR2
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
## This test shows that we include the tool name in error/warning messages.
|
||||
|
||||
# RUN: not llvm-objcopy %S/non-existent 2>&1 | FileCheck --check-prefix=ERR %s -DTOOL=objcopy
|
||||
# RUN: not llvm-strip %S/non-existent 2>&1 | FileCheck --check-prefix=ERR %s -DTOOL=strip
|
||||
# RUN: not llvm-objcopy %S/non-existent 2>&1 | FileCheck --check-prefix=ERR %s -DTOOL=objcopy -DMSG=%errc_ENOENT
|
||||
# RUN: not llvm-strip %S/non-existent 2>&1 | FileCheck --check-prefix=ERR %s -DTOOL=strip -DMSG=%errc_ENOENT
|
||||
|
||||
# ERR: llvm-[[TOOL]]{{(\.exe)?}}: error: '{{.*}}': {{[Nn]}}o such file or directory
|
||||
# ERR: llvm-[[TOOL]]{{(\.exe)?}}: error: '{{.*}}': [[MSG]]
|
||||
|
||||
## Currently llvm-objcopy does not issue warnings, so it is not tested.
|
||||
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
|
||||
## Error case 1: Nonexistent input file is specified by --add-section.
|
||||
# RUN: not llvm-objcopy --add-section __TEXT,__text=%t.missing %t %t.nonexistent-file 2>&1 \
|
||||
# RUN: | FileCheck %s -DINPUT=%t -DSECTION_DATA_FILE=%t.missing --check-prefix=NONEXSITENT-FILE
|
||||
# NONEXSITENT-FILE: error: '[[INPUT]]': '[[SECTION_DATA_FILE]]': {{[Nn]}}o such file or directory
|
||||
# RUN: | FileCheck %s -DINPUT=%t -DSECTION_DATA_FILE=%t.missing -DMSG=%errc_ENOENT --check-prefix=NONEXSITENT-FILE
|
||||
# NONEXSITENT-FILE: error: '[[INPUT]]': '[[SECTION_DATA_FILE]]': [[MSG]]
|
||||
|
||||
## Error case 2: Too long segment name.
|
||||
# RUN: not llvm-objcopy --add-section __TOOOOOOOOO_LONG,__text=%t.data %t %t.too-long-seg-name 2>&1 \
|
||||
|
|
|
@ -13,8 +13,8 @@
|
|||
# RUN: not llvm-objcopy --redefine-syms %t.rename.txt %t /dev/null 2>&1 | FileCheck %s --check-prefix=MISSING-SYM-NAME
|
||||
# MISSING-SYM-NAME: error: {{.*}}.rename.txt:2: missing new symbol name
|
||||
|
||||
# RUN: not llvm-objcopy --redefine-syms %t.rename-none.txt %t /dev/null 2>&1 | FileCheck %s --check-prefix=NO-FILE
|
||||
# NO-FILE: error: '{{.*}}.rename-none.txt': {{[Nn]}}o such file or directory
|
||||
# RUN: not llvm-objcopy --redefine-syms %t.rename-none.txt %t /dev/null 2>&1 | FileCheck -DMSG=%errc_ENOENT %s --check-prefix=NO-FILE
|
||||
# NO-FILE: error: '{{.*}}.rename-none.txt': [[MSG]]
|
||||
|
||||
!ELF
|
||||
FileHeader:
|
||||
|
|
|
@ -4,14 +4,14 @@
|
|||
# RUN: od -t x1 %t.sec | FileCheck %s
|
||||
|
||||
# RUN: not llvm-objcopy --dump-section=nonexistent=%t.sec %t 2>&1 | FileCheck --check-prefix=NONEXISTENT %s
|
||||
# RUN: not llvm-objcopy --dump-section=producers=%t.dir/bar %t 2>&1 | FileCheck --check-prefix=DIROUT %s
|
||||
# RUN: not llvm-objcopy --dump-section=producers=%t.dir/bar %t 2>&1 | FileCheck -DMSG=%errc_ENOENT --check-prefix=DIROUT %s
|
||||
|
||||
## Raw contents of the producers section.
|
||||
# CHECK: 0000000 01 0c 70 72 6f 63 65 73 73 65 64 2d 62 79 01 05
|
||||
# CHECK: 0000020 63 6c 61 6e 67 05 39 2e 30 2e 30
|
||||
|
||||
# NONEXISTENT: section 'nonexistent' not found
|
||||
# DIROUT: error: {{.*}}/bar': {{[nN]}}o such file or directory
|
||||
# DIROUT: error: {{.*}}/bar': [[MSG]]
|
||||
|
||||
## Check that dumping and removing a section works in the same invocation
|
||||
# RUN: llvm-objcopy --dump-section=producers=%t.sec --remove-section=producers %t %t2
|
||||
|
|
|
@ -73,8 +73,8 @@ RUN: not llvm-profdata merge -instr -weighted-input=3,%p/Inputs/weight-instr-bar
|
|||
INVALID_WEIGHT: error: Input weight must be a positive integer.
|
||||
|
||||
4- Bad merge: input path does not exist
|
||||
RUN: not llvm-profdata merge -instr -weighted-input=3,%p/Inputs/does-not-exist.profdata -weighted-input=2,%p/Inputs/does-not-exist-either.profdata -o %t.out 2>&1 | FileCheck %s -check-prefix=INVALID_INPUT
|
||||
INVALID_INPUT: {{.*}}: {{.*}}does-not-exist.profdata: {{[Nn]}}o such file or directory
|
||||
RUN: not llvm-profdata merge -instr -weighted-input=3,%p/Inputs/does-not-exist.profdata -weighted-input=2,%p/Inputs/does-not-exist-either.profdata -o %t.out 2>&1 | FileCheck -DMSG=%errc_ENOENT %s -check-prefix=INVALID_INPUT
|
||||
INVALID_INPUT: {{.*}}: {{.*}}does-not-exist.profdata: [[MSG]]
|
||||
|
||||
5- No inputs
|
||||
RUN: not llvm-profdata merge -instr -o %t.out 2>&1 | FileCheck %s -check-prefix=NO_INPUT
|
||||
|
|
|
@ -48,8 +48,8 @@ RUN: not llvm-profdata merge -sample -weighted-input=3,%p/Inputs/weight-sample-b
|
|||
INVALID_WEIGHT: error: Input weight must be a positive integer.
|
||||
|
||||
4- Bad merge: input path does not exist
|
||||
RUN: not llvm-profdata merge -sample -weighted-input=3,%p/Inputs/does-not-exist.proftext -weighted-input=2,%p/Inputs/does-not-exist-either.proftext -o %t.out 2>&1 | FileCheck %s -check-prefix=INVALID_INPUT
|
||||
INVALID_INPUT: {{.*}}: {{.*}}does-not-exist.proftext: {{[Nn]}}o such file or directory
|
||||
RUN: not llvm-profdata merge -sample -weighted-input=3,%p/Inputs/does-not-exist.proftext -weighted-input=2,%p/Inputs/does-not-exist-either.proftext -o %t.out 2>&1 | FileCheck -DMSG=%errc_ENOENT %s -check-prefix=INVALID_INPUT
|
||||
INVALID_INPUT: {{.*}}: {{.*}}does-not-exist.proftext: [[MSG]]
|
||||
|
||||
5- No inputs
|
||||
RUN: not llvm-profdata merge -sample -o %t.out 2>&1 | FileCheck %s -check-prefix=NO_INPUT
|
||||
|
|
|
@ -14,9 +14,9 @@
|
|||
# Show that relative paths in an error message for both archive and member look
|
||||
# sensible.
|
||||
# RUN: rm a/b/1.o
|
||||
# RUN: not llvm-readobj --file-headers a/relative.a 2>&1 | FileCheck %s --check-prefix=ERR1
|
||||
# RUN: not llvm-readelf --file-headers a/relative.a 2>&1 | FileCheck %s --check-prefix=ERR1
|
||||
# ERR1: error: 'a/relative.a': 'b/1.o': {{[Nn]}}o such file or directory
|
||||
# RUN: not llvm-readobj --file-headers a/relative.a 2>&1 | FileCheck %s --check-prefix=ERR1 -DMSG=%errc_ENOENT
|
||||
# RUN: not llvm-readelf --file-headers a/relative.a 2>&1 | FileCheck %s --check-prefix=ERR1 -DMSG=%errc_ENOENT
|
||||
# ERR1: error: 'a/relative.a': 'b/1.o': [[MSG]]
|
||||
|
||||
# RUN: mkdir -p %t/c
|
||||
# RUN: yaml2obj %s -o a/b/1.o
|
||||
|
@ -28,9 +28,9 @@
|
|||
|
||||
# Show that absolute paths in an error message for both archive and member are correct.
|
||||
# RUN: rm a/b/1.o
|
||||
# RUN: not llvm-readobj --file-headers %/t/c/absolute.a 2>&1 | FileCheck %s --check-prefix=ERR2 -DDIR=%/t
|
||||
# RUN: not llvm-readelf --file-headers %/t/c/absolute.a 2>&1 | FileCheck %s --check-prefix=ERR2 -DDIR=%/t
|
||||
# ERR2: error: '[[DIR]]/c/absolute.a': '[[DIR]]/a/b/1.o': {{[Nn]}}o such file or directory
|
||||
# RUN: not llvm-readobj --file-headers %/t/c/absolute.a 2>&1 | FileCheck %s --check-prefix=ERR2 -DDIR=%/t -DMSG=%errc_ENOENT
|
||||
# RUN: not llvm-readelf --file-headers %/t/c/absolute.a 2>&1 | FileCheck %s --check-prefix=ERR2 -DDIR=%/t -DMSG=%errc_ENOENT
|
||||
# ERR2: error: '[[DIR]]/c/absolute.a': '[[DIR]]/a/b/1.o': [[MSG]]
|
||||
|
||||
--- !ELF
|
||||
FileHeader:
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
## Test case where input file does not exit.
|
||||
RUN: not llvm-readobj %t.blah 2>&1 | FileCheck --check-prefix=ENOENT -DTOOL=readobj %s
|
||||
RUN: not llvm-readelf %t.blah 2>&1 | FileCheck --check-prefix=ENOENT -DTOOL=readelf %s
|
||||
RUN: not llvm-readobj %t.blah 2>&1 | FileCheck --check-prefix=ENOENT -DTOOL=readobj -DMSG=%errc_ENOENT %s
|
||||
RUN: not llvm-readelf %t.blah 2>&1 | FileCheck --check-prefix=ENOENT -DTOOL=readelf -DMSG=%errc_ENOENT %s
|
||||
|
||||
ENOENT: llvm-[[TOOL]]{{(\.exe)?}}: error: '{{.*}}.blah': {{[Nn]}}o such file or directory
|
||||
ENOENT: llvm-[[TOOL]]{{(\.exe)?}}: error: '{{.*}}.blah': [[MSG]]
|
||||
|
||||
# Test case with no input file.
|
||||
RUN: not llvm-readobj 2>&1 | FileCheck %s --check-prefix=NO-FILE
|
||||
|
|
|
@ -55,12 +55,12 @@
|
|||
# Remove the second member and show that the first can still be dumped, but that the last isn't.
|
||||
# RUN: rm %t/2.o
|
||||
# RUN: not llvm-readobj --file-headers %t.a 2> %t.err | FileCheck %s --check-prefix=MISSING
|
||||
# RUN: FileCheck %s --check-prefix=ERR --input-file=%t.err
|
||||
# RUN: FileCheck -DMSG=%errc_ENOENT %s --check-prefix=ERR --input-file=%t.err
|
||||
|
||||
# MISSING: File: {{.*}}1.o
|
||||
# MISSING: Format: elf64-x86-64
|
||||
# MISSING-NOT: File: {{.*}}3.o
|
||||
# ERR: error: '{{.*}}.a': '{{.*}}2.o': {{[Nn]}}o such file or directory
|
||||
# ERR: error: '{{.*}}.a': '{{.*}}2.o': [[MSG]]
|
||||
|
||||
--- !ELF
|
||||
FileHeader:
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
## Show that llvm-size emits an error if passed in a non-existent file.
|
||||
|
||||
# RUN: not llvm-size %t.blah 2>&1 | FileCheck %s -DFILE=%t.blah --check-prefix=ENOENT
|
||||
# ENOENT: {{.*}}llvm-size{{.*}}: error: '[[FILE]]': {{[Nn]}}o such file or directory
|
||||
# RUN: not llvm-size %t.blah 2>&1 | FileCheck %s -DFILE=%t.blah -DMSG=%errc_ENOENT --check-prefix=ENOENT
|
||||
# ENOENT: {{.*}}llvm-size{{.*}}: error: '[[FILE]]': [[MSG]]
|
||||
|
||||
## Show that llvm-size reads a.out if not passed any file.
|
||||
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
RUN: llvm-symbolizer 0x401000 0x401001 -obj="%p/Inputs/missing_pdb.exe" 2>%t.err \
|
||||
RUN: | FileCheck %s
|
||||
RUN: FileCheck --check-prefix=ERROR %s < %t.err
|
||||
RUN: FileCheck -DMSG=%errc_ENOENT --check-prefix=ERROR %s < %t.err
|
||||
|
||||
llvm-symbolizer should print one error and two unknown line info records.
|
||||
|
||||
ERROR: LLVMSymbolizer: error reading file: {{.*}}: {{N|n}}o such file or directory
|
||||
ERROR: LLVMSymbolizer: error reading file: {{.*}}: [[MSG]]
|
||||
ERROR-NOT: error reading file
|
||||
|
||||
CHECK: ??
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
; RUN: not llvm-xray extract no-such-file 2>&1 | FileCheck %s
|
||||
; RUN: not llvm-xray extract no-such-file 2>&1 | FileCheck -DMSG=%errc_ENOENT %s
|
||||
|
||||
; CHECK: llvm-xray: Cannot extract instrumentation map from 'no-such-file'.
|
||||
; CHECK-NEXT: {{[Nn]}}o such file or directory
|
||||
; CHECK-NEXT: [[MSG]]
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
# RUN: not obj2yaml %p/path/does/not/exist 2>&1 | FileCheck %s
|
||||
# RUN: not obj2yaml %p/path/does/not/exist 2>&1 | FileCheck -DMSG=%errc_ENOENT %s
|
||||
|
||||
# CHECK: Error reading file: {{.*}}/path/does/not/exist: {{[Nn]}}o such file or directory
|
||||
# CHECK: Error reading file: {{.*}}/path/does/not/exist: [[MSG]]
|
||||
|
|
|
@ -7,9 +7,9 @@
|
|||
# RUN: yaml2obj %s -o%t
|
||||
# RUN: ls %t
|
||||
|
||||
# RUN: not yaml2obj -o %p/path/does/not/exist 2>&1 | FileCheck %s
|
||||
# RUN: not yaml2obj -o %p/path/does/not/exist 2>&1 | FileCheck -DMSG=%errc_ENOENT %s
|
||||
|
||||
# CHECK: yaml2obj: error: failed to open '{{.*}}/path/does/not/exist': {{[Nn]}}o such file or directory
|
||||
# CHECK: yaml2obj: error: failed to open '{{.*}}/path/does/not/exist': [[MSG]]
|
||||
|
||||
!ELF
|
||||
FileHeader:
|
||||
|
|
|
@ -345,6 +345,17 @@ class LLVMConfig(object):
|
|||
self.config.substitutions.extend(substitutions)
|
||||
return True
|
||||
|
||||
def add_err_msg_substitutions(self):
|
||||
if (sys.platform == 'zos'):
|
||||
self.config.substitutions.append(('%errc_ENOENT', '\'EDC5129I No such file or directory.\''))
|
||||
self.config.substitutions.append(('%errc_EISDIR', '\'EDC5123I Is a directory.\''))
|
||||
elif (sys.platform == 'win32'):
|
||||
self.config.substitutions.append(('%errc_ENOENT', '\'no such file or directory\''))
|
||||
self.config.substitutions.append(('%errc_EISDIR', '\'is a directory\''))
|
||||
else:
|
||||
self.config.substitutions.append(('%errc_ENOENT', '\'No such file or directory\''))
|
||||
self.config.substitutions.append(('%errc_EISDIR', '\'Is a directory\''))
|
||||
|
||||
def use_default_substitutions(self):
|
||||
tool_patterns = [
|
||||
ToolSubst('FileCheck', unresolved='fatal'),
|
||||
|
@ -358,6 +369,8 @@ class LLVMConfig(object):
|
|||
self.add_tool_substitutions(
|
||||
tool_patterns, [self.config.llvm_tools_dir])
|
||||
|
||||
self.add_err_msg_substitutions()
|
||||
|
||||
def use_llvm_tool(self, name, search_env=None, required=False, quiet=False):
|
||||
"""Find the executable program 'name', optionally using the specified
|
||||
environment variable as an override before searching the
|
||||
|
|
Loading…
Reference in New Issue