1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-18 18:42:46 +02:00

[test] Use host platform specific error message substitution in lit tests - continued

On z/OS, other error messages are not matched correctly in lit tests.

```
EDC5121I Invalid argument.
EDC5111I Permission denied.
```

This patch adds a lit substitution to fix it.

Reviewed By: jhenderson

Differential Revision: https://reviews.llvm.org/D95808
This commit is contained in:
Abhina Sreeskantharajan 2021-02-03 09:52:43 -05:00
parent 6eade37b9b
commit e6f220185d
5 changed files with 14 additions and 7 deletions

View File

@ -542,7 +542,8 @@ RUN lines:
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``

View File

@ -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]]

View File

@ -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 @@ Arch: AArch64
Symbols: {}
...
# ERR: {{.*}}Permission denied{{.*}} when trying to open `{{.*}}.TestDir/Output.TestFile` for writing
# ERR: [[MSG]] when trying to open `{{.*}}.TestDir/Output.TestFile` for writing

View File

@ -225,12 +225,12 @@ DWARF:
## 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:

View File

@ -349,12 +349,18 @@ class LLVMConfig(object):
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 = [