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

Subversion Repositories openrisc

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

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

Line No. Rev Author Line
1 689 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.