ExtractIRForPassTest: use %dxopt on the RUN line (#6519)

Also, emit a better message when the desired pass does not exist (or is
mis-spelled). Before this change, there would only be a confusing
message about 'after' being None.
This commit is contained in:
David Neto 2024-05-10 10:09:12 -04:00 коммит произвёл GitHub
Родитель 35de5018ab
Коммит 8e9cefa1d5
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
1 изменённых файлов: 4 добавлений и 1 удалений

Просмотреть файл

@ -86,6 +86,9 @@ def SplitAtPass(passes, pass_name, invocation=1):
after = [line]
continue
before.append(line)
if after is None:
raise Exception(f"no such pass: {pass_name}")
return before, after
@ -143,7 +146,7 @@ def main(args):
# 6. Inserts RUN line with -hlsl-passes-resume and desired pass
with open(args.output_file, "wt") as f:
f.write(
"; RUN: %opt %s -hlsl-passes-resume -{} -S | FileCheck %s\n\n".format(
"; RUN: %dxopt %s -hlsl-passes-resume -{} -S | FileCheck %s\n\n".format(
args.desired_pass
)
)