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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [uninit-pred-4_b.c] - Blame information for rev 689

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 689 jeremybenn
/* { dg-do compile } */
2
/* { dg-options "-Wuninitialized -O2" } */
3
 
4
int g;
5
void bar();
6
void blah(int);
7
int foo (int n, int m, int r, int t)
8
{
9
  int flag = 0;
10
  int v;
11
 
12
  if (t)
13
    {
14
      if (n)
15
        {
16
          v = r;    /* init path 1 */
17
          flag = 1;
18
        }
19
 
20
      if (m) g++;
21
      else bar();
22
 
23
      if (flag)  /* properly  guarded */
24
        blah(v); /* { dg-bogus "uninitialized" "bogus warning" } */
25
    }
26
  else
27
    {
28
      v = r+1; /* init path 2 */
29
      flag = 2;
30
    }
31
 
32
  if (m) g++;
33
  else bar();
34
 
35
  if (g)   /* guard can not be determined statically to be safe */
36
    blah(v); /* { dg-warning "uninitialized" "real warning" } */
37
 
38
  return 0;
39
}
40
 

powered by: WebSVN 2.1.0

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