Mercurial > hg > CbC > CbC_gcc
comparison CbC-examples/rectypeTest/instruct.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 | a3a2f64cf8f4 |
comparison
equal
deleted
inserted
replaced
105:b3cfc7733d3f | 106:85047c4f1ca4 |
---|---|
1 #include <stdlib.h> | |
2 | |
3 struct interface { | |
4 __rectype *next; | |
5 }; | |
6 | |
7 | |
8 __code print(struct interface p) { | |
9 puts("print"); | |
10 exit(0); | |
11 } | |
12 | |
13 __code csA(struct interface p) { | |
14 struct interface ds = { csA }; | |
15 goto p.next(ds); | |
16 } | |
17 | |
18 void main1() { | |
19 struct interface ds = { print }; | |
20 goto csA(ds); | |
21 } | |
22 | |
23 int main() { | |
24 main1(); | |
25 return 0; | |
26 } |