annotate test/ret_check.c @ 928:96c53f76b360

fix
author kono
date Sun, 13 Apr 2014 10:21:40 +0900
parents c2c709727221
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
725
3f1f6c0610c1 goto with enviornment syntax changed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 622
diff changeset
1 #define __environment _CbC_environment
3f1f6c0610c1 goto with enviornment syntax changed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 622
diff changeset
2 #define __return _CbC_return
3f1f6c0610c1 goto with enviornment syntax changed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 622
diff changeset
3
599
df04bc5fd5fe *** empty log message ***
kono
parents:
diff changeset
4 extern int printf(char *,...);
df04bc5fd5fe *** empty log message ***
kono
parents:
diff changeset
5
df04bc5fd5fe *** empty log message ***
kono
parents:
diff changeset
6 #ifdef __micro_c__
df04bc5fd5fe *** empty log message ***
kono
parents:
diff changeset
7
725
3f1f6c0610c1 goto with enviornment syntax changed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 622
diff changeset
8 ____code(*f_incl_ret)(int,void *);
599
df04bc5fd5fe *** empty log message ***
kono
parents:
diff changeset
9 void *f_incl_env;
df04bc5fd5fe *** empty log message ***
kono
parents:
diff changeset
10
622
682c8ec38d45 _code へ
kono
parents: 599
diff changeset
11 __code
599
df04bc5fd5fe *** empty log message ***
kono
parents:
diff changeset
12 f_incl2(int a0)
df04bc5fd5fe *** empty log message ***
kono
parents:
diff changeset
13 { // 正しいのはコッチ
748
c2c709727221 i64 continue... basic.s assembled.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 725
diff changeset
14 printf("#0013:%d\n",a0);
725
3f1f6c0610c1 goto with enviornment syntax changed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 622
diff changeset
15 goto f_incl_ret(a0,f_incl_env);
599
df04bc5fd5fe *** empty log message ***
kono
parents:
diff changeset
16 }
df04bc5fd5fe *** empty log message ***
kono
parents:
diff changeset
17
622
682c8ec38d45 _code へ
kono
parents: 599
diff changeset
18 __code
599
df04bc5fd5fe *** empty log message ***
kono
parents:
diff changeset
19 f_incl2_test(float a0)
df04bc5fd5fe *** empty log message ***
kono
parents:
diff changeset
20 { // ret先のinterface型が異なる
748
c2c709727221 i64 continue... basic.s assembled.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 725
diff changeset
21 printf("#0020:%g\n",a0);
725
3f1f6c0610c1 goto with enviornment syntax changed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 622
diff changeset
22 goto f_incl_ret(a0,f_incl_env);
599
df04bc5fd5fe *** empty log message ***
kono
parents:
diff changeset
23 }
df04bc5fd5fe *** empty log message ***
kono
parents:
diff changeset
24
622
682c8ec38d45 _code へ
kono
parents: 599
diff changeset
25 __code
682c8ec38d45 _code へ
kono
parents: 599
diff changeset
26 f_incl1(int a0,__code(*ret)(int))
599
df04bc5fd5fe *** empty log message ***
kono
parents:
diff changeset
27 {
748
c2c709727221 i64 continue... basic.s assembled.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 725
diff changeset
28 printf("#0027:%d\n",a0);
599
df04bc5fd5fe *** empty log message ***
kono
parents:
diff changeset
29 goto ret(a0*a0);
df04bc5fd5fe *** empty log message ***
kono
parents:
diff changeset
30 }
df04bc5fd5fe *** empty log message ***
kono
parents:
diff changeset
31
df04bc5fd5fe *** empty log message ***
kono
parents:
diff changeset
32 int
df04bc5fd5fe *** empty log message ***
kono
parents:
diff changeset
33 f_incl0(int a0)
df04bc5fd5fe *** empty log message ***
kono
parents:
diff changeset
34 {
df04bc5fd5fe *** empty log message ***
kono
parents:
diff changeset
35 f_incl_ret=return;
df04bc5fd5fe *** empty log message ***
kono
parents:
diff changeset
36 f_incl_env=environment;
748
c2c709727221 i64 continue... basic.s assembled.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 725
diff changeset
37 printf("#0036:%d\n",a0);
599
df04bc5fd5fe *** empty log message ***
kono
parents:
diff changeset
38 goto f_incl1(a0,f_incl2);
df04bc5fd5fe *** empty log message ***
kono
parents:
diff changeset
39 }
df04bc5fd5fe *** empty log message ***
kono
parents:
diff changeset
40
df04bc5fd5fe *** empty log message ***
kono
parents:
diff changeset
41 int
df04bc5fd5fe *** empty log message ***
kono
parents:
diff changeset
42 f_incl0_test(int a0)
df04bc5fd5fe *** empty log message ***
kono
parents:
diff changeset
43 {
df04bc5fd5fe *** empty log message ***
kono
parents:
diff changeset
44 f_incl_ret=return;
df04bc5fd5fe *** empty log message ***
kono
parents:
diff changeset
45 f_incl_env=environment;
748
c2c709727221 i64 continue... basic.s assembled.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 725
diff changeset
46 printf("#0045:%d\n",a0);
599
df04bc5fd5fe *** empty log message ***
kono
parents:
diff changeset
47 goto f_incl1(a0,f_incl2_test);
df04bc5fd5fe *** empty log message ***
kono
parents:
diff changeset
48 }
df04bc5fd5fe *** empty log message ***
kono
parents:
diff changeset
49
df04bc5fd5fe *** empty log message ***
kono
parents:
diff changeset
50 #else
df04bc5fd5fe *** empty log message ***
kono
parents:
diff changeset
51
df04bc5fd5fe *** empty log message ***
kono
parents:
diff changeset
52 int
df04bc5fd5fe *** empty log message ***
kono
parents:
diff changeset
53 f_incl0(int a0)
df04bc5fd5fe *** empty log message ***
kono
parents:
diff changeset
54 {
748
c2c709727221 i64 continue... basic.s assembled.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 725
diff changeset
55 printf("#0054:%d\n",a0);
599
df04bc5fd5fe *** empty log message ***
kono
parents:
diff changeset
56 return a0;
df04bc5fd5fe *** empty log message ***
kono
parents:
diff changeset
57 }
df04bc5fd5fe *** empty log message ***
kono
parents:
diff changeset
58
df04bc5fd5fe *** empty log message ***
kono
parents:
diff changeset
59 int
df04bc5fd5fe *** empty log message ***
kono
parents:
diff changeset
60 f_incl0_test(int a0)
df04bc5fd5fe *** empty log message ***
kono
parents:
diff changeset
61 {
748
c2c709727221 i64 continue... basic.s assembled.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 725
diff changeset
62 printf("#0061:%d\n",a0);
599
df04bc5fd5fe *** empty log message ***
kono
parents:
diff changeset
63 return a0;
df04bc5fd5fe *** empty log message ***
kono
parents:
diff changeset
64 }
df04bc5fd5fe *** empty log message ***
kono
parents:
diff changeset
65
df04bc5fd5fe *** empty log message ***
kono
parents:
diff changeset
66 #endif
df04bc5fd5fe *** empty log message ***
kono
parents:
diff changeset
67
df04bc5fd5fe *** empty log message ***
kono
parents:
diff changeset
68 int
df04bc5fd5fe *** empty log message ***
kono
parents:
diff changeset
69 g_incl2(int a0)
df04bc5fd5fe *** empty log message ***
kono
parents:
diff changeset
70 {
748
c2c709727221 i64 continue... basic.s assembled.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 725
diff changeset
71 printf("#0070:%d\n",a0);
599
df04bc5fd5fe *** empty log message ***
kono
parents:
diff changeset
72 return a0;
df04bc5fd5fe *** empty log message ***
kono
parents:
diff changeset
73 }
df04bc5fd5fe *** empty log message ***
kono
parents:
diff changeset
74
df04bc5fd5fe *** empty log message ***
kono
parents:
diff changeset
75 int
df04bc5fd5fe *** empty log message ***
kono
parents:
diff changeset
76 g_incl2_test(float a0)
df04bc5fd5fe *** empty log message ***
kono
parents:
diff changeset
77 {
748
c2c709727221 i64 continue... basic.s assembled.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 725
diff changeset
78 printf("#0077:%g\n",a0);
599
df04bc5fd5fe *** empty log message ***
kono
parents:
diff changeset
79 return (int) a0;
df04bc5fd5fe *** empty log message ***
kono
parents:
diff changeset
80 }
df04bc5fd5fe *** empty log message ***
kono
parents:
diff changeset
81
df04bc5fd5fe *** empty log message ***
kono
parents:
diff changeset
82 int
df04bc5fd5fe *** empty log message ***
kono
parents:
diff changeset
83 g_incl1(int a0,int (*ret)(int))
df04bc5fd5fe *** empty log message ***
kono
parents:
diff changeset
84 {
df04bc5fd5fe *** empty log message ***
kono
parents:
diff changeset
85 return ret(a0);
df04bc5fd5fe *** empty log message ***
kono
parents:
diff changeset
86 }
df04bc5fd5fe *** empty log message ***
kono
parents:
diff changeset
87
df04bc5fd5fe *** empty log message ***
kono
parents:
diff changeset
88 int
df04bc5fd5fe *** empty log message ***
kono
parents:
diff changeset
89 main()
df04bc5fd5fe *** empty log message ***
kono
parents:
diff changeset
90 {
df04bc5fd5fe *** empty log message ***
kono
parents:
diff changeset
91 int f0=f_incl0(10);
748
c2c709727221 i64 continue... basic.s assembled.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 725
diff changeset
92 printf("#0091:%d\n",f0);
c2c709727221 i64 continue... basic.s assembled.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 725
diff changeset
93 printf("#0092:%d\n",f_incl0_test(11));
c2c709727221 i64 continue... basic.s assembled.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 725
diff changeset
94 printf("#0093:%d\n",g_incl1(12,g_incl2));
c2c709727221 i64 continue... basic.s assembled.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 725
diff changeset
95 printf("#0094:%d\n",g_incl1(13,g_incl2_test));
599
df04bc5fd5fe *** empty log message ***
kono
parents:
diff changeset
96 return 0;
df04bc5fd5fe *** empty log message ***
kono
parents:
diff changeset
97 }
df04bc5fd5fe *** empty log message ***
kono
parents:
diff changeset
98
df04bc5fd5fe *** empty log message ***
kono
parents:
diff changeset
99 /* end */