about summary refs log tree commit diff stats
path: root/apps/factorial.mu
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2020-02-18 16:05:13 -0800
committerKartik Agaram <vc@akkartik.com>2020-02-18 16:05:13 -0800
commit7c2ac5dcaa9ffab09ebbf90e7c0ce937a2aa591b (patch)
treedeaa450f10729394381b5223ea8e9a9bb9c993ba /apps/factorial.mu
parent8d79145eaa1aa18b5680c0927a372f262c610d17 (diff)
downloadmu-7c2ac5dcaa9ffab09ebbf90e7c0ce937a2aa591b.tar.gz
6026
Diffstat (limited to 'apps/factorial.mu')
-rw-r--r--apps/factorial.mu14
1 files changed, 7 insertions, 7 deletions
diff --git a/apps/factorial.mu b/apps/factorial.mu
index 164a7d45..6117d153 100644
--- a/apps/factorial.mu
+++ b/apps/factorial.mu
@@ -7,18 +7,18 @@ fn main args: (addr array kernel-string) -> exit-status/ebx: int {
   var tmp/ecx: int <- length a
   $main-body: {
     compare tmp, 1
-    # if (len(args) != 1) run-tests()
-    {
-      break-if-=
-      run-tests
-      exit-status <- copy 0
-      break $main-body
-    }
     # if (len(args) == 1) factorial(5)
     {
       break-if-!=
       var tmp/eax: int <- factorial 5
       exit-status <- copy tmp
+      break $main-body
+    }
+    # if (len(args) != 1) run-tests()
+    {
+      break-if-=
+      run-tests
+      exit-status <- copy 0
     }
   }
 }