diff --git a/llvm/utils/UpdateTestChecks/asm.py b/llvm/utils/UpdateTestChecks/asm.py --- a/llvm/utils/UpdateTestChecks/asm.py +++ b/llvm/utils/UpdateTestChecks/asm.py @@ -15,7 +15,7 @@ ##### Assembly parser ASM_FUNCTION_X86_RE = re.compile( - r'^_?(?P[^:]+):[ \t]*#+[ \t]*@(?P=func)\n(?:\s*\.?Lfunc_begin[^:\n]*:\n)?[^:]*?' + r'^_?(?P[^:]+):[ \t]*#+[ \t]*@"?(?P=func)"?\n(?:\s*\.?Lfunc_begin[^:\n]*:\n)?[^:]*?' r'(?P^##?[ \t]+[^:]+:.*?)\s*' r'^\s*(?:[^:\n]+?:\s*\n\s*\.size|\.cfi_endproc|\.globl|\.comm|\.(?:sub)?section|#+ -- End function)', flags=(re.M | re.S)) @@ -28,7 +28,7 @@ flags=(re.M | re.S)) ASM_FUNCTION_AARCH64_RE = re.compile( - r'^_?(?P[^:]+):[ \t]*\/\/[ \t]*@(?P=func)\n' + r'^_?(?P[^:]+):[ \t]*\/\/[ \t]*@"?(?P=func)"?\n' r'(?:[ \t]+.cfi_startproc\n)?' # drop optional cfi noise r'(?P.*?)\n' # This list is incomplete @@ -36,21 +36,21 @@ flags=(re.M | re.S)) ASM_FUNCTION_AMDGPU_RE = re.compile( - r'^_?(?P[^:]+):[ \t]*;+[ \t]*@(?P=func)\n[^:]*?' + r'^_?(?P[^:]+):[ \t]*;+[ \t]*@"?(?P=func)"?\n[^:]*?' r'(?P.*?)\n' # (body of the function) # This list is incomplete r'^\s*(\.Lfunc_end[0-9]+:\n|\.section)', flags=(re.M | re.S)) ASM_FUNCTION_HEXAGON_RE = re.compile( - r'^_?(?P[^:]+):[ \t]*//[ \t]*@(?P=func)\n[^:]*?' + r'^_?(?P[^:]+):[ \t]*//[ \t]*@"?(?P=func)"?\n[^:]*?' r'(?P.*?)\n' # (body of the function) # This list is incomplete r'.Lfunc_end[0-9]+:\n', flags=(re.M | re.S)) ASM_FUNCTION_MIPS_RE = re.compile( - r'^_?(?P[^:]+):[ \t]*#+[ \t]*@(?P=func)\n[^:]*?' # f: (name of func) + r'^_?(?P[^:]+):[ \t]*#+[ \t]*@"?(?P=func)"?\n[^:]*?' # f: (name of func) r'(?:^[ \t]+\.(frame|f?mask|set).*?\n)+' # Mips+LLVM standard asm prologue r'(?P.*?)\n' # (body of the function) # Mips+LLVM standard asm epilogue @@ -60,13 +60,13 @@ flags=(re.M | re.S)) ASM_FUNCTION_MSP430_RE = re.compile( - r'^_?(?P[^:]+):[ \t]*;+[ \t]*@(?P=func)\n[^:]*?' + r'^_?(?P[^:]+):[ \t]*;+[ \t]*@"?(?P=func)"?\n[^:]*?' r'(?P.*?)\n' r'(\$|\.L)func_end[0-9]+:\n', # $func_end0: flags=(re.M | re.S)) ASM_FUNCTION_PPC_RE = re.compile( - r'^_?(?P[^:]+):[ \t]*#+[ \t]*@(?P=func)\n' + r'^_?(?P[^:]+):[ \t]*#+[ \t]*@"?(?P=func)"?\n' r'.*?' r'\.Lfunc_begin[0-9]+:\n' r'(?:[ \t]+.cfi_startproc\n)?' @@ -78,33 +78,33 @@ flags=(re.M | re.S)) ASM_FUNCTION_RISCV_RE = re.compile( - r'^_?(?P[^:]+):[ \t]*#+[ \t]*@(?P=func)\n(?:\s*\.?Lfunc_begin[^:\n]*:\n)?[^:]*?' + r'^_?(?P[^:]+):[ \t]*#+[ \t]*@"?(?P=func)"?\n(?:\s*\.?Lfunc_begin[^:\n]*:\n)?[^:]*?' r'(?P^##?[ \t]+[^:]+:.*?)\s*' r'.Lfunc_end[0-9]+:\n', flags=(re.M | re.S)) ASM_FUNCTION_LANAI_RE = re.compile( - r'^_?(?P[^:]+):[ \t]*!+[ \t]*@(?P=func)\n' + r'^_?(?P[^:]+):[ \t]*!+[ \t]*@"?(?P=func)"?\n' r'(?:[ \t]+.cfi_startproc\n)?' # drop optional cfi noise r'(?P.*?)\s*' r'.Lfunc_end[0-9]+:\n', flags=(re.M | re.S)) ASM_FUNCTION_SPARC_RE = re.compile( - r'^_?(?P[^:]+):[ \t]*!+[ \t]*@(?P=func)\n' + r'^_?(?P[^:]+):[ \t]*!+[ \t]*@"?(?P=func)"?\n' r'(?P.*?)\s*' r'.Lfunc_end[0-9]+:\n', flags=(re.M | re.S)) ASM_FUNCTION_SYSTEMZ_RE = re.compile( - r'^_?(?P[^:]+):[ \t]*#+[ \t]*@(?P=func)\n' + r'^_?(?P[^:]+):[ \t]*#+[ \t]*@"?(?P=func)"?\n' r'[ \t]+.cfi_startproc\n' r'(?P.*?)\n' r'.Lfunc_end[0-9]+:\n', flags=(re.M | re.S)) ASM_FUNCTION_AARCH64_DARWIN_RE = re.compile( - r'^_(?P[^:]+):[ \t]*;[ \t]@(?P=func)\n' + r'^_(?P[^:]+):[ \t]*;[ \t]@"?(?P=func)"?\n' r'([ \t]*.cfi_startproc\n[\s]*)?' r'(?P.*?)' r'([ \t]*.cfi_endproc\n[\s]*)?' @@ -112,7 +112,7 @@ flags=(re.M | re.S)) ASM_FUNCTION_ARM_DARWIN_RE = re.compile( - r'^[ \t]*\.globl[ \t]*_(?P[^ \t])[ \t]*@[ \t]--[ \t]Begin[ \t]function[ \t](?P=func)' + r'^[ \t]*\.globl[ \t]*_(?P[^ \t])[ \t]*@[ \t]--[ \t]Begin[ \t]function[ \t]"?(?P=func)"?' r'(?P.*?)' r'^_(?P=func):\n[ \t]*' r'(?P.*?)' @@ -135,7 +135,7 @@ flags=(re.M | re.S)) ASM_FUNCTION_WASM32_RE = re.compile( - r'^_?(?P[^:]+):[ \t]*#+[ \t]*@(?P=func)\n' + r'^_?(?P[^:]+):[ \t]*#+[ \t]*@"?(?P=func)"?\n' r'(?P.*?)\n' r'^\s*(\.Lfunc_end[0-9]+:\n|end_function)', flags=(re.M | re.S)) diff --git a/llvm/utils/UpdateTestChecks/common.py b/llvm/utils/UpdateTestChecks/common.py --- a/llvm/utils/UpdateTestChecks/common.py +++ b/llvm/utils/UpdateTestChecks/common.py @@ -67,16 +67,16 @@ UTC_ARGS_CMD = re.compile(r'.*' + UTC_ARGS_KEY + '\s*(?P.*)\s*$') OPT_FUNCTION_RE = re.compile( - r'^\s*define\s+(?:internal\s+)?[^@]*@(?P[\w.-]+?)\s*' + r'^\s*define\s+(?:internal\s+)?[^@]*@"?(?P[\w.$-]+?)"?\s*' r'(?P\((\)|(.*?[\w.-]+?)\))[^{]*)\{\n(?P.*?)^\}$', flags=(re.M | re.S)) ANALYZE_FUNCTION_RE = re.compile( - r'^\s*\'(?P[\w\s-]+?)\'\s+for\s+function\s+\'(?P[\w.-]+?)\':' + r'^\s*\'(?P[\w\s-]+?)\'\s+for\s+function\s+\'(?P[\w.$-]+?)\':' r'\s*\n(?P.*)$', flags=(re.X | re.S)) -IR_FUNCTION_RE = re.compile(r'^\s*define\s+(?:internal\s+)?[^@]*@([\w.-]+)\s*\(') +IR_FUNCTION_RE = re.compile(r'^\s*define\s+(?:internal\s+)?[^@]*@"?([\w.$-]+)"?\s*\(') TRIPLE_IR_RE = re.compile(r'^\s*target\s+triple\s*=\s*"([^"]+)"$') TRIPLE_ARG_RE = re.compile(r'-mtriple[= ]([^ ]+)') MARCH_ARG_RE = re.compile(r'-march[= ]([^ ]+)')