Skip to content
Snippets Groups Projects
Commit 24dcd829 authored by Andreas Klöckner's avatar Andreas Klöckner
Browse files

Add codegen test

parent adcac997
No related branches found
No related tags found
No related merge requests found
......@@ -234,6 +234,25 @@ def test_get_schedule_map():
sub_schedule.get_map()
def test_codegen():
# courtesy of Marek Pałkowski
def isl_ast_codegen(S):
b = isl.AstBuild.from_context(isl.Set("{:}"))
m = isl.Map.from_domain_and_range(S, S)
m = isl.Map.identity(m.get_space())
m = isl.Map.from_domain(S)
ast = b.ast_from_schedule(m)
p = isl.Printer.to_str(isl.DEFAULT_CONTEXT)
p = p.set_output_format(isl.format.C)
p.flush()
p = p.print_ast_node(ast)
return p.get_str()
s = isl.Set("[n,m] -> { [i,j] : 0 <= i <= n and i <= j <= m }")
print(isl_ast_codegen(s))
if __name__ == "__main__":
import sys
if len(sys.argv) > 1:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment