# HG changeset patch # User Nobuyasu Oshiro # Date 1339674337 -32400 # Node ID a41427ab4d3bb8b27d355041073d2ab48ec000a5 # Parent bf3c780d3039b0fff87c0064d327e8cd860b0679 add src/ diff -r bf3c780d3039 -r a41427ab4d3b paper/src/rectype.cbc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/paper/src/rectype.cbc Thu Jun 14 20:45:37 2012 +0900 @@ -0,0 +1,22 @@ +#include +#include +__code print(__rectype *p) +{ + printf("print\n"); + exit(0); +} +__code csA(__rectype *p) +{ + goto p(csA); +} + +void main1() +{ + goto csA(print); +} + +int main() +{ + main1(); + return 0; +} diff -r bf3c780d3039 -r a41427ab4d3b paper/src/struct.cbc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/paper/src/struct.cbc Thu Jun 14 20:45:37 2012 +0900 @@ -0,0 +1,30 @@ +#include +#include +struct interface { + __code (*next)(struct interface); +}; + +__code print(struct interface p) +{ + printf("print\n"); + 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; +}