2 // { dg-options "-ansi -pedantic-errors -Wsign-compare -Wno-deprecated" }
4 // Copyright (C) 2001 Free Software Foundation, Inc.
5 // Contributed by Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 5/13/2001
7 int foo(int x, int y, unsigned u)
9 /* A MAX_EXPR is non-negative if EITHER argument to the MAX_EXPR is
10 determined to be non-negative. */
11 if (u < (x >? -1)) // { dg-warning "" } signed and unsigned
17 if (u < (x >? (y ? (x==y) : 10)))
19 if (((y ? 10 : (x==y)) >? x) < u)
22 /* A MIN_EXPR is non-negative if BOTH arguments to the MIN_EXPR are
23 determined to be non-negative. */
24 if (u < ((x?11:8) <? -1)) // { dg-warning "" } signed and unsigned
26 if (u < ((x?11:8) <? 10))
28 if ((10 <? (x?8:11)) < u)
30 if (u < ((x?11:(x==y)) <? 10))
32 if ((10 <? (x?(x==y):11)) < u)