OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [pr45083.c] - Rev 801

Go to most recent revision | Compare with Previous | Blame | View Log

/* PR tree-optimization/45083 */
/* { dg-do compile } */
/* { dg-options "-O2 -Wuninitialized" } */
 
struct S { char *a; unsigned b; unsigned c; };
extern int foo (const char *);
extern void bar (int, int);
 
static void
baz (void)
{
  struct S cs[1];	/* { dg-message "was declared here" } */
  switch (cs->b)	/* { dg-warning "cs\[^\n\r\]*\\.b\[^\n\r\]*is used uninitialized" } */
    {
    case 101:
      if (foo (cs->a))	/* { dg-warning "cs\[^\n\r\]*\\.a\[^\n\r\]*may be used uninitialized" } */
	bar (cs->c, cs->b);	/* { dg-warning "cs\[^\n\r\]*\\.c\[^\n\r\]*may be used uninitialized" } */
    }
}
 
void
test (void)
{
  baz ();
}
 

Go to most recent revision | 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.