CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
77 lines
2.5 KiB
Python
Executable File
77 lines
2.5 KiB
Python
Executable File
#!/usr/bin/env python3
|
|
|
|
import os
|
|
import re
|
|
import sys
|
|
from concurrent.futures import ThreadPoolExecutor, as_completed
|
|
|
|
|
|
def remove_prefix(i, d=0):
|
|
if d == 100:
|
|
return 2
|
|
s = os.popen("llvm-lit -a " + i).read()
|
|
r = re.search("no check strings found with (?:prefix|prefixes) '([^:]+)", s)
|
|
with open(i, "r+") as f:
|
|
s = f.read()
|
|
if r:
|
|
p = r.group(1)
|
|
s = re.sub("=" + p + ",", "=", s)
|
|
s = re.sub("," + p + "([, \n])", "\\1", s)
|
|
s = re.sub("\s+-?-check-prefix=" + p + "([ \n])", "\\1", s)
|
|
else:
|
|
s = re.sub(
|
|
"-?-check-prefixes=([\w-]+)(\Z|[ \t\n])", "--check-prefix=\\1\\2", s
|
|
)
|
|
t = re.search(
|
|
"-?-check-(?:prefix|prefixes)=([^ ]+)\s+-?-check-(?:prefix|prefixes)=([^ ]+)",
|
|
s,
|
|
)
|
|
while t:
|
|
s = re.sub(
|
|
t.group(), "--check-prefixes=" + t.group(1) + "," + t.group(2), s
|
|
)
|
|
t = re.search(
|
|
"-?-check-(?:prefix|prefixes)=([^ ]+)\s+-?-check-(?:prefix|prefixes)=([^ ]+)",
|
|
s,
|
|
)
|
|
s = re.sub("\s+-?-check-prefix=CHECK[ \t]*\n", "\n", s)
|
|
f.truncate(0)
|
|
f.seek(0)
|
|
f.write(s)
|
|
if not r:
|
|
t = re.search("Assertions have been autogenerated by (.*)", s)
|
|
if t:
|
|
s = os.popen("llvm/" + t.group(1) + " " + i + " 2>&1").read()
|
|
if "had conflicting output from different RUN lines for all functions" in s:
|
|
return -1
|
|
s = os.popen("git diff " + i).read()
|
|
if re.search("\n(?:-+)\n", s) or re.search("\n[+-].*(?<!RUN):", s):
|
|
return 1
|
|
return 0
|
|
return remove_prefix(i, d + 1)
|
|
|
|
|
|
with ThreadPoolExecutor(max_workers=32) as e:
|
|
f = []
|
|
c = []
|
|
a = []
|
|
t = {e.submit(remove_prefix, i): i for i in sys.argv[1:]}
|
|
for i in as_completed(t):
|
|
if i.result() == 0:
|
|
print("DONE:", end=" ")
|
|
elif i.result() == -1:
|
|
print("FAIL:", end=" ")
|
|
f.append(t[i])
|
|
elif i.result() == 1:
|
|
print("CHANGE:", end=" ")
|
|
c.append(t[i])
|
|
else:
|
|
print("ABORT:", end=" ")
|
|
a.append(t[i])
|
|
print(t[i])
|
|
for i in [(f, "Failed"), (c, "Changed"), (a, "Aborted")]:
|
|
if i[0]:
|
|
print("********************\n%s Tests (%d):" % (i[1], len(i[0])))
|
|
for j in i[0]:
|
|
print(" " + j)
|