view CbC-examples/rectypeTest/rectypeTest1.cbc @ 108:7ad14f446135

add CbC-example/rectypeTest/
author Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
date Thu, 14 Jun 2012 20:30:24 +0900
parents 85047c4f1ca4
children
line wrap: on
line source

#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;
}