From 5a208ce3ea26726d15e814c0498680597cca45fa Mon Sep 17 00:00:00 2001 From: aarne Date: Sat, 25 Sep 2004 08:24:11 +0000 Subject: compiler works on abs and fibonacci --- examples/gfcc/compiler/abs.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'examples/gfcc/compiler/abs.c') 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 ; } ; -- cgit v1.2.3