diff options
author | Jonas Paulsson <paulsson@linux.vnet.ibm.com> | 2017-03-17 07:11:42 +0000 |
---|---|---|
committer | Jonas Paulsson <paulsson@linux.vnet.ibm.com> | 2017-03-17 07:11:42 +0000 |
commit | f20386de622a7272a479c5bcd9f375a8034a3068 (patch) | |
tree | a87c4ab843b8bd66e9591503bf8a8d53c892fdd2 /llvm/utils/update_llc_test_checks.py | |
parent | 8a7bd24c82afd5fd344a58a7cc2062356ef2e34b (diff) | |
download | bcm5719-llvm-f20386de622a7272a479c5bcd9f375a8034a3068.tar.gz bcm5719-llvm-f20386de622a7272a479c5bcd9f375a8034a3068.zip |
Add SystemZ to utils/update_llc_test_checks.py.
Extend script for auto-generating CHECK lines so that it works for SystemZ.
This is a pre-commit for the new tests resulting from
https://reviews.llvm.org/D29489
llvm-svn: 298048
Diffstat (limited to 'llvm/utils/update_llc_test_checks.py')
-rwxr-xr-x | llvm/utils/update_llc_test_checks.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/llvm/utils/update_llc_test_checks.py b/llvm/utils/update_llc_test_checks.py index e973d517c44..4cc72a43718 100755 --- a/llvm/utils/update_llc_test_checks.py +++ b/llvm/utils/update_llc_test_checks.py @@ -68,6 +68,13 @@ ASM_FUNCTION_PPC_RE = re.compile( r'.Lfunc_end[0-9]+:\n', flags=(re.M | re.S)) +ASM_FUNCTION_SYSTEMZ_RE = re.compile( + r'^_?(?P<func>[^:]+):[ \t]*#+[ \t]*@(?P=func)\n' + r'[ \t]+.cfi_startproc\n' + r'(?P<body>.*?)\n' + r'.Lfunc_end[0-9]+:\n', + flags=(re.M | re.S)) + def scrub_asm_x86(asm): # Scrub runs of whitespace out of the assembly, but leave the leading @@ -111,6 +118,16 @@ def scrub_asm_powerpc64le(asm): asm = SCRUB_TRAILING_WHITESPACE_RE.sub(r'', asm) return asm +def scrub_asm_systemz(asm): + # Scrub runs of whitespace out of the assembly, but leave the leading + # whitespace in place. + asm = SCRUB_WHITESPACE_RE.sub(r' ', asm) + # Expand the tabs used for indentation. + asm = string.expandtabs(asm, 2) + # Strip trailing whitespace. + asm = SCRUB_TRAILING_WHITESPACE_RE.sub(r'', asm) + return asm + # Build up a dictionary of all the function bodies. def build_function_body_dictionary(raw_tool_output, triple, prefixes, func_dict, @@ -125,6 +142,7 @@ def build_function_body_dictionary(raw_tool_output, triple, prefixes, func_dict, 'thumbv8-eabi': (scrub_asm_arm_eabi, ASM_FUNCTION_ARM_RE), 'armeb-eabi': (scrub_asm_arm_eabi, ASM_FUNCTION_ARM_RE), 'powerpc64le': (scrub_asm_powerpc64le, ASM_FUNCTION_PPC_RE), + 's390x': (scrub_asm_systemz, ASM_FUNCTION_SYSTEMZ_RE), } handlers = None for prefix, s in target_handlers.items(): |