summaryrefslogtreecommitdiff
path: root/examples/gfcc/compiler/fibonacci.c
diff options
context:
space:
mode:
authoraarne <unknown>2004-09-25 08:24:11 +0000
committeraarne <unknown>2004-09-25 08:24:11 +0000
commit5a208ce3ea26726d15e814c0498680597cca45fa (patch)
tree89ca12f9b6f9fe16cf4bcd6d165e13f3021ce619 /examples/gfcc/compiler/fibonacci.c
parentff2a2895c08b667894b565c8d39f0bf63d85492a (diff)
compiler works on abs and fibonacci
Diffstat (limited to 'examples/gfcc/compiler/fibonacci.c')
-rw-r--r--examples/gfcc/compiler/fibonacci.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/examples/gfcc/compiler/fibonacci.c b/examples/gfcc/compiler/fibonacci.c
new file mode 100644
index 000000000..c5a791bdf
--- /dev/null
+++ b/examples/gfcc/compiler/fibonacci.c
@@ -0,0 +1,18 @@
+int mx () {
+ return 5000000 ;
+} ;
+
+int main () {
+ int lo ; int hi ;
+ lo = 1 ;
+ hi = lo ;
+ printf(int,lo) ;
+ {
+ while (hi < mx()) {
+ printf(int,hi) ;
+ hi = lo + hi ;
+ lo = hi - lo ;
+ }
+ }
+ return ;
+} ;