Skip to content
16 changes: 8 additions & 8 deletions llvm/utils/UpdateTestChecks/asm.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,@function\n)?" # drop .type .L<func>$local
r"\s+\.fnstart\n" # .fnstart
Expand All @@ -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),
)

Expand Down Expand Up @@ -173,29 +173,29 @@ 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",
flags=(re.M | re.S),
)

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),
Expand Down