Skip to content

Commit

Permalink
Add an option: llvm_dbg (in run_tests) to generate llvm-ir with deb…
Browse files Browse the repository at this point in the history
…ug info
  • Loading branch information
Thirumalai-Shaktivel committed Oct 29, 2022
1 parent 7a516c8 commit f6cd93d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
17 changes: 13 additions & 4 deletions run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ def is_included(backend):
ast_new = is_included("ast_new")
asr = is_included("asr")
llvm = is_included("llvm")
llvm_dbg = is_included("llvm_dbg")
cpp = is_included("cpp")
c = is_included("c")
wat = is_included("wat")
Expand Down Expand Up @@ -80,17 +81,25 @@ def is_included(backend):
run_test(filename, "pass_{}".format(pass_), cmd,
filename, update_reference, extra_args)

if llvm:
if no_llvm:
log.info(f"{filename} * llvm SKIPPED as requested")
else:
if no_llvm:
log.info(f"{filename} * llvm SKIPPED as requested")
else:
if llvm:
run_test(
filename,
"llvm",
"lpython --no-color --show-llvm {infile} -o {outfile}",
filename,
update_reference,
extra_args)
if llvm_dbg:
run_test(
filename,
"llvm_dbg",
"lpython --no-color --show-llvm -g {infile} -o {outfile}",
filename,
update_reference,
extra_args)

if cpp:
run_test(filename, "cpp", "lpython --no-color --show-cpp {infile}",
Expand Down
1 change: 1 addition & 0 deletions tests/tests.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# ast_new ... run the New Parser and output AST, compare against reference version
# asr ... run the Semantics and output ASR, compare against reference version
# llvm ... run the Semantics and output LLVM, compare against reference version
# llvm_dbg ... run the Semantics and output LLVM with debug information
# tokens ... output Tokens, compare against reference version
# run ... compiles and executes the specified file;
# checks both runtime errors and successful runs
Expand Down

0 comments on commit f6cd93d

Please sign in to comment.