aboutsummaryrefslogtreecommitdiff
path: root/llvm/utils/UpdateTestChecks/asm.py
diff options
context:
space:
mode:
authorHarald van Dijk <harald@gigawatt.nl>2020-12-12 17:11:13 +0000
committerHarald van Dijk <harald@gigawatt.nl>2020-12-12 17:11:13 +0000
commit67c97ed4a5a99315b305750a7fc0aaa6744e3d37 (patch)
tree5947c22c9ef22337c491dd4c099fa95976157ca3 /llvm/utils/UpdateTestChecks/asm.py
parentf61e5ecb919b3901590328e69d3e4a557eefd788 (diff)
downloadllvm-67c97ed4a5a99315b305750a7fc0aaa6744e3d37.zip
llvm-67c97ed4a5a99315b305750a7fc0aaa6744e3d37.tar.gz
llvm-67c97ed4a5a99315b305750a7fc0aaa6744e3d37.tar.bz2
[UpdateTestChecks] Add --(no-)x86_scrub_sp option.
This makes it possible to use update_llc_test_checks to manage tests that check for incorrect x86 stack offsets. It does not yet modify any test to make use of this new option.
Diffstat (limited to 'llvm/utils/UpdateTestChecks/asm.py')
-rw-r--r--llvm/utils/UpdateTestChecks/asm.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/utils/UpdateTestChecks/asm.py b/llvm/utils/UpdateTestChecks/asm.py
index 24090fc..476e7f1 100644
--- a/llvm/utils/UpdateTestChecks/asm.py
+++ b/llvm/utils/UpdateTestChecks/asm.py
@@ -177,8 +177,9 @@ def scrub_asm_x86(asm, args):
# Detect stack spills and reloads and hide their exact offset and whether
# they used the stack pointer or frame pointer.
asm = SCRUB_X86_SPILL_RELOAD_RE.sub(r'{{[-0-9]+}}(%\1{{[sb]}}p)\2', asm)
- # Generically match the stack offset of a memory operand.
- asm = SCRUB_X86_SP_RE.sub(r'{{[0-9]+}}(%\1)', asm)
+ if getattr(args, 'x86_scrub_sp', True):
+ # Generically match the stack offset of a memory operand.
+ asm = SCRUB_X86_SP_RE.sub(r'{{[0-9]+}}(%\1)', asm)
if getattr(args, 'x86_scrub_rip', False):
# Generically match a RIP-relative memory operand.
asm = SCRUB_X86_RIP_RE.sub(r'{{.*}}(%rip)', asm)