annotate test/ret_check.c @ 684:6e2f1e7f9fc3

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