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.5.1/] [gcc/] [testsuite/] [gcc.dg/] [uninit-16.c] - Blame information for rev 298

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 298 jeremybenn
/* { dg-do compile } */
2
/* { dg-options "-O2 -Wuninitialized" } */
3
 
4
int foo, bar;
5
 
6
static
7
void decode_reloc(int reloc, int *is_alt)
8
{
9
  if (reloc >= 20)
10
      *is_alt = 1;
11
  else if (reloc >= 10)
12
      *is_alt = 0;
13
}
14
 
15
void testfunc()
16
{
17
  int alt_reloc;
18
 
19
  decode_reloc(foo, &alt_reloc);
20
 
21
  if (alt_reloc) /* { dg-warning "may be used uninitialized" } */
22
    bar = 42;
23
}

powered by: WebSVN 2.1.0

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