Skip to content

Commit

Permalink
Add pass_llvm option to verify LLVM output after application of a pass
Browse files Browse the repository at this point in the history
  • Loading branch information
czgdp1807 committed Jul 1, 2022
1 parent 823ddda commit 6ce2a24
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ def main():
x86 = test.get("x86", False)
bin_ = test.get("bin", False)
pass_ = test.get("pass", None)
pass_with_llvm = test.get("pass_with_llvm", None)
if pass_ and pass_ not in ["do_loops", "global_stmts",
"loop_vectorise", "inline_function_calls"]:
raise Exception("Unknown pass: %s" % pass_)
Expand All @@ -78,7 +79,7 @@ def main():
cmd = "lpython --pass=" + pass_ + " --show-asr --no-color {infile} -o {outfile}"
run_test("pass_{}".format(pass_), cmd,
filename, update_reference, extra_args)
if llvm:
if pass_with_llvm:
cmd = "lpython --pass=" + pass_ + " --show-llvm --no-color {infile} -o {outfile}"
run_test("pass_llvm_{}".format(pass_), cmd,
filename, update_reference, extra_args)
Expand Down
1 change: 1 addition & 0 deletions tests/tests.toml
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ pass = "loop_vectorise"
filename = "../integration_tests/func_inline_01.py"
asr = true
llvm = true
pass_with_llvm = true
pass = "inline_function_calls"

[[test]]
Expand Down

0 comments on commit 6ce2a24

Please sign in to comment.