If a test does not contain an " simd" but -fopenmp-simd RUN lines we can
just check that we do not create kmpc|tgt calls.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
Make the script remove leftover CHECK: lines that would now trigger given
the absence of a specific check prefix for the -fopenmp-simd invocations.
Comment Actions
I can't see a change to a script in this diff. Should there be one? Looks like the test change was done programmatically
Comment Actions
It was, but I did not expect to need the script in the future.
If you really want to see how bad my python skills are, here you go ;)
import os,re
path = "clang/test/OpenMP/"
for f in os.listdir(path):
if not os.path.isfile(path+f):
continue
fd = open(path + f, "r")
content = fd.read()
fd.close()
if "_cc_test_check" not in content:
continue
if " simd" in content or " SIMD" in content:
continue
if "-fopenmp-simd" not in content:
continue
changed = False
lines = content.splitlines()
newlines = []
matches = ['// CHECK:', '// CHECK-', '//CHECK:', '//CHECK-']
empty = 0
for i in range(len(lines)):
line = lines[i]
match = False
for m in matches:
if m in line:
match = True
break
if match:
continue
if line == "//":
empty += 1
if empty > 2:
continue
else:
empty = 0
if "-fopenmp-simd" not in line:
newlines.append(line)
continue
if "FileCheck" not in line:
newlines.append(line)
continue
m = re.search(r"=((SIMD|CHECK)[^\s]*)", line)
if not m:
newlines.append(line)
continue
print(m.group(1))
matches.append(m.group(1))
idx = line.index("FileCheck")
line = line[:idx]
line += 'FileCheck %s --implicit-check-not="{{__kmpc|__tgt}}"'
newlines.append(line)
changed = True
if changed:
fd = open(path + f, "w")
fd.write('\n'.join(newlines))
fd.close()