aboutsummaryrefslogtreecommitdiff
path: root/llvm/utils/UpdateTestChecks/asm.py
diff options
context:
space:
mode:
authorRoman Lebedev <lebedev.ri@gmail.com>2019-05-29 20:03:00 +0000
committerRoman Lebedev <lebedev.ri@gmail.com>2019-05-29 20:03:00 +0000
commit68908c9017d7c07f2a83b5d3428d5d15523a656c (patch)
tree5f905f1a9fde254fe8fb9d223ae5353fd544744f /llvm/utils/UpdateTestChecks/asm.py
parent4955eb7ceb98bc2be9641a99e87556c5918abf02 (diff)
downloadllvm-68908c9017d7c07f2a83b5d3428d5d15523a656c.zip
llvm-68908c9017d7c07f2a83b5d3428d5d15523a656c.tar.gz
llvm-68908c9017d7c07f2a83b5d3428d5d15523a656c.tar.bz2
UpdateTestChecks: Lanai triple support
Summary: The assembly structure most resembles the SPARC pattern: ``` .globl f6 ! -- Begin function f6 .p2align 2 .type f6,@function f6: ! @f6 .cfi_startproc ! %bb.0: st %fp, [--%sp] <...> ld -8[%fp], %fp .Lfunc_end0: .size f6, .Lfunc_end0-f6 .cfi_endproc ! -- End function ``` Test being affected by upcoming patch, so regenerate it. Reviewers: RKSimon, jpienaar Reviewed By: RKSimon Subscribers: jyknight, fedor.sergeev, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D62545 llvm-svn: 362019
Diffstat (limited to 'llvm/utils/UpdateTestChecks/asm.py')
-rw-r--r--llvm/utils/UpdateTestChecks/asm.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/llvm/utils/UpdateTestChecks/asm.py b/llvm/utils/UpdateTestChecks/asm.py
index 07ba264..247c301 100644
--- a/llvm/utils/UpdateTestChecks/asm.py
+++ b/llvm/utils/UpdateTestChecks/asm.py
@@ -69,6 +69,13 @@ ASM_FUNCTION_RISCV_RE = re.compile(
r'.Lfunc_end[0-9]+:\n',
flags=(re.M | re.S))
+ASM_FUNCTION_LANAI_RE = re.compile(
+ r'^_?(?P<func>[^:]+):[ \t]*!+[ \t]*@(?P=func)\n'
+ r'(?:[ \t]+.cfi_startproc\n)?' # drop optional cfi noise
+ r'(?P<body>.*?)\s*'
+ r'.Lfunc_end[0-9]+:\n',
+ flags=(re.M | re.S))
+
ASM_FUNCTION_SPARC_RE = re.compile(
r'^_?(?P<func>[^:]+):[ \t]*!+[ \t]*@(?P=func)\n'
r'(?P<body>.*?)\s*'
@@ -186,6 +193,16 @@ def scrub_asm_riscv(asm, args):
asm = common.SCRUB_TRAILING_WHITESPACE_RE.sub(r'', asm)
return asm
+def scrub_asm_lanai(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_sparc(asm, args):
# Scrub runs of whitespace out of the assembly, but leave the leading
# whitespace in place.
@@ -266,6 +283,7 @@ def build_function_body_dictionary_for_triple(args, raw_tool_output, triple, pre
'powerpc64le': (scrub_asm_powerpc, ASM_FUNCTION_PPC_RE),
'riscv32': (scrub_asm_riscv, ASM_FUNCTION_RISCV_RE),
'riscv64': (scrub_asm_riscv, ASM_FUNCTION_RISCV_RE),
+ 'lanai': (scrub_asm_lanai, ASM_FUNCTION_LANAI_RE),
'sparc': (scrub_asm_sparc, ASM_FUNCTION_SPARC_RE),
'sparcv9': (scrub_asm_sparc, ASM_FUNCTION_SPARC_RE),
's390x': (scrub_asm_systemz, ASM_FUNCTION_SYSTEMZ_RE),