summaryrefslogtreecommitdiffstats
path: root/llvm/utils/UpdateTestChecks/asm.py
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2019-10-03 14:34:28 +0000
committerSanjay Patel <spatel@rotateright.com>2019-10-03 14:34:28 +0000
commit2c9c7d680974d4d6f39a7df52268b8e308a5b50c (patch)
treeb7b77b3ff106e6baa509492048e3c536604485b7 /llvm/utils/UpdateTestChecks/asm.py
parentd1a4b82274603638b7e901cf14c0632906c90e4d (diff)
downloadbcm5719-llvm-2c9c7d680974d4d6f39a7df52268b8e308a5b50c.tar.gz
bcm5719-llvm-2c9c7d680974d4d6f39a7df52268b8e308a5b50c.zip
[UpdateTestChecks] add basic support for parsing msp430 asm
llvm-svn: 373605
Diffstat (limited to 'llvm/utils/UpdateTestChecks/asm.py')
-rw-r--r--llvm/utils/UpdateTestChecks/asm.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/llvm/utils/UpdateTestChecks/asm.py b/llvm/utils/UpdateTestChecks/asm.py
index 1eb354d8a46..81556d65802 100644
--- a/llvm/utils/UpdateTestChecks/asm.py
+++ b/llvm/utils/UpdateTestChecks/asm.py
@@ -58,6 +58,12 @@ ASM_FUNCTION_MIPS_RE = re.compile(
# .Lfunc_end0: (mips64 - NewABI)
flags=(re.M | re.S))
+ASM_FUNCTION_MSP430_RE = re.compile(
+ r'^_?(?P<func>[^:]+):[ \t]*;+[ \t]*@(?P=func)\n[^:]*?'
+ r'(?P<body>.*?)\n'
+ r'(\$|\.L)func_end[0-9]+:\n', # $func_end0:
+ flags=(re.M | re.S))
+
ASM_FUNCTION_PPC_RE = re.compile(
r'^_?(?P<func>[^:]+):[ \t]*#+[ \t]*@(?P=func)\n'
r'.*?'
@@ -231,6 +237,16 @@ def scrub_asm_mips(asm, args):
asm = common.SCRUB_TRAILING_WHITESPACE_RE.sub(r'', asm)
return asm
+def scrub_asm_msp430(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.
@@ -315,6 +331,7 @@ def build_function_body_dictionary_for_triple(args, raw_tool_output, triple, pre
'thumbv5-macho': (scrub_asm_arm_eabi, ASM_FUNCTION_ARM_MACHO_RE),
'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),
'ppc32': (scrub_asm_powerpc, ASM_FUNCTION_PPC_RE),
'powerpc': (scrub_asm_powerpc, ASM_FUNCTION_PPC_RE),
'riscv32': (scrub_asm_riscv, ASM_FUNCTION_RISCV_RE),
OpenPOWER on IntegriCloud