PR tree-optimization/81303
[official-gcc.git] / gcc / testsuite / gcc.dg / pr39867.c
blobfbe09241cbdc37f0ee9ecd4035215f824e95aabe
1 /* { dg-do link } */
2 /* { dg-options "-O2" } */
4 extern void link_error (void);
6 int main (void)
8 int exp = -1;
9 /* Wrong folding of the LHS to an unsigned MAX leads to 4294967295 != 2. */
10 if ((exp < 2 ? 2U : (unsigned int) exp) != 2)
11 link_error ();
12 return 0;