diff options
author | Ben Shi <powerman1st@163.com> | 2021-01-26 17:50:56 +0800 |
---|---|---|
committer | Ben Shi <powerman1st@163.com> | 2021-01-26 17:50:56 +0800 |
commit | 2d7aa149a40b22f3d6721ec7e970ec09a77f8173 (patch) | |
tree | b207197d6f8edbe7d7b15649f1c53e687b69033a /llvm/utils/UpdateTestChecks/asm.py | |
parent | 2a33b092f5b175a21680b3980ff2019bc1c65b12 (diff) | |
download | llvm-2d7aa149a40b22f3d6721ec7e970ec09a77f8173.zip llvm-2d7aa149a40b22f3d6721ec7e970ec09a77f8173.tar.gz llvm-2d7aa149a40b22f3d6721ec7e970ec09a77f8173.tar.bz2 |
[update_llc_test_checks] Support AVR
Reviewed By: arichardson
Differential Revision: https://reviews.llvm.org/D95240
Diffstat (limited to 'llvm/utils/UpdateTestChecks/asm.py')
-rw-r--r-- | llvm/utils/UpdateTestChecks/asm.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/llvm/utils/UpdateTestChecks/asm.py b/llvm/utils/UpdateTestChecks/asm.py index 407b26c..6390ace4 100644 --- a/llvm/utils/UpdateTestChecks/asm.py +++ b/llvm/utils/UpdateTestChecks/asm.py @@ -67,6 +67,12 @@ ASM_FUNCTION_MSP430_RE = re.compile( r'(\$|\.L)func_end[0-9]+:\n', # $func_end0: flags=(re.M | re.S)) +ASM_FUNCTION_AVR_RE = re.compile( + r'^_?(?P<func>[^:]+):[ \t]*;+[ \t]*@"?(?P=func)"?\n[^:]*?' + r'(?P<body>.*?)\n' + r'.Lfunc_end[0-9]+:\n', + flags=(re.M | re.S)) + ASM_FUNCTION_PPC_RE = re.compile( r'#[ \-\t]*Begin function (?P<func>[^.:]+)\n' r'.*?' @@ -261,6 +267,16 @@ def scrub_asm_msp430(asm, args): asm = common.SCRUB_TRAILING_WHITESPACE_RE.sub(r'', asm) return asm +def scrub_asm_avr(asm, args): + # Scrub runs of whitespace out of the assembly, but leave the leading + # whitespace in place. + asm = common.SCRUB_WHITESPACE_RE.sub(r' ', asm) + # Expand the tabs used for indentation. + asm = string.expandtabs(asm, 2) + # Strip trailing whitespace. + asm = common.SCRUB_TRAILING_WHITESPACE_RE.sub(r'', asm) + return asm + def scrub_asm_riscv(asm, args): # Scrub runs of whitespace out of the assembly, but leave the leading # whitespace in place. @@ -347,6 +363,7 @@ def get_run_handler(triple): 'thumbv7-apple-ios' : (scrub_asm_arm_eabi, ASM_FUNCTION_ARM_IOS_RE), 'mips': (scrub_asm_mips, ASM_FUNCTION_MIPS_RE), 'msp430': (scrub_asm_msp430, ASM_FUNCTION_MSP430_RE), + 'avr': (scrub_asm_avr, ASM_FUNCTION_AVR_RE), 'ppc32': (scrub_asm_powerpc, ASM_FUNCTION_PPC_RE), 'powerpc': (scrub_asm_powerpc, ASM_FUNCTION_PPC_RE), 'riscv32': (scrub_asm_riscv, ASM_FUNCTION_RISCV_RE), |