(text: str, pattern: str)
| 44 | 'gfx12_asm_wmma_w32.s'] |
| 45 | |
| 46 | def _parse_llvm_tests(text: str, pattern: str) -> list[tuple[str, bytes]]: |
| 47 | tests = [] |
| 48 | for block in text.split('\n\n'): |
| 49 | asm_text, encoding = None, None |
| 50 | for line in block.split('\n'): |
| 51 | line = line.strip() |
| 52 | if not line or line.startswith(('.', ';')): continue |
| 53 | if not line.startswith('//'): |
| 54 | asm_text = line.split('//')[0].strip() or asm_text |
| 55 | if m := re.search(pattern + r'[^:]*:.*?(?:encoding:\s*)?\[(0x[0-9a-f,x\s]+)\]', line, re.I): |
| 56 | encoding = m.group(1).replace('0x', '').replace(',', '').replace(' ', '') |
| 57 | if asm_text and encoding: |
| 58 | try: tests.append((asm_text, bytes.fromhex(encoding))) |
| 59 | except ValueError: pass |
| 60 | return tests |
| 61 | |
| 62 | def _get_tests_uncached(f: str, arch: str) -> list[tuple[str, bytes]]: |
| 63 | text = fetch(f"{LLVM_BASE}/{f}").read_bytes().decode('utf-8', errors='ignore') |
no test coverage detected
searching dependent graphs…