aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/pr39867.c
blob: cb7972452928ad0057e9848a8ff5a4b8eecbaef7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
/* { dg-do link } */
/* { dg-options "-O2" } */

int main (void)
{
  int exp = -1;
  /* Wrong folding of the LHS to an unsigned MAX leads to 4294967295 != 2.  */
  if ((exp < 2 ? 2U : (unsigned int) exp) != 2)
    link_error ();
  return 0;
}