summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2012-06-06 02:10:06 -0400
committerOri Bernstein <ori@eigenstate.org>2012-06-06 02:10:06 -0400
commit6043574976f7135190d98a100db3519a65850d55 (patch)
tree32638a41abc2ebae4fca860cfc3561ea2a1451e2
parent5beec1cadbf562073ea57e65337cca33b36a4627 (diff)
downloadmc-6043574976f7135190d98a100db3519a65850d55.tar.gz
Make the fibonacci function work.
Use the right comparison operators for testing stuff.
-rw-r--r--8/isel.c4
-rw-r--r--test/fib.myr2
-rwxr-xr-xtest/test.sh2
3 files changed, 4 insertions, 4 deletions
diff --git a/8/isel.c b/8/isel.c
index 8d6a727..33730ab 100644
--- a/8/isel.c
+++ b/8/isel.c
@@ -80,8 +80,8 @@ struct {
AsmOp getflag;
} reloptab[Numops] = {
[Olnot] = {Itest, Ijz, Isetz},
- [Oeq] = {Itest, Ijnz, Isetnz},
- [One] = {Itest, Ijz, Isetz},
+ [Oeq] = {Icmp, Ijz, Isetz},
+ [One] = {Icmp, Ijnz, Isetnz},
[Ogt] = {Icmp, Ijg, Isetgt},
[Oge] = {Icmp, Ijge, Isetge},
[Olt] = {Icmp, Ijl, Isetlt},
diff --git a/test/fib.myr b/test/fib.myr
index f744a27..935dc4a 100644
--- a/test/fib.myr
+++ b/test/fib.myr
@@ -9,6 +9,6 @@ const fib = {n
}
const main = {
- -> fib(2)
+ -> fib(8)
}
diff --git a/test/test.sh b/test/test.sh
index 6d0f61d..890cca8 100755
--- a/test/test.sh
+++ b/test/test.sh
@@ -25,4 +25,4 @@ returns struct 42
returns array 7
returns call 42
returns loop 45
-returns fib 8
+returns fib 21