Marek Polacek <pola...@redhat.com> writes:

> --- gcc/testsuite/gcc.dg/pr59846.c.mp 2014-01-23 19:34:32.790368466 +0100
> +++ gcc/testsuite/gcc.dg/pr59846.c    2014-01-23 19:42:00.910793437 +0100
> @@ -0,0 +1,39 @@
> +/* PR c/59846 */
> +/* { dg-do compile } */
> +/* { dg-options "-Wlogical-op -Wtype-limits" } */
> +
> +_Bool
> +fn1 (unsigned int p)
> +{
> +  return 0UL > p; /* { dg-warning "14:comparison is always false due to 
> limited range of data type" } */
> +}
> +
> +_Bool
> +fn2 (unsigned int p)
> +{
> +  return 0UL <= p; /* { dg-warning "14:comparison is always true due to 
> limited range of data type" } */
> +}

FAIL: gcc.dg/pr59846.c  (test for warnings, line 8)
FAIL: gcc.dg/pr59846.c  (test for warnings, line 14)
FAIL: gcc.dg/pr59846.c (test for excess errors)
Excess errors:
/daten/aranym/gcc/gcc-20140124/gcc/testsuite/gcc.dg/pr59846.c:8:14: warning: 
comparison of unsigned expression < 0 is always false [-Wtype-limits]
/daten/aranym/gcc/gcc-20140124/gcc/testsuite/gcc.dg/pr59846.c:14:14: warning: 
comparison of unsigned expression >= 0 is always true [-Wtype-limits]

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

Reply via email to