blob: 7d2b63718c55c9c9f916a8ce9106a9dfee1b90e8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-optimized" } */
int test1(unsigned int x, unsigned int y)
{
#if __SIZEOF_INT__ == 4
unsigned int r1 = (x << 16) | (x >> 16);
unsigned int r2 = (y << 16) | (y >> 16);
return r1 == r2;
#else
return x == y;
#endif
}
int test2(unsigned int x)
{
#if __SIZEOF_INT__ == 4
unsigned int r1 = (x << 16) | (x >> 16);
return r1 == 12345;
#else
return x == 12345;
#endif
}
int test3(unsigned int x)
{
#if __SIZEOF_INT__ == 4
unsigned int r1 = (x << 16) | (x >> 16);
return r1 == 0;
#else
return x == 0;
#endif
}
int test4(unsigned int x)
{
#if __SIZEOF_INT__ == 4
unsigned int r1 = (x << 16) | (x >> 16);
return r1 == ~0;
#else
return x == ~0;
#endif
}
/* { dg-final { scan-tree-dump-times "r>>" 0 "optimized" } } */
|