599
|
1 extern int printf(char *,...);
|
|
2
|
|
3 #ifdef __micro_c__
|
|
4
|
622
|
5 ____code(*f_incl_ret)(int);
|
599
|
6 void *f_incl_env;
|
|
7
|
622
|
8 __code
|
599
|
9 f_incl2(int a0)
|
|
10 { // 正しいのはコッチ
|
|
11 printf("#0010:%d\n",a0);
|
|
12 goto f_incl_ret(a0),f_incl_env;
|
|
13 }
|
|
14
|
622
|
15 __code
|
599
|
16 f_incl2_test(float a0)
|
|
17 { // ret先のinterface型が異なる
|
|
18 printf("#0017:%g\n",a0);
|
|
19 goto f_incl_ret(a0),f_incl_env;
|
|
20 }
|
|
21
|
622
|
22 __code
|
|
23 f_incl1(int a0,__code(*ret)(int))
|
599
|
24 {
|
|
25 printf("#0024:%d\n",a0);
|
|
26 goto ret(a0*a0);
|
|
27 }
|
|
28
|
|
29 int
|
|
30 f_incl0(int a0)
|
|
31 {
|
|
32 f_incl_ret=return;
|
|
33 f_incl_env=environment;
|
|
34 printf("#0033:%d\n",a0);
|
|
35 goto f_incl1(a0,f_incl2);
|
|
36 }
|
|
37
|
|
38 int
|
|
39 f_incl0_test(int a0)
|
|
40 {
|
|
41 f_incl_ret=return;
|
|
42 f_incl_env=environment;
|
|
43 printf("#0033:%d\n",a0);
|
|
44 goto f_incl1(a0,f_incl2_test);
|
|
45 }
|
|
46
|
|
47 #else
|
|
48
|
|
49 int
|
|
50 f_incl0(int a0)
|
|
51 {
|
|
52 printf("#0042:%d\n",a0);
|
|
53 return a0;
|
|
54 }
|
|
55
|
|
56 int
|
|
57 f_incl0_test(int a0)
|
|
58 {
|
|
59 printf("#0042:%d\n",a0);
|
|
60 return a0;
|
|
61 }
|
|
62
|
|
63 #endif
|
|
64
|
|
65 int
|
|
66 g_incl2(int a0)
|
|
67 {
|
|
68 printf("#0051:%d\n",a0);
|
|
69 return a0;
|
|
70 }
|
|
71
|
|
72 int
|
|
73 g_incl2_test(float a0)
|
|
74 {
|
|
75 printf("#0058:%g\n",a0);
|
|
76 return (int) a0;
|
|
77 }
|
|
78
|
|
79 int
|
|
80 g_incl1(int a0,int (*ret)(int))
|
|
81 {
|
|
82 return ret(a0);
|
|
83 }
|
|
84
|
|
85 int
|
|
86 main()
|
|
87 {
|
|
88 int f0=f_incl0(10);
|
|
89 printf("#0066:%d\n",f0);
|
|
90 printf("#0066:%d\n",f_incl0_test(11));
|
|
91 printf("#0067:%d\n",g_incl1(12,g_incl2));
|
|
92 printf("#0068:%d\n",g_incl1(13,g_incl2_test));
|
|
93 return 0;
|
|
94 }
|
|
95
|
|
96 /* end */
|