]> Joshua Wise's Git repositories - firearm.git/blobdiff - tests/corecurse.c
tests: Add the new testbench.
[firearm.git] / tests / corecurse.c
diff --git a/tests/corecurse.c b/tests/corecurse.c
new file mode 100644 (file)
index 0000000..33576fe
--- /dev/null
@@ -0,0 +1,25 @@
+int b(int x);
+int a(int x);
+
+int a(int x)
+{
+       if (x)
+               return b(x/2) + a(x - 1);
+       return 1;
+}
+
+int b(int x)
+{
+       if (x)
+               return a(x) + a(x - 1);
+       return 0;
+}
+
+int corecurse()
+{
+       int v = a(35) + b(32) - 4450/28;
+       if (v == 15411)
+               puts("PASS\n");
+       else
+               puts("FAIL\n");
+}
\ No newline at end of file
This page took 0.024979 seconds and 4 git commands to generate.