libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / fold-xor-and-or.c
blobe5dc98e7541d57637439ae12aba3459d67d5807b
1 /* { dg-do compile } */
2 /* { dg-options "-O3 -fdump-tree-optimized" } */
4 typedef unsigned long int uint64_t;
6 int cmp1(int d1, int d2) {
7 if (((d1 ^ d2) & 0xabcd) == 0 || d1 != d2)
8 return 0;
9 return 1;
12 int cmp2(int d1, int d2) {
13 if (d1 != d2 || ((d1 ^ d2) & 0xabcd) == 0)
14 return 0;
15 return 1;
18 int cmp3(int d1, int d2) {
19 if (10 > (0xabcd & (d2 ^ d1)) || d2 != d1)
20 return 0;
21 return 1;
24 int cmp4(int d1, int d2) {
25 if (d2 != d1 || 10 > (0xabcd & (d2 ^ d1)))
26 return 0;
27 return 1;
30 int cmp1_64(uint64_t d1, uint64_t d2) {
31 if (((d1 ^ d2) & 0xabcd) == 0 || d1 != d2)
32 return 0;
33 return 1;
36 int cmp2_64(uint64_t d1, uint64_t d2) {
37 if (d1 != d2 || ((d1 ^ d2) & 0xabcd) == 0)
38 return 0;
39 return 1;
42 int cmp3_64(uint64_t d1, uint64_t d2) {
43 if (10 > (0xabcd & (d2 ^ d1)) || d2 != d1)
44 return 0;
45 return 1;
48 int cmp4_64(uint64_t d1, uint64_t d2) {
49 if (d2 != d1 || 10 > (0xabcd & (d2 ^ d1)))
50 return 0;
51 return 1;
54 /* The if should be removed, so the condition should not exist */
55 /* { dg-final { scan-tree-dump-not "d1_\[0-9\]+.D. \\^ d2_\[0-9\]+.D." "optimized" } } */