aboutsummaryrefslogtreecommitdiff
path: root/test/while-condition.qbe
diff options
context:
space:
mode:
Diffstat (limited to 'test/while-condition.qbe')
-rw-r--r--test/while-condition.qbe23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/while-condition.qbe b/test/while-condition.qbe
new file mode 100644
index 0000000..23b3b15
--- /dev/null
+++ b/test/while-condition.qbe
@@ -0,0 +1,23 @@
+export
+function w $main() {
+@start.1
+ %.1 =l alloc8 8
+@body.2
+ %.2 =l add %.1, 0
+ %.3 =d swtof 1
+ stored %.3, %.2
+@while_cond.3
+ %.4 =d loadd %.1
+ %.5 =w cned %.4, d_0
+ jnz %.5, @while_body.4, @while_join.5
+@while_body.4
+ %.6 =d loadd %.1
+ %.7 =d swtof 2
+ %.8 =d div %.6, %.7
+ stored %.8, %.1
+ jmp @while_cond.3
+@while_join.5
+ %.9 =d loadd %.1
+ %.10 =w dtosi %.9
+ ret %.10
+}