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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [uninit-pred-5_a.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 -Wno-attributes -O2" } */
3
 
4
int g;
5
int bar();
6
int blah(int);
7
void t(int);
8
 
9
__attribute__((always_inline))
10
int foo (int n, int* v, int r)
11
{
12
  int flag = 0;
13
  if (r > n)
14
    {
15
      *v = bar();
16
      flag = 1;
17
    }
18
 
19
  if (n > g)
20
    g++;
21
  else
22
    bar();
23
 
24
  return flag;
25
}
26
 
27
int a[100];
28
int b[100];
29
int blah(int n)
30
{
31
  int i;
32
   for (i = 0 ; i < n; i++)
33
     {
34
       int v;
35
       if (!foo (n, &v, b[i]))
36
         return 0;
37
       t (v); /* { dg-bogus "uninitialized" "bogus warning" } */
38
     }
39
   return 1;
40
}
41
 

powered by: WebSVN 2.1.0

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