Skip to content

Commit 54d0061

Browse files
authored
[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.
1 parent bd3aa88 commit 54d0061

File tree

1 file changed

+8
-8
lines changed
  • llvm/utils/UpdateTestChecks

1 file changed

+8
-8
lines changed

llvm/utils/UpdateTestChecks/asm.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class string:
3232
)
3333

3434
ASM_FUNCTION_ARM_RE = re.compile(
35-
r'^(?P<func>[0-9a-zA-Z_$]+):[ \t]*@+[ \t]*@"?(?P=func)"?\n' # f: (name of function)
35+
r'^(?P<func>[0-9a-zA-Z_$]+):[ \t]*(@+[ \t]*@"?(?P=func)"?)?\n' # f: (name of function)
3636
r"(?:\.L(?P=func)\$local:\n)?" # drop .L<func>$local:
3737
r"(?:\s*\.type\s+\.L(?P=func)\$local,@function\n)?" # drop .type .L<func>$local
3838
r"\s+\.fnstart\n" # .fnstart
@@ -42,11 +42,11 @@ class string:
4242
)
4343

4444
ASM_FUNCTION_AARCH64_RE = re.compile(
45-
r'^_?(?P<func>[^:]+):[ \t]*\/\/[ \t]*@"?(?P=func)"?( (Function|Tail Call))?\n'
45+
r'^(?P<func>_?[a-zA-Z][^:]*):[ \t]*(\/\/[ \t]*@"?(?P=func)"?)?( (Function|Tail Call))?\n'
4646
r"(?:[ \t]+.cfi_startproc\n)?" # drop optional cfi noise
47-
r"(?P<body>.*?)\n"
47+
r"(?P<body>.*?)"
4848
# This list is incomplete
49-
r"^\s*(\.Lfunc_end[0-9]+|// -- End function)",
49+
r"^(\.Lfunc_end[0-9]+:|// -- End function)",
5050
flags=(re.M | re.S),
5151
)
5252

@@ -173,29 +173,29 @@ class string:
173173
)
174174

175175
ASM_FUNCTION_ARM_MACHO_RE = re.compile(
176-
r'^_(?P<func>[^:]+):[ \t]*@[ \t]@"?(?P=func)"?\n'
176+
r'^_(?P<func>[^:]+):[ \t]*(@[ \t]@"?(?P=func)"?)?\n'
177177
r"([ \t]*.cfi_startproc\n[ \t]*)?"
178178
r"(?P<body>.*?)\n"
179179
r"[ \t]*\.cfi_endproc\n",
180180
flags=(re.M | re.S),
181181
)
182182

183183
ASM_FUNCTION_THUMBS_DARWIN_RE = re.compile(
184-
r'^_(?P<func>[^:]+):[ \t]*@[ \t]@"?(?P=func)"?\n'
184+
r'^_(?P<func>[^:]+):[ \t]*(@[ \t]@"?(?P=func)"?)?\n'
185185
r"(?P<body>.*?)\n"
186186
r"[ \t]*\.data_region\n",
187187
flags=(re.M | re.S),
188188
)
189189

190190
ASM_FUNCTION_THUMB_DARWIN_RE = re.compile(
191-
r'^_(?P<func>[^:]+):[ \t]*@[ \t]@"?(?P=func)"?\n'
191+
r'^_(?P<func>[^:]+):[ \t]*(@[ \t]@"?(?P=func)"?)?\n'
192192
r"(?P<body>.*?)\n"
193193
r"^[ \t]*@[ \t]--[ \t]End[ \t]function",
194194
flags=(re.M | re.S),
195195
)
196196

197197
ASM_FUNCTION_ARM_IOS_RE = re.compile(
198-
r'^_(?P<func>[^:]+):[ \t]*@[ \t]@"?(?P=func)"?\n'
198+
r'^_(?P<func>[^:]+):[ \t]*(@[ \t]@"?(?P=func)"?)?\n'
199199
r"(?P<body>.*?)"
200200
r"^[ \t]*@[ \t]--[ \t]End[ \t]function",
201201
flags=(re.M | re.S),

0 commit comments

Comments
 (0)