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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [uninit-15.c] - Blame information for rev 754

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

Line No. Rev Author Line
1 689 jeremybenn
/* PR tree-optimization/17506
2
   We issue an uninitialized variable warning at a wrong location at
3
   line 11, which is very confusing.  Make sure we print out a note to
4
   make it less confusing.  (xfailed alternative)
5
   But it is of course ok if we warn in bar about uninitialized use
6
   of j.  (not xfailed alternative)  */
7
/* { dg-do compile } */
8
/* { dg-options "-O1 -Wuninitialized" } */
9
 
10
inline int
11
foo (int i)
12
{
13
  if (i) /* { dg-warning "used uninitialized in this function" "" { xfail *-*-* } } */
14
    return 1;
15
  return 0;
16
}
17
 
18
void baz (void);
19
 
20
void
21
bar (void)
22
{
23
  int j; /* { dg-message "note: 'j' was declared here" "" { xfail *-*-* } } */
24
  for (; foo (j); ++j)  /* { dg-warning "'j' is used uninitialized" } */
25
    baz ();
26
}

powered by: WebSVN 2.1.0

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