annotate test/short.c @ 483:77cab9687d3f

*** empty log message ***
author kono
date Sun, 11 Dec 2005 23:53:27 +0900
parents 32737bad7489
children a379da780856
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
467
32737bad7489 fix list/tag interference
kono
parents: 427
diff changeset
1 int printf(const char *format, ...);
170
6e0f67b7d200 test files
kono
parents:
diff changeset
2
6e0f67b7d200 test files
kono
parents:
diff changeset
3 short gj;
6e0f67b7d200 test files
kono
parents:
diff changeset
4 short gi;
6e0f67b7d200 test files
kono
parents:
diff changeset
5
6e0f67b7d200 test files
kono
parents:
diff changeset
6 short a[100];
6e0f67b7d200 test files
kono
parents:
diff changeset
7 unsigned short b[100];
6e0f67b7d200 test files
kono
parents:
diff changeset
8 unsigned char c[100];
6e0f67b7d200 test files
kono
parents:
diff changeset
9
278
5b50813d0c45 MIPS 90% test passed. Self compile core dumped.
kono
parents: 172
diff changeset
10 short data[] = {10,20,-40,-50};
5b50813d0c45 MIPS 90% test passed. Self compile core dumped.
kono
parents: 172
diff changeset
11 unsigned short udata[] = {10,20,-40,-50};
170
6e0f67b7d200 test files
kono
parents:
diff changeset
12
6e0f67b7d200 test files
kono
parents:
diff changeset
13 short f(short i,unsigned short j,unsigned short k,short m,short a);
6e0f67b7d200 test files
kono
parents:
diff changeset
14 unsigned
6e0f67b7d200 test files
kono
parents:
diff changeset
15 short g(short i,unsigned short j,unsigned short k,short m,short a);
6e0f67b7d200 test files
kono
parents:
diff changeset
16
6e0f67b7d200 test files
kono
parents:
diff changeset
17 main()
6e0f67b7d200 test files
kono
parents:
diff changeset
18 {
6e0f67b7d200 test files
kono
parents:
diff changeset
19 int ii;
6e0f67b7d200 test files
kono
parents:
diff changeset
20 short i,k,*p;
6e0f67b7d200 test files
kono
parents:
diff changeset
21 unsigned short j,m,*up;
6e0f67b7d200 test files
kono
parents:
diff changeset
22 unsigned char g0,h0;
6e0f67b7d200 test files
kono
parents:
diff changeset
23 char g1,h1;
6e0f67b7d200 test files
kono
parents:
diff changeset
24 unsigned short sg0,sh0;
6e0f67b7d200 test files
kono
parents:
diff changeset
25 short sg1,sh1;
6e0f67b7d200 test files
kono
parents:
diff changeset
26 unsigned char *pg0,*ph0;
6e0f67b7d200 test files
kono
parents:
diff changeset
27 char *pg1,*ph1;
6e0f67b7d200 test files
kono
parents:
diff changeset
28 unsigned short *psg0,*psh0;
6e0f67b7d200 test files
kono
parents:
diff changeset
29 short *psg1,*psh1;
6e0f67b7d200 test files
kono
parents:
diff changeset
30
6e0f67b7d200 test files
kono
parents:
diff changeset
31
6e0f67b7d200 test files
kono
parents:
diff changeset
32 i = -3;
6e0f67b7d200 test files
kono
parents:
diff changeset
33 j = 3;
6e0f67b7d200 test files
kono
parents:
diff changeset
34 k = 44;
6e0f67b7d200 test files
kono
parents:
diff changeset
35 k = i*j+3+k;
6e0f67b7d200 test files
kono
parents:
diff changeset
36 m = i*j-7+k;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 278
diff changeset
37 printf("#0035:%d %d %d\n",i,k,m);
170
6e0f67b7d200 test files
kono
parents:
diff changeset
38
6e0f67b7d200 test files
kono
parents:
diff changeset
39 g0 = 123;
6e0f67b7d200 test files
kono
parents:
diff changeset
40 g0++; --g0;
6e0f67b7d200 test files
kono
parents:
diff changeset
41 ++g0; g0--;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 278
diff changeset
42 printf("#0040:g0=%d\n",g0);
170
6e0f67b7d200 test files
kono
parents:
diff changeset
43 g1 = -123;
6e0f67b7d200 test files
kono
parents:
diff changeset
44 g1++; --g1;
6e0f67b7d200 test files
kono
parents:
diff changeset
45 ++g1; g1--;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 278
diff changeset
46 printf("#0044:g1=%d\n",g1);
170
6e0f67b7d200 test files
kono
parents:
diff changeset
47
6e0f67b7d200 test files
kono
parents:
diff changeset
48 sg0 = 123;
6e0f67b7d200 test files
kono
parents:
diff changeset
49 sg0++; --sg0;
6e0f67b7d200 test files
kono
parents:
diff changeset
50 ++sg0; sg0--;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 278
diff changeset
51 printf("#0049:sg0=%d\n",sg0);
170
6e0f67b7d200 test files
kono
parents:
diff changeset
52 sg1 = -123;
6e0f67b7d200 test files
kono
parents:
diff changeset
53 sg1++; --sg1;
6e0f67b7d200 test files
kono
parents:
diff changeset
54 ++sg1; sg1--;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 278
diff changeset
55 printf("#0053:sg1=%d\n",sg1);
170
6e0f67b7d200 test files
kono
parents:
diff changeset
56
6e0f67b7d200 test files
kono
parents:
diff changeset
57 pg0 = &g0;
6e0f67b7d200 test files
kono
parents:
diff changeset
58 ph0 = &h0;
6e0f67b7d200 test files
kono
parents:
diff changeset
59 *pg0 = 123;
6e0f67b7d200 test files
kono
parents:
diff changeset
60 //*pg0++; *--pg0;
6e0f67b7d200 test files
kono
parents:
diff changeset
61 //*++pg0; *g0--;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 278
diff changeset
62 printf("#0060:g0=%d\n",*pg0);
170
6e0f67b7d200 test files
kono
parents:
diff changeset
63 pg1 = &g1;
6e0f67b7d200 test files
kono
parents:
diff changeset
64 ph1 = &h1;
6e0f67b7d200 test files
kono
parents:
diff changeset
65 *pg1 = -123;
6e0f67b7d200 test files
kono
parents:
diff changeset
66 //*pg1++; --*pg1;
6e0f67b7d200 test files
kono
parents:
diff changeset
67 //++*pg1; *pg1--;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 278
diff changeset
68 printf("#0066:g1=%d\n",*pg1);
170
6e0f67b7d200 test files
kono
parents:
diff changeset
69
6e0f67b7d200 test files
kono
parents:
diff changeset
70 psg0 = &sg0;
6e0f67b7d200 test files
kono
parents:
diff changeset
71 psh0 = &sh0;
6e0f67b7d200 test files
kono
parents:
diff changeset
72 *psg0 = 123;
6e0f67b7d200 test files
kono
parents:
diff changeset
73 //*sg0++; *--sg0;
6e0f67b7d200 test files
kono
parents:
diff changeset
74 //*++sg0; *sg0--;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 278
diff changeset
75 printf("#0073:sg0=%d\n",*psg0);
170
6e0f67b7d200 test files
kono
parents:
diff changeset
76 psg1 = &sg1;
6e0f67b7d200 test files
kono
parents:
diff changeset
77 psh1 = &sh1;
6e0f67b7d200 test files
kono
parents:
diff changeset
78 *psg1 = -123;
6e0f67b7d200 test files
kono
parents:
diff changeset
79 //*sg1++; *--sg1;
6e0f67b7d200 test files
kono
parents:
diff changeset
80 //*++sg1; *sg1--;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 278
diff changeset
81 printf("#0079:sg1=%d\n",*psg1);
170
6e0f67b7d200 test files
kono
parents:
diff changeset
82
6e0f67b7d200 test files
kono
parents:
diff changeset
83
6e0f67b7d200 test files
kono
parents:
diff changeset
84 h0 = g0 - 20;
6e0f67b7d200 test files
kono
parents:
diff changeset
85 c[33] = g0;
6e0f67b7d200 test files
kono
parents:
diff changeset
86
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 278
diff changeset
87 if (i==j) { printf("#0085:i==j\n"); } else { printf("i!=j\n"); }
170
6e0f67b7d200 test files
kono
parents:
diff changeset
88
6e0f67b7d200 test files
kono
parents:
diff changeset
89 a[33] = i;
6e0f67b7d200 test files
kono
parents:
diff changeset
90 b[33] = 105;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 278
diff changeset
91 printf("#0089:i=%d\n",i);
0c256ea2a97e Bitfield left value for ia32
kono
parents: 278
diff changeset
92 printf("#0090:j=%d\n",j);
170
6e0f67b7d200 test files
kono
parents:
diff changeset
93 i++; --i;
6e0f67b7d200 test files
kono
parents:
diff changeset
94 j++; --j;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 278
diff changeset
95 printf("#0093:i=%d\n",i);
0c256ea2a97e Bitfield left value for ia32
kono
parents: 278
diff changeset
96 printf("#0094:j=%d\n",j);
170
6e0f67b7d200 test files
kono
parents:
diff changeset
97 gi = 3333;
6e0f67b7d200 test files
kono
parents:
diff changeset
98 gj = 6666;
6e0f67b7d200 test files
kono
parents:
diff changeset
99 gi++; --gi;
6e0f67b7d200 test files
kono
parents:
diff changeset
100 gj++; --gj;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 278
diff changeset
101 printf("#0099:gi=%d\n",gi);
0c256ea2a97e Bitfield left value for ia32
kono
parents: 278
diff changeset
102 printf("#0100:gj=%d\n",gj);
170
6e0f67b7d200 test files
kono
parents:
diff changeset
103
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 278
diff changeset
104 printf("#0102:k=%d\n",k);
0c256ea2a97e Bitfield left value for ia32
kono
parents: 278
diff changeset
105 printf("#0103:m=%d\n",m);
0c256ea2a97e Bitfield left value for ia32
kono
parents: 278
diff changeset
106 printf("#0104:a[33]=%d\n",a[33]);
0c256ea2a97e Bitfield left value for ia32
kono
parents: 278
diff changeset
107 printf("#0105:b[33]=%d\n",b[33]);
0c256ea2a97e Bitfield left value for ia32
kono
parents: 278
diff changeset
108 printf("#0106:a[33]=%d\n",++a[33]);
0c256ea2a97e Bitfield left value for ia32
kono
parents: 278
diff changeset
109 printf("#0107:b[33]=%d\n",b[33]--);
170
6e0f67b7d200 test files
kono
parents:
diff changeset
110
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 278
diff changeset
111 printf("#0109:g0=%d\n",g0);
0c256ea2a97e Bitfield left value for ia32
kono
parents: 278
diff changeset
112 printf("#0110:h0=%d\n",h0);
0c256ea2a97e Bitfield left value for ia32
kono
parents: 278
diff changeset
113 printf("#0111:c[33]=%d\n",c[33]);
170
6e0f67b7d200 test files
kono
parents:
diff changeset
114
6e0f67b7d200 test files
kono
parents:
diff changeset
115 p = data;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 278
diff changeset
116 printf("#0114:*p++ = %d\n",*p++);
0c256ea2a97e Bitfield left value for ia32
kono
parents: 278
diff changeset
117 printf("#0115:*++p = %d\n",*++p);
170
6e0f67b7d200 test files
kono
parents:
diff changeset
118 *p++ = -343;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 278
diff changeset
119 printf("#0117:*p-- = %d\n",*p--);
0c256ea2a97e Bitfield left value for ia32
kono
parents: 278
diff changeset
120 printf("#0118:*--p = %d\n",*--p);
170
6e0f67b7d200 test files
kono
parents:
diff changeset
121 up = udata;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 278
diff changeset
122 printf("#0120:*up-- = %d\n",*up--);
0c256ea2a97e Bitfield left value for ia32
kono
parents: 278
diff changeset
123 printf("#0121:*--up = %d\n",*--up);
170
6e0f67b7d200 test files
kono
parents:
diff changeset
124 *up++ = 65530;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 278
diff changeset
125 printf("#0123:*up-- = %d\n",*up--);
0c256ea2a97e Bitfield left value for ia32
kono
parents: 278
diff changeset
126 printf("#0124:*--up = %d\n",*--up);
170
6e0f67b7d200 test files
kono
parents:
diff changeset
127
6e0f67b7d200 test files
kono
parents:
diff changeset
128
6e0f67b7d200 test files
kono
parents:
diff changeset
129 ii = f(i,j,k,m,a[33]);
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 278
diff changeset
130 printf("#0128:f()=%d\n",ii);
170
6e0f67b7d200 test files
kono
parents:
diff changeset
131 ii = g(i,j,k,m,a[33]);
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 278
diff changeset
132 printf("#0130:f()=%d\n",ii);
172
096559f07a70 some check
kono
parents: 170
diff changeset
133 return 0;
170
6e0f67b7d200 test files
kono
parents:
diff changeset
134 }
6e0f67b7d200 test files
kono
parents:
diff changeset
135
6e0f67b7d200 test files
kono
parents:
diff changeset
136 short f(short i,unsigned short j,unsigned short k,short m,short a)
6e0f67b7d200 test files
kono
parents:
diff changeset
137 {
6e0f67b7d200 test files
kono
parents:
diff changeset
138 return i+j*k-m/a;
6e0f67b7d200 test files
kono
parents:
diff changeset
139 }
6e0f67b7d200 test files
kono
parents:
diff changeset
140
6e0f67b7d200 test files
kono
parents:
diff changeset
141 unsigned
6e0f67b7d200 test files
kono
parents:
diff changeset
142 short g(short i,unsigned short j,unsigned short k,short m,short a)
6e0f67b7d200 test files
kono
parents:
diff changeset
143 {
6e0f67b7d200 test files
kono
parents:
diff changeset
144 return i+j*k-m/a;
6e0f67b7d200 test files
kono
parents:
diff changeset
145 }