diff options
author | Michael Forney <mforney@mforney.org> | 2019-02-11 18:43:18 -0800 |
---|---|---|
committer | Michael Forney <mforney@mforney.org> | 2019-02-12 01:55:14 -0800 |
commit | eddc4693e49f70cd214b7645cb9fce54a89fbb6c (patch) | |
tree | fa1b640f49cde25e323aa0629aed64c064da930e /tests/for-loop.qbe |
Initial import
Diffstat (limited to 'tests/for-loop.qbe')
-rw-r--r-- | tests/for-loop.qbe | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/for-loop.qbe b/tests/for-loop.qbe new file mode 100644 index 0000000..56b38b1 --- /dev/null +++ b/tests/for-loop.qbe @@ -0,0 +1,21 @@ +export +function $f() { +@start.1 + %.1 =l alloc4 4 +@body.2 + storew 0, %.1 +@for_cond.3 + %.2 =w loadsw %.1 + %.3 =w csltw %.2, 10 + jnz %.3, @for_body.4, @for_join.6 +@for_body.4 + %.4 =w loadsw %.1 + call $g(w %.4) +@for_cont.5 + %.5 =w loadsw %.1 + %.6 =w add %.5, 1 + storew %.6, %.1 + jmp @for_cond.3 +@for_join.6 + ret +} |