summaryrefslogtreecommitdiffstats
path: root/llvm/utils/UpdateTestChecks/asm.py
diff options
context:
space:
mode:
authorSimon Atanasyan <simon@atanasyan.com>2019-10-30 19:52:16 +0300
committerSimon Atanasyan <simon@atanasyan.com>2019-11-01 09:42:48 +0300
commita8a89c77ea3c16b45763fca6940bbfd3bef7884f (patch)
treecae4f9d2687502e387ff47f54fbceb4db1d92b20 /llvm/utils/UpdateTestChecks/asm.py
parent622176705550d5af5e2837f4b2188ce9f7590887 (diff)
downloadbcm5719-llvm-a8a89c77ea3c16b45763fca6940bbfd3bef7884f.tar.gz
bcm5719-llvm-a8a89c77ea3c16b45763fca6940bbfd3bef7884f.zip
[utils] Reflow asm check generation to tolerate blank lines
This change introduces two fixes. The second fix allows to generate a test to check the first fix. - Output `CHECK-EMPTY` prefix for an empty line in ASM output. Before that fix `update_llc_test_checks.py` incorrectly emits `CHECK-NEXT: <space>` prefix. - Fix the `ASM_FUNCTION_MIPS_RE` regex to stop on a real function epilogue not on an inline assembler prologue and include inline assembler code into a test. Differential Revision: https://reviews.llvm.org/D47192
Diffstat (limited to 'llvm/utils/UpdateTestChecks/asm.py')
-rw-r--r--llvm/utils/UpdateTestChecks/asm.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/utils/UpdateTestChecks/asm.py b/llvm/utils/UpdateTestChecks/asm.py
index 2c9f4d9c506..06f8a22ad45 100644
--- a/llvm/utils/UpdateTestChecks/asm.py
+++ b/llvm/utils/UpdateTestChecks/asm.py
@@ -53,7 +53,8 @@ ASM_FUNCTION_MIPS_RE = re.compile(
r'^_?(?P<func>[^:]+):[ \t]*#+[ \t]*@(?P=func)\n[^:]*?' # f: (name of func)
r'(?:^[ \t]+\.(frame|f?mask|set).*?\n)+' # Mips+LLVM standard asm prologue
r'(?P<body>.*?)\n' # (body of the function)
- r'(?:^[ \t]+\.(set|end).*?\n)+' # Mips+LLVM standard asm epilogue
+ # Mips+LLVM standard asm epilogue
+ r'(?:(^[ \t]+\.set[^\n]*?\n)*^[ \t]+\.end.*?\n)'
r'(\$|\.L)func_end[0-9]+:\n', # $func_end0: (mips32 - O32) or
# .Lfunc_end0: (mips64 - NewABI)
flags=(re.M | re.S))
OpenPOWER on IntegriCloud