1from __future__ import print_function 2import re 3import sys 4 5from . import common 6 7if sys.version_info[0] > 2: 8 class string: 9 expandtabs = str.expandtabs 10else: 11 import string 12 13# RegEx: this is where the magic happens. 14 15##### Assembly parser 16 17ASM_FUNCTION_X86_RE = re.compile( 18 r'^_?(?P<func>[^:]+):[ \t]*#+[ \t]*(@"?(?P=func)"?| -- Begin function (?P=func))\n(?:\s*\.?Lfunc_begin[^:\n]*:\n)?' 19 r'(?:\.L[^$]+\$local:\n)?' # drop .L<func>$local: 20 r'(?:[ \t]+.cfi_startproc\n|.seh_proc[^\n]+\n)?' # drop optional cfi 21 r'(?P<body>^##?[ \t]+[^:]+:.*?)\s*' 22 r'^\s*(?:[^:\n]+?:\s*\n\s*\.size|\.cfi_endproc|\.globl|\.comm|\.(?:sub)?section|#+ -- End function)', 23 flags=(re.M | re.S)) 24 25ASM_FUNCTION_ARM_RE = re.compile( 26 r'^(?P<func>[0-9a-zA-Z_]+):\n' # f: (name of function) 27 r'\s+\.fnstart\n' # .fnstart 28 r'(?P<body>.*?)\n' # (body of the function) 29 r'.Lfunc_end[0-9]+:', # .Lfunc_end0: or # -- End function 30 flags=(re.M | re.S)) 31 32ASM_FUNCTION_AARCH64_RE = re.compile( 33 r'^_?(?P<func>[^:]+):[ \t]*\/\/[ \t]*@"?(?P=func)"?( (Function|Tail Call))?\n' 34 r'(?:[ \t]+.cfi_startproc\n)?' # drop optional cfi noise 35 r'(?P<body>.*?)\n' 36 # This list is incomplete 37 r'.Lfunc_end[0-9]+:\n', 38 flags=(re.M | re.S)) 39 40ASM_FUNCTION_AMDGPU_RE = re.compile( 41 r'^_?(?P<func>[^:]+):[ \t]*;+[ \t]*@"?(?P=func)"?\n[^:]*?' 42 r'(?P<body>.*?)\n' # (body of the function) 43 # This list is incomplete 44 r'^\s*(\.Lfunc_end[0-9]+:\n|\.section)', 45 flags=(re.M | re.S)) 46 47ASM_FUNCTION_HEXAGON_RE = re.compile( 48 r'^_?(?P<func>[^:]+):[ \t]*//[ \t]*@"?(?P=func)"?\n[^:]*?' 49 r'(?P<body>.*?)\n' # (body of the function) 50 # This list is incomplete 51 r'.Lfunc_end[0-9]+:\n', 52 flags=(re.M | re.S)) 53 54ASM_FUNCTION_M68K_RE = re.compile( 55 r'^_?(?P<func>[^:]+):[ \t]*;[ \t]*@"?(?P=func)"?\n' 56 r'(?P<body>.*?)\s*' # (body of the function) 57 r'.Lfunc_end[0-9]+:\n', 58 flags=(re.M | re.S)) 59 60ASM_FUNCTION_MIPS_RE = re.compile( 61 r'^_?(?P<func>[^:]+):[ \t]*#+[ \t]*@"?(?P=func)"?\n[^:]*?' # f: (name of func) 62 r'(?:\s*\.?Ltmp[^:\n]*:\n)?[^:]*?' # optional .Ltmp<N> for EH 63 r'(?:^[ \t]+\.(frame|f?mask|set).*?\n)+' # Mips+LLVM standard asm prologue 64 r'(?P<body>.*?)\n' # (body of the function) 65 # Mips+LLVM standard asm epilogue 66 r'(?:(^[ \t]+\.set[^\n]*?\n)*^[ \t]+\.end.*?\n)' 67 r'(\$|\.L)func_end[0-9]+:\n', # $func_end0: (mips32 - O32) or 68 # .Lfunc_end0: (mips64 - NewABI) 69 flags=(re.M | re.S)) 70 71ASM_FUNCTION_MSP430_RE = re.compile( 72 r'^_?(?P<func>[^:]+):[ \t]*;+[ \t]*@"?(?P=func)"?\n[^:]*?' 73 r'(?P<body>.*?)\n' 74 r'(\$|\.L)func_end[0-9]+:\n', # $func_end0: 75 flags=(re.M | re.S)) 76 77ASM_FUNCTION_AVR_RE = re.compile( 78 r'^_?(?P<func>[^:]+):[ \t]*;+[ \t]*@"?(?P=func)"?\n[^:]*?' 79 r'(?P<body>.*?)\n' 80 r'.Lfunc_end[0-9]+:\n', 81 flags=(re.M | re.S)) 82 83ASM_FUNCTION_PPC_RE = re.compile( 84 r'#[ \-\t]*Begin function (?P<func>[^.:]+)\n' 85 r'.*?' 86 r'^[_.]?(?P=func):(?:[ \t]*#+[ \t]*@"?(?P=func)"?)?\n' 87 r'(?:^[^#]*\n)*' 88 r'(?P<body>.*?)\n' 89 # This list is incomplete 90 r'(?:^[ \t]*(?:\.(?:long|quad|v?byte)[ \t]+[^\n]+)\n)*' 91 r'(?:\.Lfunc_end|L\.\.(?P=func))[0-9]+:\n', 92 flags=(re.M | re.S)) 93 94ASM_FUNCTION_RISCV_RE = re.compile( 95 r'^_?(?P<func>[^:]+):[ \t]*#+[ \t]*@"?(?P=func)"?\n' 96 r'(?:\s*\.?L(?P=func)\$local:\n)?' # optional .L<func>$local: due to -fno-semantic-interposition 97 r'(?:\s*\.?Lfunc_begin[^:\n]*:\n)?[^:]*?' 98 r'(?P<body>^##?[ \t]+[^:]+:.*?)\s*' 99 r'.Lfunc_end[0-9]+:\n', 100 flags=(re.M | re.S)) 101 102ASM_FUNCTION_LANAI_RE = re.compile( 103 r'^_?(?P<func>[^:]+):[ \t]*!+[ \t]*@"?(?P=func)"?\n' 104 r'(?:[ \t]+.cfi_startproc\n)?' # drop optional cfi noise 105 r'(?P<body>.*?)\s*' 106 r'.Lfunc_end[0-9]+:\n', 107 flags=(re.M | re.S)) 108 109ASM_FUNCTION_SPARC_RE = re.compile( 110 r'^_?(?P<func>[^:]+):[ \t]*!+[ \t]*@"?(?P=func)"?\n' 111 r'(?P<body>.*?)\s*' 112 r'.Lfunc_end[0-9]+:\n', 113 flags=(re.M | re.S)) 114 115ASM_FUNCTION_SYSTEMZ_RE = re.compile( 116 r'^_?(?P<func>[^:]+):[ \t]*#+[ \t]*@"?(?P=func)"?\n' 117 r'[ \t]+.cfi_startproc\n' 118 r'(?P<body>.*?)\n' 119 r'.Lfunc_end[0-9]+:\n', 120 flags=(re.M | re.S)) 121 122ASM_FUNCTION_AARCH64_DARWIN_RE = re.compile( 123 r'^_(?P<func>[^:]+):[ \t]*;[ \t]@"?(?P=func)"?\n' 124 r'([ \t]*.cfi_startproc\n[\s]*)?' 125 r'(?P<body>.*?)' 126 r'([ \t]*.cfi_endproc\n[\s]*)?' 127 r'^[ \t]*;[ \t]--[ \t]End[ \t]function', 128 flags=(re.M | re.S)) 129 130ASM_FUNCTION_ARM_DARWIN_RE = re.compile( 131 r'^[ \t]*\.globl[ \t]*_(?P<func>[^ \t])[ \t]*@[ \t]--[ \t]Begin[ \t]function[ \t]"?(?P=func)"?' 132 r'(?P<directives>.*?)' 133 r'^_(?P=func):\n[ \t]*' 134 r'(?P<body>.*?)' 135 r'^[ \t]*@[ \t]--[ \t]End[ \t]function', 136 flags=(re.M | re.S )) 137 138ASM_FUNCTION_ARM_MACHO_RE = re.compile( 139 r'^_(?P<func>[^:]+):[ \t]*\n' 140 r'([ \t]*.cfi_startproc\n[ \t]*)?' 141 r'(?P<body>.*?)\n' 142 r'[ \t]*\.cfi_endproc\n', 143 flags=(re.M | re.S)) 144 145ASM_FUNCTION_THUMBS_DARWIN_RE = re.compile( 146 r'^_(?P<func>[^:]+):\n' 147 r'(?P<body>.*?)\n' 148 r'[ \t]*\.data_region\n', 149 flags=(re.M | re.S)) 150 151ASM_FUNCTION_THUMB_DARWIN_RE = re.compile( 152 r'^_(?P<func>[^:]+):\n' 153 r'(?P<body>.*?)\n' 154 r'^[ \t]*@[ \t]--[ \t]End[ \t]function', 155 flags=(re.M | re.S)) 156 157ASM_FUNCTION_ARM_IOS_RE = re.compile( 158 r'^_(?P<func>[^:]+):\n' 159 r'(?P<body>.*?)' 160 r'^[ \t]*@[ \t]--[ \t]End[ \t]function', 161 flags=(re.M | re.S)) 162 163ASM_FUNCTION_WASM32_RE = re.compile( 164 r'^_?(?P<func>[^:]+):[ \t]*#+[ \t]*@"?(?P=func)"?\n' 165 r'(?P<body>.*?)\n' 166 r'^\s*(\.Lfunc_end[0-9]+:\n|end_function)', 167 flags=(re.M | re.S)) 168 169ASM_FUNCTION_VE_RE = re.compile( 170 r'^_?(?P<func>[^:]+):[ \t]*#+[ \t]*@(?P=func)\n' 171 r'(?P<body>^##?[ \t]+[^:]+:.*?)\s*' 172 r'.Lfunc_end[0-9]+:\n', 173 flags=(re.M | re.S)) 174 175SCRUB_X86_SHUFFLES_RE = ( 176 re.compile( 177 r'^(\s*\w+) [^#\n]+#+ ((?:[xyz]mm\d+|mem)( \{%k\d+\}( \{z\})?)? = .*)$', 178 flags=re.M)) 179 180SCRUB_X86_SHUFFLES_NO_MEM_RE = ( 181 re.compile( 182 r'^(\s*\w+) [^#\n]+#+ ((?:[xyz]mm\d+|mem)( \{%k\d+\}( \{z\})?)? = (?!.*(?:mem)).*)$', 183 flags=re.M)) 184 185SCRUB_X86_SPILL_RELOAD_RE = ( 186 re.compile( 187 r'-?\d+\(%([er])[sb]p\)(.*(?:Spill|Reload))$', 188 flags=re.M)) 189SCRUB_X86_SP_RE = re.compile(r'\d+\(%(esp|rsp)\)') 190SCRUB_X86_RIP_RE = re.compile(r'[.\w]+\(%rip\)') 191SCRUB_X86_LCP_RE = re.compile(r'\.?LCPI[0-9]+_[0-9]+') 192SCRUB_X86_RET_RE = re.compile(r'ret[l|q]') 193 194def scrub_asm_x86(asm, args): 195 # Scrub runs of whitespace out of the assembly, but leave the leading 196 # whitespace in place. 197 asm = common.SCRUB_WHITESPACE_RE.sub(r' ', asm) 198 # Expand the tabs used for indentation. 199 asm = string.expandtabs(asm, 2) 200 201 # Detect shuffle asm comments and hide the operands in favor of the comments. 202 if getattr(args, 'no_x86_scrub_mem_shuffle', True): 203 asm = SCRUB_X86_SHUFFLES_NO_MEM_RE.sub(r'\1 {{.*#+}} \2', asm) 204 else: 205 asm = SCRUB_X86_SHUFFLES_RE.sub(r'\1 {{.*#+}} \2', asm) 206 207 # Detect stack spills and reloads and hide their exact offset and whether 208 # they used the stack pointer or frame pointer. 209 asm = SCRUB_X86_SPILL_RELOAD_RE.sub(r'{{[-0-9]+}}(%\1{{[sb]}}p)\2', asm) 210 if getattr(args, 'x86_scrub_sp', True): 211 # Generically match the stack offset of a memory operand. 212 asm = SCRUB_X86_SP_RE.sub(r'{{[0-9]+}}(%\1)', asm) 213 if getattr(args, 'x86_scrub_rip', False): 214 # Generically match a RIP-relative memory operand. 215 asm = SCRUB_X86_RIP_RE.sub(r'{{.*}}(%rip)', asm) 216 # Generically match a LCP symbol. 217 asm = SCRUB_X86_LCP_RE.sub(r'{{\.?LCPI[0-9]+_[0-9]+}}', asm) 218 if getattr(args, 'extra_scrub', False): 219 # Avoid generating different checks for 32- and 64-bit because of 'retl' vs 'retq'. 220 asm = SCRUB_X86_RET_RE.sub(r'ret{{[l|q]}}', asm) 221 # Strip kill operands inserted into the asm. 222 asm = common.SCRUB_KILL_COMMENT_RE.sub('', asm) 223 # Strip trailing whitespace. 224 asm = common.SCRUB_TRAILING_WHITESPACE_RE.sub(r'', asm) 225 return asm 226 227def scrub_asm_amdgpu(asm, args): 228 # Scrub runs of whitespace out of the assembly, but leave the leading 229 # whitespace in place. 230 asm = common.SCRUB_WHITESPACE_RE.sub(r' ', asm) 231 # Expand the tabs used for indentation. 232 asm = string.expandtabs(asm, 2) 233 # Strip trailing whitespace. 234 asm = common.SCRUB_TRAILING_WHITESPACE_RE.sub(r'', asm) 235 return asm 236 237def scrub_asm_arm_eabi(asm, args): 238 # Scrub runs of whitespace out of the assembly, but leave the leading 239 # whitespace in place. 240 asm = common.SCRUB_WHITESPACE_RE.sub(r' ', asm) 241 # Expand the tabs used for indentation. 242 asm = string.expandtabs(asm, 2) 243 # Strip kill operands inserted into the asm. 244 asm = common.SCRUB_KILL_COMMENT_RE.sub('', asm) 245 # Strip trailing whitespace. 246 asm = common.SCRUB_TRAILING_WHITESPACE_RE.sub(r'', asm) 247 return asm 248 249def scrub_asm_hexagon(asm, args): 250 # Scrub runs of whitespace out of the assembly, but leave the leading 251 # whitespace in place. 252 asm = common.SCRUB_WHITESPACE_RE.sub(r' ', asm) 253 # Expand the tabs used for indentation. 254 asm = string.expandtabs(asm, 2) 255 # Strip trailing whitespace. 256 asm = common.SCRUB_TRAILING_WHITESPACE_RE.sub(r'', asm) 257 return asm 258 259def scrub_asm_powerpc(asm, args): 260 # Scrub runs of whitespace out of the assembly, but leave the leading 261 # whitespace in place. 262 asm = common.SCRUB_WHITESPACE_RE.sub(r' ', asm) 263 # Expand the tabs used for indentation. 264 asm = string.expandtabs(asm, 2) 265 # Strip unimportant comments, but leave the token '#' in place. 266 asm = common.SCRUB_LOOP_COMMENT_RE.sub(r'#', asm) 267 # Strip trailing whitespace. 268 asm = common.SCRUB_TRAILING_WHITESPACE_RE.sub(r'', asm) 269 # Strip the tailing token '#', except the line only has token '#'. 270 asm = common.SCRUB_TAILING_COMMENT_TOKEN_RE.sub(r'', asm) 271 return asm 272 273def scrub_asm_m68k(asm, args): 274 # Scrub runs of whitespace out of the assembly, but leave the leading 275 # whitespace in place. 276 asm = common.SCRUB_WHITESPACE_RE.sub(r' ', asm) 277 # Expand the tabs used for indentation. 278 asm = string.expandtabs(asm, 2) 279 # Strip trailing whitespace. 280 asm = common.SCRUB_TRAILING_WHITESPACE_RE.sub(r'', asm) 281 return asm 282 283def scrub_asm_mips(asm, args): 284 # Scrub runs of whitespace out of the assembly, but leave the leading 285 # whitespace in place. 286 asm = common.SCRUB_WHITESPACE_RE.sub(r' ', asm) 287 # Expand the tabs used for indentation. 288 asm = string.expandtabs(asm, 2) 289 # Strip trailing whitespace. 290 asm = common.SCRUB_TRAILING_WHITESPACE_RE.sub(r'', asm) 291 return asm 292 293def scrub_asm_msp430(asm, args): 294 # Scrub runs of whitespace out of the assembly, but leave the leading 295 # whitespace in place. 296 asm = common.SCRUB_WHITESPACE_RE.sub(r' ', asm) 297 # Expand the tabs used for indentation. 298 asm = string.expandtabs(asm, 2) 299 # Strip trailing whitespace. 300 asm = common.SCRUB_TRAILING_WHITESPACE_RE.sub(r'', asm) 301 return asm 302 303def scrub_asm_avr(asm, args): 304 # Scrub runs of whitespace out of the assembly, but leave the leading 305 # whitespace in place. 306 asm = common.SCRUB_WHITESPACE_RE.sub(r' ', asm) 307 # Expand the tabs used for indentation. 308 asm = string.expandtabs(asm, 2) 309 # Strip trailing whitespace. 310 asm = common.SCRUB_TRAILING_WHITESPACE_RE.sub(r'', asm) 311 return asm 312 313def scrub_asm_riscv(asm, args): 314 # Scrub runs of whitespace out of the assembly, but leave the leading 315 # whitespace in place. 316 asm = common.SCRUB_WHITESPACE_RE.sub(r' ', asm) 317 # Expand the tabs used for indentation. 318 asm = string.expandtabs(asm, 2) 319 # Strip trailing whitespace. 320 asm = common.SCRUB_TRAILING_WHITESPACE_RE.sub(r'', asm) 321 return asm 322 323def scrub_asm_lanai(asm, args): 324 # Scrub runs of whitespace out of the assembly, but leave the leading 325 # whitespace in place. 326 asm = common.SCRUB_WHITESPACE_RE.sub(r' ', asm) 327 # Expand the tabs used for indentation. 328 asm = string.expandtabs(asm, 2) 329 # Strip trailing whitespace. 330 asm = common.SCRUB_TRAILING_WHITESPACE_RE.sub(r'', asm) 331 return asm 332 333def scrub_asm_sparc(asm, args): 334 # Scrub runs of whitespace out of the assembly, but leave the leading 335 # whitespace in place. 336 asm = common.SCRUB_WHITESPACE_RE.sub(r' ', asm) 337 # Expand the tabs used for indentation. 338 asm = string.expandtabs(asm, 2) 339 # Strip trailing whitespace. 340 asm = common.SCRUB_TRAILING_WHITESPACE_RE.sub(r'', asm) 341 return asm 342 343def scrub_asm_systemz(asm, args): 344 # Scrub runs of whitespace out of the assembly, but leave the leading 345 # whitespace in place. 346 asm = common.SCRUB_WHITESPACE_RE.sub(r' ', asm) 347 # Expand the tabs used for indentation. 348 asm = string.expandtabs(asm, 2) 349 # Strip trailing whitespace. 350 asm = common.SCRUB_TRAILING_WHITESPACE_RE.sub(r'', asm) 351 return asm 352 353def scrub_asm_wasm32(asm, args): 354 # Scrub runs of whitespace out of the assembly, but leave the leading 355 # whitespace in place. 356 asm = common.SCRUB_WHITESPACE_RE.sub(r' ', asm) 357 # Expand the tabs used for indentation. 358 asm = string.expandtabs(asm, 2) 359 # Strip trailing whitespace. 360 asm = common.SCRUB_TRAILING_WHITESPACE_RE.sub(r'', asm) 361 return asm 362 363def scrub_asm_ve(asm, args): 364 # Scrub runs of whitespace out of the assembly, but leave the leading 365 # whitespace in place. 366 asm = common.SCRUB_WHITESPACE_RE.sub(r' ', asm) 367 # Expand the tabs used for indentation. 368 asm = string.expandtabs(asm, 2) 369 # Strip trailing whitespace. 370 asm = common.SCRUB_TRAILING_WHITESPACE_RE.sub(r'', asm) 371 return asm 372 373def get_triple_from_march(march): 374 triples = { 375 'amdgcn': 'amdgcn', 376 'r600': 'r600', 377 'mips': 'mips', 378 'sparc': 'sparc', 379 'hexagon': 'hexagon', 380 've': 've', 381 } 382 for prefix, triple in triples.items(): 383 if march.startswith(prefix): 384 return triple 385 print("Cannot find a triple. Assume 'x86'", file=sys.stderr) 386 return 'x86' 387 388def get_run_handler(triple): 389 target_handlers = { 390 'i686': (scrub_asm_x86, ASM_FUNCTION_X86_RE), 391 'x86': (scrub_asm_x86, ASM_FUNCTION_X86_RE), 392 'i386': (scrub_asm_x86, ASM_FUNCTION_X86_RE), 393 'arm64_32-apple-ios': (scrub_asm_arm_eabi, ASM_FUNCTION_AARCH64_DARWIN_RE), 394 'aarch64': (scrub_asm_arm_eabi, ASM_FUNCTION_AARCH64_RE), 395 'aarch64-apple-darwin': (scrub_asm_arm_eabi, ASM_FUNCTION_AARCH64_DARWIN_RE), 396 'aarch64-apple-ios': (scrub_asm_arm_eabi, ASM_FUNCTION_AARCH64_DARWIN_RE), 397 'hexagon': (scrub_asm_hexagon, ASM_FUNCTION_HEXAGON_RE), 398 'r600': (scrub_asm_amdgpu, ASM_FUNCTION_AMDGPU_RE), 399 'amdgcn': (scrub_asm_amdgpu, ASM_FUNCTION_AMDGPU_RE), 400 'arm': (scrub_asm_arm_eabi, ASM_FUNCTION_ARM_RE), 401 'arm64': (scrub_asm_arm_eabi, ASM_FUNCTION_AARCH64_RE), 402 'arm64e': (scrub_asm_arm_eabi, ASM_FUNCTION_AARCH64_DARWIN_RE), 403 'arm64-apple-ios': (scrub_asm_arm_eabi, ASM_FUNCTION_AARCH64_DARWIN_RE), 404 'armv7-apple-ios' : (scrub_asm_arm_eabi, ASM_FUNCTION_ARM_IOS_RE), 405 'armv7-apple-darwin': (scrub_asm_arm_eabi, ASM_FUNCTION_ARM_DARWIN_RE), 406 'thumb': (scrub_asm_arm_eabi, ASM_FUNCTION_ARM_RE), 407 'thumb-macho': (scrub_asm_arm_eabi, ASM_FUNCTION_ARM_MACHO_RE), 408 'thumbv5-macho': (scrub_asm_arm_eabi, ASM_FUNCTION_ARM_MACHO_RE), 409 'thumbv7s-apple-darwin' : (scrub_asm_arm_eabi, ASM_FUNCTION_THUMBS_DARWIN_RE), 410 'thumbv7-apple-darwin' : (scrub_asm_arm_eabi, ASM_FUNCTION_THUMB_DARWIN_RE), 411 'thumbv7-apple-ios' : (scrub_asm_arm_eabi, ASM_FUNCTION_ARM_IOS_RE), 412 'm68k': (scrub_asm_m68k, ASM_FUNCTION_M68K_RE), 413 'mips': (scrub_asm_mips, ASM_FUNCTION_MIPS_RE), 414 'msp430': (scrub_asm_msp430, ASM_FUNCTION_MSP430_RE), 415 'avr': (scrub_asm_avr, ASM_FUNCTION_AVR_RE), 416 'ppc32': (scrub_asm_powerpc, ASM_FUNCTION_PPC_RE), 417 'powerpc': (scrub_asm_powerpc, ASM_FUNCTION_PPC_RE), 418 'riscv32': (scrub_asm_riscv, ASM_FUNCTION_RISCV_RE), 419 'riscv64': (scrub_asm_riscv, ASM_FUNCTION_RISCV_RE), 420 'lanai': (scrub_asm_lanai, ASM_FUNCTION_LANAI_RE), 421 'sparc': (scrub_asm_sparc, ASM_FUNCTION_SPARC_RE), 422 's390x': (scrub_asm_systemz, ASM_FUNCTION_SYSTEMZ_RE), 423 'wasm32': (scrub_asm_wasm32, ASM_FUNCTION_WASM32_RE), 424 've': (scrub_asm_ve, ASM_FUNCTION_VE_RE), 425 } 426 handler = None 427 best_prefix = '' 428 for prefix, s in target_handlers.items(): 429 if triple.startswith(prefix) and len(prefix) > len(best_prefix): 430 handler = s 431 best_prefix = prefix 432 433 if handler is None: 434 raise KeyError('Triple %r is not supported' % (triple)) 435 436 return handler 437 438##### Generator of assembly CHECK lines 439 440def add_asm_checks(output_lines, comment_marker, prefix_list, func_dict, func_name): 441 # Label format is based on ASM string. 442 check_label_format = '{} %s-LABEL: %s%s:'.format(comment_marker) 443 global_vars_seen_dict = {} 444 common.add_checks(output_lines, comment_marker, prefix_list, func_dict, func_name, check_label_format, True, False, global_vars_seen_dict) 445