gcc/
[official-gcc.git] / gcc / testsuite / gcc.c-torture / execute / pr45262.c
blob72e186bf287fc41d24445d765fc97dc9faf238f8
1 /* PR middle-end/45262 */
3 extern void abort (void);
5 int
6 foo (unsigned int x)
8 return ((int) x < 0) || ((int) (-x) < 0);
11 int
12 bar (unsigned int x)
14 return x >> 31 || (-x) >> 31;
17 int
18 main (void)
20 if (foo (1) != 1)
21 abort ();
22 if (foo (0) != 0)
23 abort ();
24 if (foo (-1) != 1)
25 abort ();
26 if (bar (1) != 1)
27 abort ();
28 if (bar (0) != 0)
29 abort ();
30 if (bar (-1) != 1)
31 abort ();
32 return 0;