2014-10-24 Christophe Lyon <christophe.lyon@linaro.org>
[official-gcc.git] / gcc / testsuite / gcc.target / sh / pr51244-17.c
blob621abb788a92037e27ec2b3dda59fbdb89bc32a5
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-skip-if "" { "sh*-*-*" } { "-m5*" } { "" } } */
6 /* { dg-final { scan-assembler-not "extu|exts" } } */
8 int
9 test00 (int a, int b, int c, int d)
11 int x = a == b;
12 int y = c == 0;
13 return x == y;
16 int
17 test01 (int a, int b, int c, int d)
19 int x = a == b;
20 int y = c == d;
21 return x == y;
24 int
25 test02 (int a, int b, int c, int d)
27 int x = a != b;
28 int y = c == d;
29 return x == y;
32 int
33 test03 (int a, int b, int c, int d)
35 int x = a != b;
36 int y = c != d;
37 return x == y;
40 int
41 test04 (int a, int b, int c, int d)
43 int x = a != b;
44 int y = c != d;
45 return x == y;
48 int
49 test05 (int a, int b, int c, int d)
51 int x = a == b;
52 int y = c == 0;
53 return x != y;
56 int
57 test06 (int a, int b, int c, int d)
59 int x = a == b;
60 int y = c == 0;
61 return x ^ y;
64 int
65 test07 (int a, int b, int c, int d)
67 int x = a == b;
68 int y = c == 0;
69 return x | y;
72 int
73 test08 (int a, int b, int c, int d)
75 int x = a == b;
76 int y = c == 0;
77 return x & y;
80 int
81 test09 (int a, int b, int c, int d)
83 int x = a == b;
84 int y = c == d;
85 return x != y;
88 int
89 test10 (int a, int b, int c, int d)
91 int x = a != b;
92 int y = c == d;
93 return x != y;
96 int
97 test11 (int a, int b, int c, int d)
99 int x = a != b;
100 int y = c != d;
101 return x != y;
105 test12 (int a, int b, int c, int d)
107 int x = a != b;
108 int y = c != d;
109 return x != y;
113 test13 (int a, int b, int c, int d, int e, int f)
115 int x = a == b;
116 int y = c == 0;
117 int z = d == e;
118 return x == y || x == z;
122 test14 (int a, int b, int c, int d, int e, int f)
124 int x = a == b;
125 int y = c == 0;
126 int z = d == e;
127 return x == y && x == z;
131 test15 (int a, int b, int c, int d, int e, int f)
133 int x = a != b;
134 int y = c == 0;
135 int z = d == e;
136 return x == y || x == z;
140 test16 (int a, int b, int c, int d, int e, int f)
142 int x = a != b;
143 int y = c == 0;
144 int z = d == e;
145 return x == y && x == z;
149 test17 (int a, int b, int c, int d, int e, int f)
151 int x = a != b;
152 int y = c != 0;
153 int z = d == e;
154 return x == y || x == z;
158 test18 (int a, int b, int c, int d, int e, int f)
160 int x = a != b;
161 int y = c != 0;
162 int z = d == e;
163 return x == y && x == z;
167 test19 (int a, int b, int c, int d, int e, int f)
169 int x = a != b;
170 int y = c != 0;
171 int z = d == e;
172 return x == y || x == z;
176 test20 (int a, int b, int c, int d, int e, int f)
178 int x = a != b;
179 int y = c != 0;
180 int z = d != e;
181 return x == y && x == z;
185 test21 (int a, int b, int c, int d)
187 int x = a == b;
188 int y = c == 0;
189 return x + y;
193 test22 (int a, int b, int c, int d)
195 int x = a != b;
196 int y = c == 0;
197 return x + y;
201 test23 (int a, int b, int c, int d)
203 int x = a != b;
204 int y = c != 0;
205 return x + y;
209 test24 (int a, int b, int c, int d)
211 int x = a == b;
212 int y = c == 0;
213 return x - y;
217 test25 (int a, int b, int c, int d)
219 int x = a != b;
220 int y = c == 0;
221 return x - y;
225 test26 (int a, int b, int c, int d)
227 int x = a != b;
228 int y = c != 0;
229 return x - y;
233 test27 (int a, int b, int c, int d)
235 int x = a == b;
236 int y = c == 0;
237 return x * y;
241 test28 (int a, int b, int c, int d)
243 int x = a != b;
244 int y = c == 0;
245 return x * y;
249 test29 (int a, int b, int c, int d)
251 int x = a != b;
252 int y = c != 0;
253 return x * y;
257 test30 (int a, int b)
259 return ((a & 0x7F) == 1)
260 | ((a & 0xFF00) == 0x0200)
261 | ((a & 0xFF0000) == 0x030000);
265 test31 (int a, int b)
267 return ((a & 0x7F) == 1)
268 | ((a & 0xFF00) == 0x0200)
269 | ((a & 0xFF0000) == 0x030000)
270 | ((a & 0xFF000000) == 0x04000000);
274 test32 (int* a, int b, int c, volatile char* d)
276 d[1] = a[0] != 0;
277 return b;
281 test33 (int* a, int b, int c, volatile char* d)
283 d[1] = a[0] == 0;
284 return b;
287 char
288 test34 (int a, int* b)
290 return (b[4] & b[0] & a) == a;
293 unsigned char
294 test35 (int a, int* b)
296 return (b[4] & b[0] & a) == a;