Mercurial > hg > CbC > CbC_gcc
diff CbC-examples/rectypeTest/rectypeTest1.cbc @ 106:85047c4f1ca4
add CbC-examples/rectypeTest
author | Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Wed, 13 Jun 2012 17:18:58 +0900 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/CbC-examples/rectypeTest/rectypeTest1.cbc Wed Jun 13 17:18:58 2012 +0900 @@ -0,0 +1,24 @@ +#include <stdio.h> +#include <stdlib.h> + +__code print(__rectype *p, int num) { + printf("num = %d\n",num); + exit(0); +} + +//__code csA(__rectype *p, int num) { +__code csA(__code (*p)(void*,int), int num) {// goto p(csA,3,4); // error: too many arguments + goto p(2,3); // error : internal compiler error +// goto p(csA,3); + return; +} + +void funcA(__code (*p)()){ + goto p(print, 3); + return; +} + +int main() { + funcA(csA); + return 0; +}