summaryrefslogtreecommitdiff
path: root/examples/gfcc/abs.c
diff options
context:
space:
mode:
authoraarne <aarne@chalmers.se>2010-03-02 19:10:56 +0000
committeraarne <aarne@chalmers.se>2010-03-02 19:10:56 +0000
commite4748e998453b979af46983a079f2ec3d307ada4 (patch)
treeef1c2b278850a7f6a95959b6f18469645cf1094c /examples/gfcc/abs.c
parent21b10f91cbbd0a2d369dc55306bad53df1502cd7 (diff)
restored gfcc example (GF C compiler)
Diffstat (limited to 'examples/gfcc/abs.c')
-rw-r--r--examples/gfcc/abs.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/examples/gfcc/abs.c b/examples/gfcc/abs.c
new file mode 100644
index 000000000..947711c13
--- /dev/null
+++ b/examples/gfcc/abs.c
@@ -0,0 +1,20 @@
+int abs (int x){
+ int y ;
+ {
+ if (x < 0){
+ y = 0 - x ;
+ }
+ else {
+ y = x ;
+ }
+ }
+ return y ;
+ } ;
+int main () {
+ int i ;
+ i = abs (16);
+ printf ("%d",i) ;
+ return ;
+ } ;
+
+