[gcc]
[official-gcc.git] / gcc / testsuite / gcc.target / sh / pr51244-17.c
blob06c77cdde34ea1b5d912f6f5997ea751e90760a7
1 /* Check that no unnecessary zero extensions are done on values that are
2 results of arithmetic with T bit inputs. */
3 /* { dg-do compile } */
4 /* { dg-options "-O1" } */
5 /* { dg-final { scan-assembler-not "extu|exts" } } */
7 int
8 test00 (int a, int b, int c, int d)
10 int x = a == b;
11 int y = c == 0;
12 return x == y;
15 int
16 test01 (int a, int b, int c, int d)
18 int x = a == b;
19 int y = c == d;
20 return x == y;
23 int
24 test02 (int a, int b, int c, int d)
26 int x = a != b;
27 int y = c == d;
28 return x == y;
31 int
32 test03 (int a, int b, int c, int d)
34 int x = a != b;
35 int y = c != d;
36 return x == y;
39 int
40 test04 (int a, int b, int c, int d)
42 int x = a != b;
43 int y = c != d;
44 return x == y;
47 int
48 test05 (int a, int b, int c, int d)
50 int x = a == b;
51 int y = c == 0;
52 return x != y;
55 int
56 test06 (int a, int b, int c, int d)
58 int x = a == b;
59 int y = c == 0;
60 return x ^ y;
63 int
64 test07 (int a, int b, int c, int d)
66 int x = a == b;
67 int y = c == 0;
68 return x | y;
71 int
72 test08 (int a, int b, int c, int d)
74 int x = a == b;
75 int y = c == 0;
76 return x & y;
79 int
80 test09 (int a, int b, int c, int d)
82 int x = a == b;
83 int y = c == d;
84 return x != y;
87 int
88 test10 (int a, int b, int c, int d)
90 int x = a != b;
91 int y = c == d;
92 return x != y;
95 int
96 test11 (int a, int b, int c, int d)
98 int x = a != b;
99 int y = c != d;
100 return x != y;
104 test12 (int a, int b, int c, int d)
106 int x = a != b;
107 int y = c != d;
108 return x != y;
112 test13 (int a, int b, int c, int d, int e, int f)
114 int x = a == b;
115 int y = c == 0;
116 int z = d == e;
117 return x == y || x == z;
121 test14 (int a, int b, int c, int d, int e, int f)
123 int x = a == b;
124 int y = c == 0;
125 int z = d == e;
126 return x == y && x == z;
130 test15 (int a, int b, int c, int d, int e, int f)
132 int x = a != b;
133 int y = c == 0;
134 int z = d == e;
135 return x == y || x == z;
139 test16 (int a, int b, int c, int d, int e, int f)
141 int x = a != b;
142 int y = c == 0;
143 int z = d == e;
144 return x == y && x == z;
148 test17 (int a, int b, int c, int d, int e, int f)
150 int x = a != b;
151 int y = c != 0;
152 int z = d == e;
153 return x == y || x == z;
157 test18 (int a, int b, int c, int d, int e, int f)
159 int x = a != b;
160 int y = c != 0;
161 int z = d == e;
162 return x == y && x == z;
166 test19 (int a, int b, int c, int d, int e, int f)
168 int x = a != b;
169 int y = c != 0;
170 int z = d == e;
171 return x == y || x == z;
175 test20 (int a, int b, int c, int d, int e, int f)
177 int x = a != b;
178 int y = c != 0;
179 int z = d != e;
180 return x == y && x == z;
184 test21 (int a, int b, int c, int d)
186 int x = a == b;
187 int y = c == 0;
188 return x + y;
192 test22 (int a, int b, int c, int d)
194 int x = a != b;
195 int y = c == 0;
196 return x + y;
200 test23 (int a, int b, int c, int d)
202 int x = a != b;
203 int y = c != 0;
204 return x + y;
208 test24 (int a, int b, int c, int d)
210 int x = a == b;
211 int y = c == 0;
212 return x - y;
216 test25 (int a, int b, int c, int d)
218 int x = a != b;
219 int y = c == 0;
220 return x - y;
224 test26 (int a, int b, int c, int d)
226 int x = a != b;
227 int y = c != 0;
228 return x - y;
232 test27 (int a, int b, int c, int d)
234 int x = a == b;
235 int y = c == 0;
236 return x * y;
240 test28 (int a, int b, int c, int d)
242 int x = a != b;
243 int y = c == 0;
244 return x * y;
248 test29 (int a, int b, int c, int d)
250 int x = a != b;
251 int y = c != 0;
252 return x * y;
256 test30 (int a, int b)
258 return ((a & 0x7F) == 1)
259 | ((a & 0xFF00) == 0x0200)
260 | ((a & 0xFF0000) == 0x030000);
264 test31 (int a, int b)
266 return ((a & 0x7F) == 1)
267 | ((a & 0xFF00) == 0x0200)
268 | ((a & 0xFF0000) == 0x030000)
269 | ((a & 0xFF000000) == 0x04000000);
273 test32 (int* a, int b, int c, volatile char* d)
275 d[1] = a[0] != 0;
276 return b;
280 test33 (int* a, int b, int c, volatile char* d)
282 d[1] = a[0] == 0;
283 return b;
286 char
287 test34 (int a, int* b)
289 return (b[4] & b[0] & a) == a;
292 unsigned char
293 test35 (int a, int* b)
295 return (b[4] & b[0] & a) == a;