summaryrefslogtreecommitdiff
path: root/examples/gfcc/compiler/abs.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/abs.c
parentff2a2895c08b667894b565c8d39f0bf63d85492a (diff)
compiler works on abs and fibonacci
Diffstat (limited to 'examples/gfcc/compiler/abs.c')
-rw-r--r--examples/gfcc/compiler/abs.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/examples/gfcc/compiler/abs.c b/examples/gfcc/compiler/abs.c
index c93b703b6..90312a2de 100644
--- a/examples/gfcc/compiler/abs.c
+++ b/examples/gfcc/compiler/abs.c
@@ -1,12 +1,20 @@
int abs (int x){
+ int y ;
+ {
if (x < 0){
- return 0 - x ;
+ y = 0 - x ;
}
- else return x ;
+ else {
+ y = x ;
+ }
+ }
+ return y ;
} ;
int main () {
int i ;
i = abs (16);
+ printf (int,i) ;
+ return ;
} ;