X-Git-Url: http://git.joshuawise.com/firearm.git/blobdiff_plain/0bd4b39b04997ee55e3b3e7cadd42c95d8a56fa1..392d1bec43dcfb806fbdf77380c334f2cdc84778:/tests/corecurse.c diff --git a/tests/corecurse.c b/tests/corecurse.c new file mode 100644 index 0000000..33576fe --- /dev/null +++ b/tests/corecurse.c @@ -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