[llvm] 54d0061 - [Utils] update_llc_test_checks.py: updated the regexp for ARM target (#148287)

via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 12 07:31:10 PDT 2025


Author: Tommaso Fellegara
Date: 2025-08-12T15:31:07+01:00
New Revision: 54d006180908804e2e04411d001a651f35b96421

URL: https://github.com/llvm/llvm-project/commit/54d006180908804e2e04411d001a651f35b96421
DIFF: https://github.com/llvm/llvm-project/commit/54d006180908804e2e04411d001a651f35b96421.diff

LOG: [Utils] update_llc_test_checks.py: updated the regexp for ARM target (#148287)

Fixes #147485.

I changed the regexp for the ARM targets making the part `@+[\t]*@"?(?P=func)"?` optional since when the -asm-verbose=false is passed it is not generated and this led to the issue.

Added: 
    

Modified: 
    llvm/utils/UpdateTestChecks/asm.py

Removed: 
    


################################################################################
diff  --git a/llvm/utils/UpdateTestChecks/asm.py b/llvm/utils/UpdateTestChecks/asm.py
index 98b4b5da8a3df..27b2aa8d0bdbe 100644
--- a/llvm/utils/UpdateTestChecks/asm.py
+++ b/llvm/utils/UpdateTestChecks/asm.py
@@ -32,7 +32,7 @@ class string:
 )
 
 ASM_FUNCTION_ARM_RE = re.compile(
-    r'^(?P<func>[0-9a-zA-Z_$]+):[ \t]*@+[ \t]*@"?(?P=func)"?\n'  # f: (name of function)
+    r'^(?P<func>[0-9a-zA-Z_$]+):[ \t]*(@+[ \t]*@"?(?P=func)"?)?\n'  # f: (name of function)
     r"(?:\.L(?P=func)\$local:\n)?"  # drop .L<func>$local:
     r"(?:\s*\.type\s+\.L(?P=func)\$local, at function\n)?"  # drop .type .L<func>$local
     r"\s+\.fnstart\n"  # .fnstart
@@ -42,11 +42,11 @@ class string:
 )
 
 ASM_FUNCTION_AARCH64_RE = re.compile(
-    r'^_?(?P<func>[^:]+):[ \t]*\/\/[ \t]*@"?(?P=func)"?( (Function|Tail Call))?\n'
+    r'^(?P<func>_?[a-zA-Z][^:]*):[ \t]*(\/\/[ \t]*@"?(?P=func)"?)?( (Function|Tail Call))?\n'
     r"(?:[ \t]+.cfi_startproc\n)?"  # drop optional cfi noise
-    r"(?P<body>.*?)\n"
+    r"(?P<body>.*?)"
     # This list is incomplete
-    r"^\s*(\.Lfunc_end[0-9]+|// -- End function)",
+    r"^(\.Lfunc_end[0-9]+:|// -- End function)",
     flags=(re.M | re.S),
 )
 
@@ -173,7 +173,7 @@ class string:
 )
 
 ASM_FUNCTION_ARM_MACHO_RE = re.compile(
-    r'^_(?P<func>[^:]+):[ \t]*@[ \t]@"?(?P=func)"?\n'
+    r'^_(?P<func>[^:]+):[ \t]*(@[ \t]@"?(?P=func)"?)?\n'
     r"([ \t]*.cfi_startproc\n[ \t]*)?"
     r"(?P<body>.*?)\n"
     r"[ \t]*\.cfi_endproc\n",
@@ -181,21 +181,21 @@ class string:
 )
 
 ASM_FUNCTION_THUMBS_DARWIN_RE = re.compile(
-    r'^_(?P<func>[^:]+):[ \t]*@[ \t]@"?(?P=func)"?\n'
+    r'^_(?P<func>[^:]+):[ \t]*(@[ \t]@"?(?P=func)"?)?\n'
     r"(?P<body>.*?)\n"
     r"[ \t]*\.data_region\n",
     flags=(re.M | re.S),
 )
 
 ASM_FUNCTION_THUMB_DARWIN_RE = re.compile(
-    r'^_(?P<func>[^:]+):[ \t]*@[ \t]@"?(?P=func)"?\n'
+    r'^_(?P<func>[^:]+):[ \t]*(@[ \t]@"?(?P=func)"?)?\n'
     r"(?P<body>.*?)\n"
     r"^[ \t]*@[ \t]--[ \t]End[ \t]function",
     flags=(re.M | re.S),
 )
 
 ASM_FUNCTION_ARM_IOS_RE = re.compile(
-    r'^_(?P<func>[^:]+):[ \t]*@[ \t]@"?(?P=func)"?\n'
+    r'^_(?P<func>[^:]+):[ \t]*(@[ \t]@"?(?P=func)"?)?\n'
     r"(?P<body>.*?)"
     r"^[ \t]*@[ \t]--[ \t]End[ \t]function",
     flags=(re.M | re.S),


        


More information about the llvm-commits mailing list