PR tree-optimization/81303
[official-gcc.git] / gcc / testsuite / gcc.dg / 20040627-1.c
blob2b4f09fefc7ed055706cec4789355b55e0652151
1 /* { dg-do link } */
2 /* { dg-options "-O2" } */
4 extern void link_error (void);
7 void test(int x)
9 if ((x & ~x) != 0)
10 link_error ();
11 if ((~x & x) != 0)
12 link_error ();
14 if ((x ^ ~x) != -1)
15 link_error ();
16 if ((~x ^ x) != -1)
17 link_error ();
19 if ((x | ~x) != -1)
20 link_error ();
21 if ((~x | x) != -1)
22 link_error ();
24 if (x && !x)
25 link_error ();
26 if (!x && x)
27 link_error ();
29 if (!(x || !x))
30 link_error ();
31 if (!(!x || x))
32 link_error ();
35 int main()
37 test (0);
38 test (1);
39 test (-1);
40 return 0;