]>
git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gcc.dg/fold-ior-4.c
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-optimized" } */
4 unsigned int test_ior(unsigned char i
)
6 return i
| (i
<<8) | (i
<<16) | (i
<<24);
9 unsigned int test_xor(unsigned char i
)
11 return i
^ (i
<<8) ^ (i
<<16) ^ (i
<<24);
14 unsigned int test_ior_1s(unsigned char i
)
19 unsigned int test_ior_1u(unsigned char i
)
25 unsigned int test_xor_1s(unsigned char i
)
30 unsigned int test_xor_1u(unsigned char i
)
36 unsigned int test_ior_2s(unsigned char i
)
38 return (i
<<8) | (i
<<16);
41 unsigned int test_ior_2u(unsigned char i
)
44 return (t
<<8) | (t
<<16);
47 unsigned int test_xor_2s(unsigned char i
)
49 return (i
<<8) ^ (i
<<16);
52 unsigned int test_xor_2u(unsigned char i
)
55 return (t
<<8) ^ (t
<<16);
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" } } */