aboutsummaryrefslogtreecommitdiff
path: root/test/for-loop.qbe
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2019-04-16 12:26:18 -0700
committerMichael Forney <mforney@mforney.org>2019-04-16 12:26:18 -0700
commitde004660726acb148bf0022706b7019ca560172d (patch)
treede95581449d1db324c074859615501cf8f0bc5c3 /test/for-loop.qbe
parent953e1e6f287d8bc00b2ef8d2197a20a549274eb3 (diff)
tests -> test
Diffstat (limited to 'test/for-loop.qbe')
-rw-r--r--test/for-loop.qbe21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/for-loop.qbe b/test/for-loop.qbe
new file mode 100644
index 0000000..56b38b1
--- /dev/null
+++ b/test/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
+}