Mercurial > hg > CbC > CbC_gcc
diff CbC-examples/test_tree.c @ 16:4c6926a2b9bc
examples.
author | kent <kent@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Thu, 24 Sep 2009 12:51:25 +0900 |
parents | |
children | 5d30d517ebed |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/CbC-examples/test_tree.c Thu Sep 24 12:51:25 2009 +0900 @@ -0,0 +1,54 @@ +//#include<stdio.h> +double test(char, char, int, double); +__code cs(int , double , char ); +void testvoid(double a); +int testint(double a); + +__code cs(int a, double b, char c){ + printf("__code cs was called.\n"); + printf("a = %d, b = %lf, c = %d\n", a, b, c); + exit(0); +} +__code cs1(int a, double b, char c, int d){ + printf("__code cs1 was called.\n"); + printf("a = %d, b = %lf, c = %d, d = %d\n", a, b, c, d); + exit(0); +} + +int main(int argc, char **argv){ + double t; + //goto cs(2, 10.2, 2); + + t = test('a', 'b', 10, 2.5); + printf("t = %lf\n", t); + testvoid(2.22); + testint(2.22); + + printf("test_goto\n"); + goto test_goto1(10, 20, 30.3); + return 0; +} +void test0(){ + exit(0); +} + +void testvoid(double a){ + return ; +} +int testint(double a){ + int b; + b = (a*100-a) +2; + return 1; +} + +double test(char c, char l, int a, double d){ + return (double)a*d+c+l; +} + +void test_goto(int a, int b, double c){ + goto cs(2, 10.2, 3); +} +__code test_goto1(int a, int b, double c){ + goto cs1(2, 10.2, 3, 4); +} +