diff 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
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/CbC-examples/rectypeTest/instruct.cbc	Wed Jun 13 17:18:58 2012 +0900
@@ -0,0 +1,26 @@
+#include <stdlib.h>
+
+struct interface {
+	__rectype *next;
+};
+
+
+__code print(struct interface p) {
+	puts("print");
+	exit(0);
+}
+
+__code csA(struct interface p) {
+	struct interface ds = { csA };
+	goto p.next(ds);
+}
+
+void main1() {
+	struct interface ds = { print };
+	goto csA(ds);
+}
+
+int main() {
+	main1();
+	return 0;
+}