view CbC-examples/rectypeTest/instruct.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 a3a2f64cf8f4
children
line wrap: on
line source

#include <stdlib.h>

// miss
struct interface {
  __rectype *next;
};

__code print(struct interface p) {
  puts("print");
  exit(0);
}

__code csA(struct interface p) {
  struct interface ds;
  ds.next = csA;
  goto p.next(ds);
}

void main1() {
  struct interface ds;
  ds.next = print;
  goto csA(ds);
}

int main() {
  main1();
  return 0;
}