459
|
1 const int a = 5,b = -3;
|
|
2 int kkkk = 333;
|
|
3 static const int as = 5,bs = -3;
|
|
4 const char hoo[] = "test";
|
|
5 static const char haa[] = "test";
|
|
6 static inline const int f(int k);
|
|
7
|
460
|
8 volatile const int i = 3;
|
|
9
|
|
10 extern int printf(char *,...);
|
|
11 int
|
|
12 main0()
|
|
13 {
|
|
14 volatile const int j = 3;
|
|
15 switch(i) {
|
|
16 case 1: printf("#0015:1\n"); break;
|
|
17 case 2: printf("#0016:2\n"); break;
|
|
18 case 3: printf("#0017:3\n"); break;
|
|
19 case 4: printf("#0018:4\n"); break;
|
|
20 }
|
|
21 switch(j) {
|
|
22 case 1: printf("#0021:1\n"); break;
|
|
23 case 2: printf("#0022:2\n"); break;
|
|
24 case 3: printf("#0023:3\n"); break;
|
|
25 case 4: printf("#0024:4\n"); break;
|
|
26 }
|
|
27 return 0;
|
|
28 }
|
|
29
|
|
30
|
459
|
31 extern int printf(char *,...);
|
|
32
|
|
33 static inline const int f(int k)
|
|
34 {
|
|
35 return k+1;
|
|
36 }
|
|
37
|
|
38 inline int in1(int i,int j)
|
|
39 {
|
|
40 if (i>j) return j;
|
|
41 else return i;
|
|
42 }
|
|
43
|
|
44 static
|
|
45 inline int ins(int i,int j)
|
|
46 {
|
460
|
47 printf("#0046:%d %d\n",i,j);
|
459
|
48 if (f(i)>j) return j;
|
|
49 else return i;
|
|
50 }
|
|
51
|
|
52 static
|
|
53 inline int ins1(int i,int j)
|
|
54 {
|
460
|
55 printf("#0054:%d %d\n",i,j);
|
459
|
56 if (f(i)>j) return j;
|
|
57 else return i;
|
|
58 }
|
|
59
|
460
|
60 inline __attribute__((always_inline)) int in2(int p,int i,int j)
|
459
|
61 {
|
|
62 int k = 0,m;
|
|
63 do {
|
|
64 k += 3;
|
|
65 } while ( k < j);
|
460
|
66 printf("#0065: %d do %d\n",p,k);
|
459
|
67
|
|
68 while (k < j) {
|
|
69 k -= 3;
|
|
70 } while ( k < j);
|
460
|
71 printf("#0070: %d while %d\n",p,k);
|
459
|
72
|
|
73 m = 0;
|
|
74 for(k=0;k<j;k++) {
|
|
75 m += k;
|
|
76 }
|
460
|
77 printf("#0076: %d for %d\n",p,m);
|
459
|
78
|
|
79 switch(i) {
|
|
80 case 1: k = 1;
|
|
81 break;
|
|
82 case 2: k = 2;
|
|
83 break;
|
|
84 case 3: k = 3;
|
|
85 break;
|
|
86 case 4: k = 4;
|
|
87 break;
|
|
88 default: k = 5;
|
|
89 }
|
460
|
90 printf("#0089: %d switch %d\n",p,k);
|
459
|
91
|
|
92 for(k=0;k<j;k++) {
|
|
93 i += k;
|
|
94 if (k<3) continue;
|
|
95 }
|
460
|
96 printf("#0095: %d for %d\n",p,i);
|
459
|
97 goto hoge;
|
|
98 hage:
|
|
99 goto hage;
|
|
100 hoge:
|
|
101 return 0;
|
|
102
|
|
103 }
|
|
104
|
|
105 int (*fnp)(int i,int j);
|
|
106
|
|
107 int (*fnp3)(int i,int j,int k);
|
|
108
|
|
109 void
|
|
110 a0(int k,int j)
|
|
111 {
|
|
112 int k1,j1;
|
|
113 const int v=3,x=6;
|
|
114 // a = 10;
|
|
115
|
|
116 k1 = in1(a,b);
|
460
|
117 printf("#0116:%d %d %d\n",a,b,k1);
|
459
|
118 j1 = in1(k,j-6)+f(k1);
|
460
|
119 printf("#0118:%d %d %s\n",k1,j1,hoo);
|
459
|
120 k1 = &v-&x>0? &v-&x : &x-&v;
|
460
|
121 printf("#0120:v-x: %d\n",k1);
|
459
|
122
|
|
123 k1 = ins(a,b);
|
|
124 j1 = ins(k,j-6)+f(k1);
|
460
|
125 printf("#0124:%d %d %s\n",k1,j1,haa);
|
459
|
126
|
|
127 k1 = ins(as,bs);
|
|
128 j1 = ins(k,j-6)+f(k1);
|
460
|
129 printf("#0128:%d %d %s\n",k1,j1,haa);
|
459
|
130
|
|
131 k1 = ins(v,x);
|
|
132 j1 = ins(k,j-6)+f(v);
|
460
|
133 printf("#0132:%d %d %s\n",k1,j1,haa);
|
459
|
134
|
|
135 k1 = fnp(v,x);
|
|
136 j1 = ins1(k,j-6)+f(v);
|
460
|
137 printf("#0136:%d %d %s\n",k1,j1,haa);
|
459
|
138 }
|
|
139
|
|
140 void
|
|
141 a1(int k,int j)
|
|
142 {
|
|
143 in2(1,k,j);
|
|
144 in2(2,3,10);
|
|
145 in2(3,k,10);
|
|
146 in2(4,2,j);
|
|
147 in2(5,2,1);
|
|
148 in2(6,0,2);
|
460
|
149 in2(8,j*3,in2(7,k+3,10-j));
|
|
150 fnp3(9,0,2);
|
459
|
151 }
|
|
152
|
|
153 int
|
460
|
154 main(int ac,char *av[])
|
459
|
155 {
|
|
156 fnp = ins1;
|
|
157 a0(5,6);
|
|
158 a0(-9,6);
|
|
159 fnp3 = in2;
|
|
160 a1(9,10);
|
460
|
161 main0(ac,av);
|
459
|
162 return 0;
|
|
163 }
|
|
164
|