OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.dg/] [uninit-8.c] - Rev 154

Compare with Previous | Blame | View Log

/* Uninitialized variable warning tests...
   Inspired by part of optabs.c:expand_binop.
   May be the same as uninit-1.c.  */
 
/* { dg-do compile } */
/* { dg-options "-O -Wuninitialized" } */
 
#include <limits.h>
 
void
add_bignums (int *out, int *x, int *y)
{
    int p, sum;
    int carry; /* { dg-bogus "carry" "uninitialized variable warning" } */
 
    p = 0;
    for (; *x; x++, y++, out++, p++)
    {
	if (p)
	    sum = *x + *y + carry;
	else
	    sum = *x + *y;
 
	if (sum < 0)
	{
	    carry = 1;
	    sum -= INT_MAX;
	}
	else
	    carry = 0;
    }
}
 

Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.