]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/testsuite/gcc.dg/fold-ior-4.c
Update copyright years.
[thirdparty/gcc.git] / gcc / testsuite / gcc.dg / fold-ior-4.c
CommitLineData
96146e61
RS
1/* { dg-do compile } */
2/* { dg-options "-O2 -fdump-tree-optimized" } */
3
4unsigned int test_ior(unsigned char i)
5{
6 return i | (i<<8) | (i<<16) | (i<<24);
7}
8
9unsigned int test_xor(unsigned char i)
10{
11 return i ^ (i<<8) ^ (i<<16) ^ (i<<24);
12}
13
14unsigned int test_ior_1s(unsigned char i)
15{
16 return i | (i<<8);
17}
18
19unsigned int test_ior_1u(unsigned char i)
20{
21 unsigned int t = i;
22 return t | (t<<8);
23}
24
25unsigned int test_xor_1s(unsigned char i)
26{
27 return i ^ (i<<8);
28}
29
30unsigned int test_xor_1u(unsigned char i)
31{
32 unsigned int t = i;
33 return t ^ (t<<8);
34}
35
36unsigned int test_ior_2s(unsigned char i)
37{
38 return (i<<8) | (i<<16);
39}
40
41unsigned int test_ior_2u(unsigned char i)
42{
43 unsigned int t = i;
44 return (t<<8) | (t<<16);
45}
46
47unsigned int test_xor_2s(unsigned char i)
48{
49 return (i<<8) ^ (i<<16);
50}
51
52unsigned int test_xor_2u(unsigned char i)
53{
54 unsigned int t = i;
55 return (t<<8) ^ (t<<16);
56}
57
58/* { dg-final { scan-tree-dump-not " \\^ " "optimized" } } */
59/* { dg-final { scan-tree-dump-not " \\| " "optimized" } } */
60/* { dg-final { scan-tree-dump-times " \\* 16843009" 2 "optimized" } } */
61