]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/testsuite/gcc.dg/fold-bopcond-1.c
Update copyright years.
[thirdparty/gcc.git] / gcc / testsuite / gcc.dg / fold-bopcond-1.c
CommitLineData
714445ae
BC
1/* { dg-do compile } */
2/* { dg-options "-O3 -fdump-tree-ifcvt" } */
3
4int foo1 (unsigned short a[], unsigned int x)
5{
6 unsigned int i;
7 for (i = 0; i < 1000; i++)
8 {
9 x = a[i];
10 a[i] = (unsigned short)(x <= 32768 ? x + 32768 : 0);
11 }
12 return x;
13}
14
15int foo2 (unsigned short a[], unsigned int x)
16{
17 unsigned int i;
18 for (i = 0; i < 1000; i++)
19 {
20 x = a[i];
21 a[i] = (unsigned short)(x < 32768 ? x + 32768 : 0);
22 }
23 return x;
24}
25
26int foo3 (unsigned short a[], unsigned int x)
27{
28 unsigned int i;
29 for (i = 0; i < 1000; i++)
30 {
31 x = a[i];
32 a[i] = (unsigned short)(x < 1000 ? x - 1000 : 0);
33 }
34 return x;
35}
36
37int foo4 (unsigned short a[], unsigned int x)
38{
39 unsigned int i;
40 for (i = 0; i < 1000; i++)
41 {
42 x = a[i];
43 a[i] = (unsigned short)(x <= 2 ? x + 999 : 1001);
44 }
45 return x;
46}
47
48/* { dg-final { scan-tree-dump-times "MIN_EXPR " 4 "ifcvt" } } */