diff options
author | Shengchen Kan <shengchen.kan@intel.com> | 2023-02-04 09:35:32 +0800 |
---|---|---|
committer | Shengchen Kan <shengchen.kan@intel.com> | 2023-02-04 10:44:14 +0800 |
commit | ae691c381261311c4ae2697fc5b1ae2e2113ca6c (patch) | |
tree | c84ad76dc7fd8a251959b6b1294ef7c26f67e5d5 /llvm/utils/UpdateTestChecks/common.py | |
parent | abbd4da2043856f443e3d1c8d2c7627cac93a6ac (diff) | |
download | llvm-ae691c381261311c4ae2697fc5b1ae2e2113ca6c.zip llvm-ae691c381261311c4ae2697fc5b1ae2e2113ca6c.tar.gz llvm-ae691c381261311c4ae2697fc5b1ae2e2113ca6c.tar.bz2 |
[UpdateTestChecks][NFC] Share the code to get CHECK prefix between all scripts
Reviewed By: MaskRay
Differential Revision: https://reviews.llvm.org/D143307
Diffstat (limited to 'llvm/utils/UpdateTestChecks/common.py')
-rw-r--r-- | llvm/utils/UpdateTestChecks/common.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/utils/UpdateTestChecks/common.py b/llvm/utils/UpdateTestChecks/common.py index 7e538d7..b35fac4 100644 --- a/llvm/utils/UpdateTestChecks/common.py +++ b/llvm/utils/UpdateTestChecks/common.py @@ -1142,6 +1142,12 @@ def check_prefix(prefix): warn(("Supplied prefix '%s' is invalid. Prefix must contain only alphanumeric characters, hyphens and underscores." + hint) % (prefix)) +def get_check_prefixes(filecheck_cmd): + check_prefixes = [item for m in CHECK_PREFIX_RE.finditer(filecheck_cmd) + for item in m.group(1).split(',')] + if not check_prefixes: + check_prefixes = ['CHECK'] + return check_prefixes def verify_filecheck_prefixes(fc_cmd): fc_cmd_parts = fc_cmd.split() |