diff --git a/clang/test/Analysis/taint-generic.c b/clang/test/Analysis/taint-generic.c --- a/clang/test/Analysis/taint-generic.c +++ b/clang/test/Analysis/taint-generic.c @@ -28,11 +28,11 @@ // RUN: -analyzer-checker=alpha.security.taint \ // RUN: -analyzer-config \ // RUN: alpha.security.taint.TaintPropagation:Config=%S/Inputs/taint-generic-config-ill-formed.yaml \ -// RUN: 2>&1 | FileCheck %s -check-prefix=CHECK-ILL-FORMED +// RUN: 2>&1 | FileCheck -DMSG=%errc_EINVAL %s -check-prefix=CHECK-ILL-FORMED // CHECK-ILL-FORMED: (frontend): invalid input for checker option // CHECK-ILL-FORMED-SAME: 'alpha.security.taint.TaintPropagation:Config', -// CHECK-ILL-FORMED-SAME: that expects a valid yaml file: {{[Ii]}}nvalid argument +// CHECK-ILL-FORMED-SAME: that expects a valid yaml file: [[MSG]] // RUN: not %clang_analyze_cc1 -verify %s \ // RUN: -analyzer-checker=alpha.security.taint \ diff --git a/clang/test/Format/style-on-command-line.cpp b/clang/test/Format/style-on-command-line.cpp --- a/clang/test/Format/style-on-command-line.cpp +++ b/clang/test/Format/style-on-command-line.cpp @@ -1,7 +1,7 @@ // RUN: clang-format -style="{BasedOnStyle: Google, IndentWidth: 8}" %s | FileCheck -strict-whitespace -check-prefix=CHECK1 %s // RUN: clang-format -style="{BasedOnStyle: LLVM, IndentWidth: 7}" %s | FileCheck -strict-whitespace -check-prefix=CHECK2 %s -// RUN: not clang-format -style="{BasedOnStyle: invalid, IndentWidth: 7}" -fallback-style=LLVM %s 2>&1 | FileCheck -strict-whitespace -check-prefix=CHECK3 %s -// RUN: not clang-format -style="{lsjd}" %s -fallback-style=LLVM 2>&1 | FileCheck -strict-whitespace -check-prefix=CHECK4 %s +// RUN: not clang-format -style="{BasedOnStyle: invalid, IndentWidth: 7}" -fallback-style=LLVM %s 2>&1 | FileCheck -DMSG=%errc_EINVAL -strict-whitespace -check-prefix=CHECK3 %s +// RUN: not clang-format -style="{lsjd}" %s -fallback-style=LLVM 2>&1 | FileCheck -DMSG=%errc_EINVAL -strict-whitespace -check-prefix=CHECK4 %s // RUN: mkdir -p %t // RUN: printf "BasedOnStyle: google\nIndentWidth: 5\n" > %t/.clang-format // RUN: clang-format -style=file -assume-filename=%t/foo.cpp < %s | FileCheck -strict-whitespace -check-prefix=CHECK5 %s @@ -24,8 +24,8 @@ // CHECK1: {{^ int\* i;$}} // CHECK2: {{^ int \*i;$}} // CHECK3: Unknown value for BasedOnStyle: invalid -// CHECK3: Error parsing -style: {{I|i}}nvalid argument -// CHECK4: Error parsing -style: {{I|i}}nvalid argument +// CHECK3: Error parsing -style: [[MSG]] +// CHECK4: Error parsing -style: [[MSG]] // CHECK5: {{^ int\* i;$}} // CHECK6: {{^Error reading .*\.clang-format: (I|i)nvalid argument}} // CHECK7: {{^ int\* i;$}} diff --git a/lld/test/COFF/thinlto-emit-imports.ll b/lld/test/COFF/thinlto-emit-imports.ll --- a/lld/test/COFF/thinlto-emit-imports.ll +++ b/lld/test/COFF/thinlto-emit-imports.ll @@ -34,8 +34,8 @@ ; RUN: chmod 400 %t3.obj.imports ; RUN: not lld-link -entry:main -thinlto-index-only \ ; RUN: -thinlto-emit-imports-files %t1.obj %t2.obj %t3.obj \ -; RUN: -out:%t4.exe 2>&1 | FileCheck %s --check-prefix=ERR -; ERR: cannot open {{.*}}3.obj.imports: {{P|p}}ermission denied +; RUN: -out:%t4.exe 2>&1 | FileCheck -DMSG=%errc_EACCES %s --check-prefix=ERR +; ERR: cannot open {{.*}}3.obj.imports: [[MSG]] ; Ensure lld doesn't generate import files when thinlto-index-only is not enabled ; RUN: rm -f %t1.obj.imports diff --git a/lld/test/ELF/lto/resolution-err.ll b/lld/test/ELF/lto/resolution-err.ll --- a/lld/test/ELF/lto/resolution-err.ll +++ b/lld/test/ELF/lto/resolution-err.ll @@ -3,10 +3,10 @@ ; RUN: llvm-as %s -o %t.bc ; RUN: touch %t.resolution.txt ; RUN: chmod -w %t.resolution.txt -; RUN: not ld.lld -save-temps %t.bc -o %t 2>&1 | FileCheck %s +; RUN: not ld.lld -save-temps %t.bc -o %t 2>&1 | FileCheck -DMSG=%errc_EACCES %s ; RUN: rm -f %t.resolution.txt -; CHECK: error: {{[Pp]}}ermission denied{{$}} +; CHECK: error: [[MSG]] target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-unknown-linux-gnu" diff --git a/lld/test/ELF/lto/thinlto-cant-write-index.ll b/lld/test/ELF/lto/thinlto-cant-write-index.ll --- a/lld/test/ELF/lto/thinlto-cant-write-index.ll +++ b/lld/test/ELF/lto/thinlto-cant-write-index.ll @@ -8,9 +8,9 @@ ; RUN: rm -f %t2.o.thinlto.bc ; RUN: touch %t2.o.thinlto.bc ; RUN: chmod u-w %t2.o.thinlto.bc -; RUN: not ld.lld --plugin-opt=thinlto-index-only -shared %t1.o %t2.o -o /dev/null 2>&1 | FileCheck %s +; RUN: not ld.lld --plugin-opt=thinlto-index-only -shared %t1.o %t2.o -o /dev/null 2>&1 | FileCheck -DMSG=%errc_EACCES %s ; RUN: chmod u+w %t2.o.thinlto.bc -; CHECK: cannot open {{.*}}2.o.thinlto.bc: {{P|p}}ermission denied +; CHECK: cannot open {{.*}}2.o.thinlto.bc: [[MSG]] target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-unknown-linux-gnu" diff --git a/lld/test/ELF/lto/thinlto-emit-imports.ll b/lld/test/ELF/lto/thinlto-emit-imports.ll --- a/lld/test/ELF/lto/thinlto-emit-imports.ll +++ b/lld/test/ELF/lto/thinlto-emit-imports.ll @@ -31,8 +31,8 @@ ; RUN: rm -f %t3.o.imports ; RUN: touch %t3.o.imports ; RUN: chmod 400 %t3.o.imports -; RUN: not ld.lld --plugin-opt=thinlto-index-only --plugin-opt=thinlto-emit-imports-files -shared %t1.o %t2.o %t3.o -o /dev/null 2>&1 | FileCheck %s --check-prefix=ERR -; ERR: cannot open {{.*}}3.o.imports: {{P|p}}ermission denied +; RUN: not ld.lld --plugin-opt=thinlto-index-only --plugin-opt=thinlto-emit-imports-files -shared %t1.o %t2.o %t3.o -o /dev/null 2>&1 | FileCheck -DMSG=%errc_EACCES %s --check-prefix=ERR +; ERR: cannot open {{.*}}3.o.imports: [[MSG]] ; Ensure lld doesn't generate import files when thinlto-index-only is not enabled ; RUN: rm -f %t1.o.imports diff --git a/llvm/docs/TestingGuide.rst b/llvm/docs/TestingGuide.rst --- a/llvm/docs/TestingGuide.rst +++ b/llvm/docs/TestingGuide.rst @@ -542,7 +542,8 @@ Some error messages may be substituted to allow different spellings based on the host platform. - The following error codes are currently supported: ENOENT, EISDIR. + The following error codes are currently supported: + ENOENT, EISDIR, EINVAL, EACCES. Example: ``Linux %errc_ENOENT: No such file or directory`` diff --git a/llvm/test/tools/llvm-ar/error-opening-permission.test b/llvm/test/tools/llvm-ar/error-opening-permission.test --- a/llvm/test/tools/llvm-ar/error-opening-permission.test +++ b/llvm/test/tools/llvm-ar/error-opening-permission.test @@ -9,6 +9,6 @@ # RUN: llvm-ar rc %t/permission.b %t/1.txt # RUN: chmod 100 %t/permission.b # RUN: not llvm-ar p %t/permission.b 2>&1 | \ -# RUN: FileCheck %s --check-prefix=NO-PERMISSION -DARCHIVE=%t/permission.b +# RUN: FileCheck %s --check-prefix=NO-PERMISSION -DARCHIVE=%t/permission.b -DMSG=%errc_EACCES -# NO-PERMISSION: error: unable to open '[[ARCHIVE]]': {{.*}}{{[pP]}}ermission denied +# NO-PERMISSION: error: unable to open '[[ARCHIVE]]': [[MSG]] diff --git a/llvm/test/tools/llvm-elfabi/fail-file-write.test b/llvm/test/tools/llvm-elfabi/fail-file-write.test --- a/llvm/test/tools/llvm-elfabi/fail-file-write.test +++ b/llvm/test/tools/llvm-elfabi/fail-file-write.test @@ -5,7 +5,7 @@ # RUN: mkdir %t.TestDir # RUN: touch %t.TestDir/Output.TestFile # RUN: chmod 400 %t.TestDir -# RUN: not llvm-elfabi %s --output-target=elf64-little %t.TestDir/Output.TestFile 2>&1 | FileCheck %s --check-prefix=ERR +# RUN: not llvm-elfabi %s --output-target=elf64-little %t.TestDir/Output.TestFile 2>&1 | FileCheck -DMSG=%errc_EACCES %s --check-prefix=ERR # RUN: chmod 777 %t.TestDir # RUN: rm -rf %t.TestDir @@ -15,4 +15,4 @@ Symbols: {} ... -# ERR: {{.*}}Permission denied{{.*}} when trying to open `{{.*}}.TestDir/Output.TestFile` for writing +# ERR: [[MSG]] when trying to open `{{.*}}.TestDir/Output.TestFile` for writing diff --git a/llvm/test/tools/yaml2obj/ELF/DWARF/debug-gnu-pubnames.yaml b/llvm/test/tools/yaml2obj/ELF/DWARF/debug-gnu-pubnames.yaml --- a/llvm/test/tools/yaml2obj/ELF/DWARF/debug-gnu-pubnames.yaml +++ b/llvm/test/tools/yaml2obj/ELF/DWARF/debug-gnu-pubnames.yaml @@ -225,12 +225,12 @@ ## h) Test that yaml2obj emits an error if 'Descriptor' is missing. -# RUN: not yaml2obj --docnum=8 %s -o %t8.o 2>&1 | FileCheck %s --check-prefix=MISSING-KEY --ignore-case +# RUN: not yaml2obj --docnum=8 %s -o %t8.o 2>&1 | FileCheck -DMSG=%errc_EINVAL %s --check-prefix=MISSING-KEY --ignore-case # MISSING-KEY: YAML:{{.*}}:9: error: missing required key 'Descriptor' # MISSING-KEY-NEXT: - DieOffset: 0x12345678 # MISSING-KEY-NEXT: ^ -# MISSING-KEY-NEXT: yaml2obj: error: failed to parse YAML input: Invalid argument +# MISSING-KEY-NEXT: yaml2obj: error: failed to parse YAML input: [[MSG]] --- !ELF FileHeader: diff --git a/llvm/utils/lit/lit/llvm/config.py b/llvm/utils/lit/lit/llvm/config.py --- a/llvm/utils/lit/lit/llvm/config.py +++ b/llvm/utils/lit/lit/llvm/config.py @@ -349,12 +349,18 @@ 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.\'')) + self.config.substitutions.append(('%errc_EINVAL', '\'EDC5121I Invalid argument.\'')) + self.config.substitutions.append(('%errc_EACCES', '\'EDC5111I Permission denied.\'')) elif (sys.platform == 'win32'): self.config.substitutions.append(('%errc_ENOENT', '\'no such file or directory\'')) self.config.substitutions.append(('%errc_EISDIR', '\'is a directory\'')) + self.config.substitutions.append(('%errc_EINVAL', '\'invalid argument\'')) + self.config.substitutions.append(('%errc_EACCES', '\'permission denied\'')) else: self.config.substitutions.append(('%errc_ENOENT', '\'No such file or directory\'')) self.config.substitutions.append(('%errc_EISDIR', '\'Is a directory\'')) + self.config.substitutions.append(('%errc_EINVAL', '\'Invalid argument\'')) + self.config.substitutions.append(('%errc_EACCES', '\'Permission denied\'')) def use_default_substitutions(self): tool_patterns = [